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.

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

报告相同问题?

悬赏问题

  • ¥15 matlab图像高斯低通滤波
  • ¥15 针对曲面部件的制孔路径规划,大家有什么思路吗
  • ¥15 钢筋实图交点识别,机器视觉代码
  • ¥15 如何在Linux系统中,但是在window系统上idea里面可以正常运行?(相关搜索:jar包)
  • ¥50 400g qsfp 光模块iphy方案
  • ¥15 两块ADC0804用proteus仿真时,出现异常
  • ¥15 关于风控系统,如何去选择
  • ¥15 这款软件是什么?需要能满足我的需求
  • ¥15 SpringSecurityOauth2登陆前后request不一致
  • ¥15 禅道二次开发编辑版本,上传不了发行包