After upgrading to MacOS High Sierra, I haven't been able to access my localhost. I tried restarting Apache, but it still didn't work. So I did apachectl configtest
and got this error message:
httpd: Syntax error on line 544 of /private/etc/apache2/httpd.conf: Syntax error on line 8 of /private/etc/apache2/other/+php-osx.conf: Cannot load /usr/local/php5/libphp5.so into server: dlopen(/usr/local/php5/libphp5.so, 10): Symbol not found: _environ\n Referenced from: /usr/local/php5/libphp5.so\n Expected in: /usr/sbin/httpd\n
Line 544 of my httpd.conf file is
Include /private/etc/apache2/other/*.conf
The +php-osx.conf is an alias to entropy-php.conf, and line 8 of that file is
LoadModule php5_module /usr/local/php5/libphp5.so
The remaining lines of entropy-php.conf are: LoadModule php5_module /usr/local/php5/libphp5.so
<IfModule mod_php5.c>
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
<IfModule mod_dir.c>
DirectoryIndex index.html index.php
</IfModule>
</IfModule>
I am using Apache/2.4.28 (Unix) and PHP 5.6.30.
Everything was working fine until the update. I have searched online for any solution this issue, but to no avail. Someone posted a similar question here a couple of years ago regarding the same syntax error, however, he didn't provide enough details or any follow-up regarding his setup, and no solution could be offered: Mac apache not working - apachectl configtest errors
brew install php71
, but what else would I need to do?LoadModule php5_module
in +php-osx.conf.php -v
though it shows I have PHP 5.6.32. Why didn't the update change that to 7.1?