Symptoms
When running the php command, the php-cli wrapper picks up the PHP version that is configured in the working directory through the .htaccess file. When running composer, the system default is used instead:
# grep AddHandler .htaccess
AddHandler application/x-httpd-ea-php74 .php .php7 .phtml
# composer diagnose
...
PHP version: 7.0.33
Cause
This issue is caused by Composer using /opt/cpanel/composer/bin as its working directory.
Resolution
Use SCL or call the full path to the binaries involved.
Warning: Replace ea-php74 with the PHP version you are using.
# scl enable ea-php74 'composer diagnose'
# /opt/cpanel/ea-php71/root/usr/bin/php /opt/cpanel/composer/bin/composer diagnose
# ea-php74 /opt/cpanel/composer/bin/composer diagnose
Comments
0 comments
Article is closed for comments.