douzhe1264 2017-04-05 15:03
浏览 64
已采纳

PHP升级问题

I am running a MacBook Air with macOS Sierra 10.12.3. I upgraded my PHP from 5.x to 7.1.1 according to this site and now I am having two issues:

a) The PHP process startup takes around 7 seconds, even for a php -v to print PHP's version. edit: Solved.

b) Apache does not serve my pages anymore locally. Chrome just shows the generic error page with "ERR_CONNECTION_REFUSED". I have restarted the apache service but don't really know what else to do. The apache vhosts config file worked before and still looks good. edit: Also nothing in the apache error logs.

edit: The syslog shows (org.apache.httpd[71685]): Service exited due to signal: Segmentation fault: 11 sent by exc handler[0] (org.apache.httpd): Service only ran for 5 seconds. Pushing respawn out by 5 seconds

Does anyone know how to fix this?

  • 写回答

2条回答 默认 最新

  • duanlangwen9597 2017-04-05 15:38
    关注

    https://php-osx.liip.ch is a pretty good site, I used to use it before to upgrade my php installations. I found that time to time it would be untrust worthy and sometimes brick my installation. Edit The scripts used on that site usually compile PHP when ran and this can lead to some interesting quirks and inconsistencies. So I switched to using brew.

    Brew is a handy tool for Mac that works a lot like apt-get or yum. I would recommend you try this, it adds libraries in a way that allow you to purge them from your machine and reverting to older versions.

    $ brew search php71
    # lists all the matches for php71, you will find "homebrew/php/php71"
    
    $ brew install homebrew/php/php71
    # installs php71, it will give you some good instructions if there are errors
    # typically some permission errors, but it gives commands to run too
    
    $ brew link homebrew/php/php71
    # overrides the local php command with "homebrew/php/php71"
    
    $ php -v
    PHP 7.1.1 (cli) ...
    

    Then I would suggest looking at PHP Local Server that is built in if its still not working. Although I am 99% sure your issues will be resolved.

    In future upgrading your php version is as simple as doing the above again where php71 is your new version (example php72 for 7.2). Removing your old version is easy, although does no harm and does allow you to quickly switch your versions around with a single command line option.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 shape_predictor_68_face_landmarks.dat
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 对于相关问题的求解与代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作
  • ¥15 求NPF226060磁芯的详细资料