# Nagios install stopped at PHP test



## jbruyet (Feb 11, 2013)

Hey all, I'm going to move my Nagios server over from a Debian server to a FreeBSD 9.0 server. I'm following the instructions on this page:


```
http://www.unixmen.com/how-to-install-and-configure-nagios-in-freebsd/
```

and I've made it down to here:


```
[B]11-Check  phpinfo page[/B]

Document root  starndart in apache  is    /usr/local/www/apache22/data
Add the code to the file test.hpecho â€œ<? phpinfo(); ?>â€ >> /usr/local/www/apache22/data/test.php
```

I can't seem to get a successful test. There are a couple of typos on the page but I've done several attempts with what I think are logical "typo changes" but no joy. I've even put the 


```
<? phpinfo(); ?>
```

in the file manually but when I navigate to it I just get a page with that text on it. I'm not an Apache or a PHP guy so I'm pretty much flying blind here. Can anyone see what I'm doing wrong so I can correct it and get on with my Nagios install? 

Thanks,

Joe b


----------



## SirDice (Feb 12, 2013)

You need to add these to httpd.conf for PHP to work:

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

You also need to build PHP from ports, the package doesn't contain the needed apache module.


----------



## gqgunhed (Feb 12, 2013)

Please have a look at http://www.freebsdmadeeasy.com/tutorials/web-server/install-php-5-for-web-hosting.php.


> When you run make config you will be shown a list of options. To use PHP with Apache *make sure the Apache Module box* is selected.


This should help you to get your Apache with PHP5 up and running.

Try to get comfortable with installing software from ports e.g. with ports-mgmt/portmaster.


----------

