Created
August 11, 2025 00:08
-
-
Save x-magic/885195c6034d9462ec2f1d2d4eb21094 to your computer and use it in GitHub Desktop.
Add Composer executable to cPanel/WHM > v130 globally
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Download the latest version of composer.phar to /usr/local/bin/composer.phar | |
# Then put this file to /usr/local/bin/composer and allow execution | |
# Run Composer with cPanel PHP redirector and required parameters for CLI only | |
/usr/local/bin/php -d allow_url_fopen=1 -d zend.detect_unicode=0 /usr/local/bin/composer.phar $@ | |
# For global self-update, you'll need the following for cronjob: | |
# /bin/bash -c 'COMPOSER_ALLOW_SUPERUSER=1 /usr/local/bin/php -d allow_url_fopen=1 -d zend.detect_unicode=0 /usr/local/bin/composer.phar self-update' > /dev/null 2>&1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment