PHP upgrade issues

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

a) It takes about 7 seconds to start PHP process, even php -v

for printing PHP version. edit: Solved.

b) Apache no longer serves my pages. Chrome just shows a generic error page with the "ERR_CONNECTION_REFUSED" parameter. I have restarted the apache service but dont 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: 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?

+3


source to share


2 answers


https://php-osx.liip.ch is a pretty good site, I've used it before to update installations php

. I found that at times this would be unreliable and sometimes brick my setup. Edit . The scripts used on this site usually compile PHP at startup and this can lead to some interesting quirks and inconsistencies. So I switched to using brew

.

Brew is a handy Mac tool that is very similar to apt-get

or yum

. I would recommend that you try this, it adds the libraries in such a way that you can clean them from your machine and revert 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 it still doesn't work. Although I'm 99% sure that your problems will be solved.

In the future, updating your php version is as easy as above, where php71

is your new version (example php72

for 7.2

). Removing the old version is easy, although not harmful, and allows you to quickly switch versions with a single command line option.

+1


source


Now he has decided.

The problem with Apache was that an additional config file was created in /etc/apache2/other/+php-osx.conf

which loaded the php7.1 module, but the loading of the php5 module /etc/apache2/httpd.conf

was not disabled.



Loading both the obviously crashed apache and commenting out LoadModule

in httpd.conf

solved it. I have no idea why the installation procedure didn't do this.

Thanks for helping me.

+2


source







All Articles