# Problems with lang/php5



## ikbendeman (Sep 2, 2014)

I have tried to install and use ports lang/php5 and lang/php55 with www/apache24 AND www/apache22. However, I was able to install www/apache24 and get it working with lang/php53. Unlike the other php ports, it added a line in httpd.conf for the module, and it installed the module into (ServerRoot is /usr/local as default) /usr/local/libexec/apache24/libphp5.so and it also oddly installed a /usr/local/libexec/apache24/mod_php5.so which is not added to httpd.conf, and according to the size of the files they're not the same, in fact the mod_php5.so is larger. What's this file for?

But my main question is, why, when I install lang/php5 or lang/php55 does it install the file /usr/local/lib/libphp5.so into that location and upon trying to start apache, this is what happens:

```
nicholas@fbsd:/usr/local/etc/apache24 % service apache24 onestart
Performing sanity check on apache24 configuration:
httpd: Syntax error on line 155 of /usr/local/etc/apache24/httpd.conf: Cannot load lib/libphp5.so into server: Cannot open "/usr/local/lib/libphp5.so"
Starting apache24.
httpd: Syntax error on line 155 of /usr/local/etc/apache24/httpd.conf: Cannot load lib/libphp5.so into server: Cannot open "/usr/local/lib/libphp5.so"
/usr/local/etc/rc.d/apache24: WARNING: failed to start apache24
```
Also, note, I have tried both php5 (php5.4) and php55 with both www/apache24 AND www/apache22 (and yes, when I have tried apache2.2 I have added 
	
	



```
DEFAULT_VERSIONS+=python=2.7 python2=2.7 python3=3.3 gcc=4.8 apache=2.4
```
 to my make.conf as I know the default is now apache24.

I have tried copying and symlinking /usr/local/lib/libphp5.so to its respective /usr/local/libexec/apache2?/ folder, no such luck. At times, (though unfortunately I don't have unlimited scrolling and I have a working apache24/php53 right now so I don't want to go back and find out until I know I can get the other versions working) it would be a more detailed error message upon trying to start apache, something like "Symbol missing" or "unable to load symbol mod_php5 from */libphp5.so". Has anybody else had these problems with php recently?


----------



## talsamon (Sep 2, 2014)

Do you know this ?

```
20140327:
  AFFECTS: users of lang/php5 and lang/php55 with Apache module
  AUTHOR: ale@FreeBSD.org

  The Apache PHP module has been separated from the main PHP port.
  If you had the APACHE OPTION selected, you have to perform the
  following steps:

  1) update your lang/php* options (i.e. 'make config')
  2) rebuild lang/php* port
  3) install www/mod_php* port

  It is *mandatory* to build both ports with the same DEBUG and ZTS
  options, so if you have a threaded Apache (i.e. worker or event MPM)
  you have to select the ZTS option in lang/php* port.
```


----------



## ikbendeman (Sep 2, 2014)

Thank you. I use `psearch` to find ports and I used `psearch php5`.


----------

