# Apache and php 5



## dramcio (Dec 5, 2012)

Hello.

I try to install LMS.

But before I must install apache22 and php5
[cmd=]cd /usr/ports/www/apache22; make install clean[/cmd]
[cmd=]cd /usr/ports/lang/php5; make install clean[/cmd]

And php5-extensions.

In httpd.conf I've add:


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

Restart server and when I want to open my site etc. index.php, my browser wants to download index.php Crazy!

Regards


----------



## Anonymous (Dec 6, 2012)

Check in /usr/local/etc/apache22/httpd.conf whether the following line is commented out, i.e. got a hash sign in front of it.

```
LoadModule php5_module        libexec/apache22/libphp5.so
```
If yes, activate it by removing the #, and restart the server.


----------



## dramcio (Dec 6, 2012)

Hmm if I want to start apache


```
httpd: Syntax error on line 106 of /usr/local/etc/apache22/httpd.conf: Cannot load /usr/local/libexec/apache22/libphp5.so into server: Cannot open "/usr/local/libexec/apache22/libphp5.so"
```


----------



## SirDice (Dec 6, 2012)

I'm guessing you built PHP without the Apache module. It's turned off by default:

```
APACHE=off: Build Apache module
```


----------

