I've installed magento2 without issues and at installation it detected my php version correctly (7.0.0, using mamp). Now at upgrade it detects the system one (5.5.31) and some packages missing, like mcrypt.
using phpinfo() on my webserver gives version 7.0.0 and mcrypt enabled.
Why is that and how can it be fixed?
1 Answer 1
It turns out that magento is using the cron information to check for your php info. In my crontab I had (sudo crontab -u user -e):
*/1 * * * * /usr/bin/php -c /Library/Application\ Support/appsolute/MAMP\ PRO/conf/php.ini /User/magento-2/bin/magento cron:run >> /User/magento-2/var/log/setup.cron.log&
*/1 * * * * /usr/bin/php -c /Library/Application\ Support/appsolute/MAMP\ PRO/conf/php.ini /User/magento-2/update/cron.php >> /User/magento-2/var/log/setup.cron.log&
*/1 * * * * /usr/bin/php -c /Library/Application\ Support/appsolute/MAMP\ PRO/conf/php.ini /User/magento-2/bin/magento setup:cron:run >> /User/magento-2/var/log/setup.cron.log&
So it was using the binary /usr/bin/php. Instead it should have been using my environment php, which was from mamp:
*/1 * * * * /Applications/MAMP/bin/php/php7.0.0/bin/php -c /Library/Application\ Support/appsolute/MAMP\ PRO/conf/php.ini /User/magento-2/bin/magento cron:run >> /User/magento-2/var/log/setup.cron.log&
*/1 * * * * /Applications/MAMP/bin/php/php7.0.0/bin/php -c /Library/Application\ Support/appsolute/MAMP\ PRO/conf/php.ini /User/magento-2/update/cron.php >> /User/magento-2/var/log/setup.cron.log&
*/1 * * * * /Applications/MAMP/bin/php/php7.0.0/bin/php -c /Library/Application\ Support/appsolute/MAMP\ PRO/conf/php.ini /User/magento-2/bin/magento setup:cron:run >> /User/magento-2/var/log/setup.cron.log&
Now the check is detecting php7.
php -vin you terminal and see what its return. Might be yourPHP CLIversion is different.