Building the Apache Web Server, PHP, MariaDB (FAMP) on FreeBSD – In this tutorial I will explain how to install Apache, MySQL, PHP or commonly called FAMP in FreeBSD, I assume you already update the portcollection at FreeBSD. Before you install the FAMP in FreeBSD you must configure a DNS Server to translate ip, how to install the DNS Server can be seen in the tutorial how to Install and configure the DNS Server on FreeBSD.

First install the first package in need:
pkg install apache24 mod_php56 php56-xmlrpc php56-sockets php56-openssl php56-pdo php56-mysqli php56-curl php56-bz2 php56-zlib php56-sockets php56-ftp php56-gd php56-ftp php56-gd php56-imap php56-iconv php56-hash php56-gmp php56-exif php56-fileinfo
- After that turn on service apache24 in/etc/rc.conf.
- Then enable hostname in/etc/hosts.
- After that start the apache service start apache24 command.
- Then copy php.ini-production to/usr/local/etc/URphp.ini from/usr/local/etc.
- After that install the mariadb server with the command pkg install mariadb55-server mariadb55-client, because previously I’ve never installed a mariadb via port so like this, if it hadn’t just ignore this ss just hit yes.
- Then copy URmy-small.cnf to/usr/local/etc/my.cnf from/usr/local/share/mysql/my-small.cnf.
- After that activate service mariadb at/etc/rc.conf.
- Then start mariadb server.
- Next, edit the httpd.conf file that is in the/usr/local/etc/apache24/httpd.conf add the parameter URindex.php after URindex.html and AddType application/x-httpd-php .php AddType application/, x-httpd-php-source. phps and also the servername.
- Don’t forget in the save, after that we restart the apache service.
- And create a php info at/usr/local/www/apache24/data/info.php to find out if the apache and php connection in sync and run well.
- Completed