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 plotBAPC画图出错
  • ¥30 关于#opencv#的问题:使用大疆无人机拍摄水稻田间图像,拼接成tif图片,用什么方法可以识别并框选出水稻作物行
  • ¥15 Python卡尔曼滤波融合
  • ¥20 iOS绕地区网络检测
  • ¥15 python验证码滑块图像识别
  • ¥15 根据背景及设计要求撰写设计报告
  • ¥20 能提供一下思路或者代码吗
  • ¥15 用twincat控制!
  • ¥15 请问一下这个运行结果是怎么来的
  • ¥15 单通道放大电路的工作原理