apache2modphp

June 22, 2026 ยท View on GitHub

Back to resource list

Enables apache2 module mod_php.

This resource will install and enable the Apache PHP module. See apache_mod_php_package for the platform-specific module package. If installing PHP outside of this resource (i.e. with the php cookbook), you should set install_package to false to avoid a possible version conflict.

The default Apache MPM is event. If your platform still supports Apache mod_php, set mpm 'prefork' on apache2_install before enabling this resource.

Note: call this resource directly, not through apache2_module! This resource will call _module with the correct identifiers for you.

Properties

NameTypeDefaultDescription
module_nameStringapache_mod_php_modulenameThe name of the php module.
so_filenameStringapache_mod_php_filenameThe filename of the module object.
package_nameStringapache_mod_php_packageThe package that contains the PHP module itself, which is sometimes not included with the default PHP packages.
install_packageBooltrueWhether to install the PHP module package.