duandian8110 2017-01-06 17:44
浏览 31
已采纳

Ubuntu上的PHP 5升级不适用于Magento

I had an outdated version of PHP on my system, so attempted to upgrade from 5.5.9 to 5.6.

I followed the following steps on my Digital Ocean Ubuntu droplet:

I installed Ondřej Surý's PPA and selected 5.6 as well as other packages related to the main one, like the XML package.

When I do php -v on my server, it says

PHP 5.6.29-1+deb.sury.org~trusty+1 (cli)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies

This indicated to me that the update went through.

But when I restart my apache server and check the error logs, it says

Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4.20 configured -- resuming normal operations

I believe the latest version of Magento on my server is giving me this error (HTTP 500) because it is using the wrong version of PHP...

How do I fix this? Thank you.

  • 写回答

1条回答 默认 最新

  • druzuz321103 2017-01-06 17:57
    关注

    The digital ocean community site here offered a couple of extra commands:

    sudo add-apt-repository ppa:ondrej/php
    sudo apt-get update
    sudo apt-get install php5.6 php5.6-mbstring php5.6-mcrypt php5.6-mysql php5.6-xml
    sudo a2dismod php5
    sudo a2enmod php5.6
    sudo service apache2 restart
    

    Note the a2dismod and a2enmod steps. The post says:

    Without the a2dismod/a2ensmod steps, Apache will continue to see your older version of PHP, even if command line is seeing the new version.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?