简体   繁体   中英

localhost not connecting to server after upgrade to php7

PHP 5.6 was working fine in my Mac Sierra I tried to upgrade to 7.0 than it stopped working. when I try to run localhost safari it shows not connected to server error.

Go to folder: /usr/local/opt/ Delete php70 folder.

Then run: brew install php70 or brew install php70 --with-httpd24

Then try to run the localhost again.

Or you may try to update php 5 to php 7 again on Sierra.These are the steps-Usually, with a fresh version of macOS Sierra, you get a PHP 5.6 installed.

You've got two options: brew or curl install

Brew

brew update && brew upgrade
brew tap homebrew/dupes
brew tap homebrew/versions
brew tap homebrew/homebrew-php
brew unlink php56 
brew install php70

You might get an error if PHP 5.6 has not been installed by brew previously, but don't worry, you can simply continue CURL

curl -s http://php-osx.liip.ch/install.sh | bash -s 7.0

You can replace 7.0 by 7.1 in the command above to get version 7.1 of PHP.

Reference - Medium

I found it just had to comment LoadModule php5_module libexec/apache2/libphp5.so line in http.conf and It started working. since it wad trying to find both version and not working.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM