# Can not run php file in freebsd



## Rumit Kode (May 15, 2017)

I already Install apache24 and php on freebsd, but when I try to run in web browser an error occurs. Such as I run http://10.254.254.52/testing/index.php should be reading php script but what is done is to download the file "index.php"



 
How to fix this?


----------



## SirDice (May 15, 2017)

```
# pkg info -D mod_php56
mod_php56-5.6.30:
Always:
***************************************************************

Make sure index.php is part of your DirectoryIndex.

You should add the following to your Apache configuration file:

<FilesMatch "\.php$">
    SetHandler application/x-httpd-php
</FilesMatch>
<FilesMatch "\.phps$">
    SetHandler application/x-httpd-php-source
</FilesMatch>

***************************************************************
```


----------

