Enabling Additional PHP Modules

In certain cases, such as packages or customized Captive Portal code, additional PHP extensions may be required that are not enabled.

There are a handful of PHP extensions available in the package repository which are not included in the base distribution of pfSense® software.

The extensions included and activated vary by pfSense software version, look in /usr/local/lib/php/ to see which extensions are present, and check the output of php -m to see what is enabled on a firewall already.

Examples of additional extensions available to install may include:

  • mysqli

  • pdo_mysql

  • pgsql

To activate one of these, install the appropriate version-specific package from the command line, for example:

# pkg search php
<locate the desired package>
# pkg install -y php74-mysqli
# /etc/rc.php-fpm_restart; /etc/rc.restart_webgui
# php -m | grep mysqli
mysqli

A reboot would also fully activate the module, but should not be necessary.