# php not working



## hirohitosan (May 22, 2011)

Hi there

I wanted to install Joomla and I installed php and many other packages related to php and now my php does't work.

I add

```
<?php
phpinfo( );
?>
```
 in 
/usr/local/www/apache22/data and it gives me nothing. I added also 
	
	



```
LoadModule php5_module libexec/apache22/libphp5.so
LoadModule suphp_module libexec/apache22/mod_suphp.so
```
in httpd.conf
How can I start php?

many thanks!


----------



## gkontos (May 22, 2011)

```
<IfModule dir_module>
    DirectoryIndex index.html [B]index.php[/B] index.htm
</IfModule>
```


----------



## SirDice (May 23, 2011)

You have to build php from ports. The package doesn't contain the apache module needed.


----------



## hirohitosan (May 24, 2011)

@ gkontos: I already added that in /usr/local/etc/apache22/httpd.conf
@ SirDice: php was built with apache module. I checked this:
	
	



```
grep APACHE /var/db/ports/php5/options
WITH_APACHE=true
```


----------



## AndyUKG (May 24, 2011)

Hi,

  could be the allow/deny settings in httpd.conf for the DocumentRoot. Check if its set to deny all, which I think is the default. I.e. you need something like:


```
Order allow,deny
Allow from all
```

thanks Andy.


----------



## hirohitosan (May 24, 2011)

My settings in httpd.conf are:

```
<Directory "/usr/local/www/apache22/data">
    Options Indexes FollowSymLinks
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>
```
I want to reinstall php but I don't know how to do this. Using [CMD=""]pkg_delete[/CMD]or with uninstall port and then install again.
Which are the differences?
thanx


----------



## AndyUKG (May 24, 2011)

The commands


```
pkg_delete -f package
```

and 


```
cd /usr/ports/package
make uninstall
```

are the same, well in fact the later runs the former.

If you reinstall php and the version has changed then you should probably reinstall all php extensions too... You could consider using portupgrade or portmaster to do upgrades as these can automatically upgrade dependant packages.

Andy.


----------

