# Apache22 and php5 wont start



## robbtek (Mar 19, 2010)

Hello ,

I've installed on my FreeBSD8 machine a web server apache22 , php5 and php5-extensions.

I'm using ports and I build a apache module .

Installation finish without any error and file "/usr/local/libexec/apache22/libphp5.so" exist .

I edit apache conf file "/usr/local/etc/apache22/httpd.conf" adding this line :


```
LoadModule php5_module        libexec/apache22/libphp5.so

AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
```

Starting apache (/usr/local/etc/rc.d/apache22 start) without error ...


```
freebsd# httpd -M
...
 php5_module (shared)
...
```


```
freebsd# ps aux | grep http
www        52237  0.0  0.4 13408  9004  ??  I    10:29AM   0:00.00 /usr/local/sbin/httpd
```

If I try to connect to my localhost web server it dont works .
I verify with netstat and there'nt port 80 listen .

now ... I try to disable php5 module and restart apache


```
#LoadModule php5_module        libexec/apache22/libphp5.so
```

and now web server works fine ...


```
It works!
```

My freebsd 8 machine is full ports updated , I using internet guid to install apache22 + php5 but I dont find any solution for this problem .

Any help ?


----------



## SirDice (Mar 19, 2010)

Read /var/log/httpd-error.log.


----------



## robbtek (Mar 19, 2010)

with php5 module loaded I've this log when I started apache 


```
[Fri Mar 19 10:52:51 2010] [warn] Init: Session Cache is not configured [hint: SSLSessionCache]
[Fri Mar 19 10:52:51 2010] [notice] suEXEC mechanism enabled (wrapper: /usr/local/sbin/suexec)
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20060613/pdf.so' - Cannot open "/usr/local/lib/php/20060613/pdf.so" in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20060613/yaz.so' - Cannot open "/usr/local/lib/php/20060613/yaz.so" in Unknown on line 0
net155-245#
```


----------



## robbtek (Mar 19, 2010)

I've removed yaz e pdf module from /usr/local/etc/php/extensions.ini ...

now my error log is 


```
[Fri Mar 19 11:08:22 2010] [warn] Init: Session Cache is not configured [hint: SSLSessionCache]
[Fri Mar 19 11:08:22 2010] [notice] suEXEC mechanism enabled (wrapper: /usr/local/sbin/suexec)
```

but apache web server dont start and dont listen


----------



## robbtek (Mar 19, 2010)

other test ... from command line

test.php


```
<?php

  print "ok";

?>
```


```
freebsd# php test.php
Segmentation fault
```


I dont know how to solve it


----------



## robbtek (Mar 19, 2010)

I've solved this problem by comment out this line from my /usr/local/etc/php/extensions.ini


```
#extension=pdf.so
#extension=yaz.so
#extension=pgsql.so
#extension=recode.so
#extension=pdo.so
#extension=mysqli.so
#extension=pdo_sqlite.so
```

Because cause a semantation fault .

Restarting apache or testing php from command line it works fine .

Thanks


----------

