# pkg install php56 mod_php56 php56-extensions


Apache24 is install automatic.

After installation copy this code:

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

And copy it to the end of file: /usr/local/etc/apache24/httpd.conf

Also,uncomment parameter ServerName and change it like this:

ServerName 127.0.0.1:80


In this file in the end of parameter DirectoryIndex add index.php:

DirectoryIndex index.html index.php


Write and quit.

Enable apache24 in rc.conf:

# echo 'apache24_enable="YES"' >> /etc/rc.conf


Start web server apache24:

# service apache24 start


Check our web server, you will see:

It works!