# Problems with php5



## Melcu (Jan 12, 2010)

Hello all,

I got a small problem with my php ! When i check if is working... something like... localhost/index.php browser start downloading the file. What i did wrong ?


----------



## BeautifulFish (Jan 12, 2010)

hello,

what is your version of apache and php? did you select Apache Module when installing php?
what is the code you are using in index.php
you can try something like:

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

also check that libphp5.so is in:
/usr/local/libexec/apache22/

check you have this enabled in httpd.conf

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

add this at the end of httpd.conf

```
<IfModule mod_php5.c>
        DirectoryIndex index.php index.html
    </IfModule>
    <IfModule mod_php5.c>
        AddType application/x-httpd-php .php
        AddType application/x-httpd-php-source .phps
    </IfModule>
```


----------



## Melcu (Jan 12, 2010)

```
httpd: Syntax error on line 104 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"
```



Now i got this one.


----------



## Melcu (Jan 12, 2010)

Hmmm i don`t remember for sure, but i belive i didn`t check for apache module when i was instaling php. Apache version is 2. Code was the same ... ! Thank you.


----------



## danger@ (Jan 12, 2010)

go to lang/php5 dir and type `# make config`, check the Apache module, `# make deinstall clean && make reinstall`. Also watch for the hints you will get from the pkg-message.


----------



## Melcu (Jan 12, 2010)

And ... where can i find lang/php5 ?


----------



## Melcu (Jan 12, 2010)

Making reinstall now...... hope will not take 3 hours like php5 before... thanks for helping me.


----------



## Melcu (Jan 12, 2010)

And now is working. Thank you both.


----------



## Melcu (Jan 12, 2010)

```
Starting apache22.
[Sat Jan 09 16:25:28 2010] [warn] module php5_module is already loaded, skipping
httpd: Could not reliably determine the server's fully qualified domain name, using ::1 for ServerName
localhost#
```

Now is working like i sayd any ideea why php5_module is already loaded ?


----------



## DutchDaemon (Jan 13, 2010)

This is probably in httpd.conf twice now:


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

Just remove one and restart Apache.

Oh, and:
Posting and Editing in the FreeBSD Forums


----------

