简体   繁体   中英

Big Sur Homebrew PHP install error - missing libphp7.so?

I've recently upgraded to Big Sur (11.6.1) and after running:

php -v

It returns:

WARNING: PHP is not recommended
PHP is included in macOS for compatibility with legacy software.
Future versions of macOS will not include PHP.

So I decided to install PHP 7.3 via Homebrew. Via these instructions: https://gist.github.com/karlhillx/791babda83495eab6fbf64f8a3270f86

Everything was working fine untill I run:

sudo apachectl configtest

Which returns:

Syntax error on line 182 of /usr/local/etc/httpd/httpd.conf: Can't locate API module structure `php_module' in file /usr/local/Cellar/php@7.3/7.3.33/lib/httpd/modules/libphp7.so: dlsym(0x7f9547f05530, php_module): symbol not found

Which is in my httpconf file:

LoadModule php_module /usr/local/Cellar/php@7.3/7.3.33/lib/httpd/modules/libphp7.so

If I run:

find /usr -name "libphp7.so"

It returns:

/usr/libexec/apache2/libphp7.so
find: /usr/sbin/authserver: Permission denied
find: /usr/local/mysql-8.0.21-macos10.15-x86_64/keyring: Permission denied
find: /usr/local/mysql-8.0.21-macos10.15-x86_64/data: Permission denied
/usr/local/Cellar/php@7.2/7.2.34_4.reinstall/lib/httpd/modules/libphp7.so
/usr/local/Cellar/php@7.3/7.3.33/lib/httpd/modules/libphp7.so
/usr/local/php5-7.2.21-20190811-210031/libphp7.so

So the module is there but why can't it see it? Help.....

I found the solution:

I removed the install then reinstalled

brew list | grep php

then

brew uninstall --force {the php version returned from above}

then

brew install php@7.3

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