# Undefined symbol php_module in libphp7.so



## MMacD (Feb 17, 2018)

Having `freebsd-upgrade`d to 11.1R (amd64),  and `port-static upgrade -f`'d, I've found that I can't bring up lang/php72 in www/apache24.  I get this:

```
14:03 Sat, 17 Feb                                                                                                      
[fastcat:root]/usr/local> service apache24 start
Performing sanity check on apache24 configuration:
httpd: Syntax error on line 185 of /usr/local/etc/apache24/httpd.conf: Can't locate API module structure `php_module' in file /usr/local/libexec/apache24/libphp7.so: Undefined symbol "php_module"
Starting apache24.
httpd: Syntax error on line 185 of /usr/local/etc/apache24/httpd.conf: Can't locate API module structure `php_module' in file /usr/local/libexec/apache24/libphp7.so: Undefined symbol "php_module"
/usr/local/etc/rc.d/apache24: WARNING: failed to start apache24
14:05 Sat, 17 Feb
[fastcat:root]/usr/local>
```
I've tried rebuilding from ports, installing packages, and mix-and-match.  Nothing works.

The only thing that comes close to working is when I copy the libphp7.so over from my server-of-all-work, which is still running 10.2R, apache24, and php70.  Then it complains about not finding an .so that's a dependent of libphp7.so (elf, I think, but it was a couple of days ago so I don't clearly remember)

Two people in the ports newsgroup who are successfully running the same config as I'm trying to bring up have kindly supplied the `md5` hash for their libphp7.so.  Neither of them matches any that I get (nor do they match one another, which is weird).

I'm used to libraries that stay stable through minor releases unless changes are called out in the release notes, which this hasn't been.  So I'm baffled.   All constructive ideas gladly tried.


----------



## SirDice (Feb 18, 2018)

Make sure www/mod_php72 was correctly updated, it seems to disappear sometimes if you're not careful.


----------



## MMacD (Feb 24, 2018)

SirDice said:


> Make sure www/mod_php72 was correctly updated, it seems to disappear sometimes if you're not careful.



I installed the pkg as part of reinstalling everything from scratch, but am still getting the same error.  I've never had this happen before, and don't even know where to begin to look.  I grepped for mod_php72.so, but it found nothing, so it's not clear where the pkg went.  There's an empty subtree /var/db/www_mod_php72/, but that doesn't seem helpful. 

I'd rather not throw up my hands and rebuild from ports because, as too often, the maintainer decided it would be a good idea to force the rebuild of the whole world (well, okay, only apache24 and its many dependents) along with that small library.  But if that library is there somewhere, it's not showing up in any form I can recognise.

Any thoughts?


----------



## SirDice (Feb 25, 2018)

MMacD said:


> I grepped for mod_php72.so, but it found nothing


It's not named that way. You can always check what a package contains by looking at `pkg info -l mod_php72` for example. It should be /usr/local/libexec/apache24/libphp7.so, which is also the file Apache is complaining about. It's typically loaded from httpd.conf:

```
LoadModule php7_module        libexec/apache24/libphp7.so
```

Next check with ldd(1): `ldd /usr/local/libexec/apache24/libphp7.so`. Make sure all the dependencies are resolved and there's nothing missing.


----------

