Error in httpd.conf. Can't locate API module structure `php5_module'
I've recently installed phc, the php compiler. I started out installing LAMP from source with --enable-so for Apache and --enable-embed for PHP5 (among other options these are most relevant to the installation and later configuration).
When I finished installing I realized phc does not yet support PHP5.3 so I uninstalled it and installed PHP5.2. phc works fine now, as does the PHP client application for the commandline. Apache seems to be running fine, too, when I comment out line 193 (see below). It just doesn't parse PHP.
httpd: Syntax error on line 193 of /etc/apache2/conf/httpd.conf: Can't locate API module structure `php5_module' in file /usr/local/lib/libphp5.so: /usr/local/lib/libphp5.so: undefined symbol: php5_module
When I check my version of PHP from the terminal I get the expected output (5.2):
[root@localhost conf]# php -v
PHP 5.2.14 (cli) (built: Sep 7 2010 22:50:25)
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2010 Zend Technologies
I made sure to move the libphp5.so file from the folder where I built 开发者_运维技巧php5.2 (/usr/local/src/php-5.2.14) to /usr/local/lib. I also moved php.ini to /usr/local/lib.
Is there something I'm missing here?
OK!
Apparently when you configure PHP it's important to include the line specifying wehre to find apxs for the proper installation:
--with-apxs2=/etc/apache2/bin/apxs
I did this and the problem vanished :)
精彩评论