Updated: 28 September 2026 · Applies to: FreeBSD 14

FAMP is FreeBSD, Apache, MySQL and PHP. This guide uses FreeBSD 14 (FreeBSD 12 is no longer supported).

Install

pkg update
pkg install apache24 mysql84-server php83 mod_php83 php83-mysqli php83-mbstring php83-xml
sysrc apache24_enable=yes mysql_enable=yes
service apache24 start && service mysql-server start
mysql_secure_installation

Connect PHP to Apache

Create /usr/local/etc/apache24/modules.d/001_mod-php.conf:

<IfModule dir_module>
    DirectoryIndex index.php index.html
    <FilesMatch "\.php$">
        SetHandler application/x-httpd-php
    </FilesMatch>
</IfModule>

Copy /usr/local/etc/php.ini-production to php.ini, then service apache24 restart. The web root is /usr/local/www/apache24/data.

Note: Package names include version numbers (for example php83, mysql84-server); check available versions with pkg search php.

Related services

KVM VPS hosting

NVMe SSD and full root access, with Free Basic Managed Support.

Unmanaged dedicated servers

full root access and free IPMI KVM, with Free Basic Managed Support.

Managed dedicated servers

our engineers look after the server for you, from $135 a month.

Was this answer helpful?

Still stuck? Open a ticket