0

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?

  • Execute php -v in you terminal and see what its return. Might be your PHP CLI version is different. – Jayesh Patel Apr 2 '16 at 4:35
  • @JayeshPatel no, my cli version is the same. – Claudiu Creanga Apr 2 '16 at 11:19
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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.