Configure PHP-FPM options
NOTE: We are in the process of modifying the file structure and configuration for many Bitnami stacks. On account of these changes, the file paths stated in this guide may change depending on whether your Bitnami stack uses native Linux system packages (Approach A), or if it is a self-contained installation (Approach B). To identify your Bitnami installation type and what approach to follow, run the command below:
$ test ! -f "installdir/common/bin/openssl" && echo "Approach A: Using system packages." || echo "Approach B: Self-contained installation."
The output of the command indicates which approach (A or B) is used by the installation, and will allow you to identify the paths, configuration and commands to use in this guide. Refer to the FAQ for more information on these changes.
To override any of the PHP configuration options (eg. memory_limit, max_execution_time), you must modify the following files:
- Main PHP configuration file: installdir/php/etc/php.ini
PHP-FPM pool configuration file for your application: Depending on your installation type, you can find it in the following locations:
- Approach A (Bitnami installations using system packages): installdir/php/etc/php-fpm.d/www.conf
- Approach B (Self-contained Bitnami installations): installdir/apps/APPNAME/conf/php-fpm/php-settings.conf
For example, to increase the PHP memory limit:
Edit the main PHP configuration file at installdir/php/etc/php.ini and set the memory_limit variable to a new value, as shown below:
Modify the PHP-FPM pool configuration file and set the corresponding variable as follows. Replace the NEW_LIMIT placeholder with the new memory limit you wish to use.
Restart Apache and PHP-FPM for the changes to take effect:
$ sudo installdir/ctlscript.sh restart apache $ sudo installdir/ctlscript.sh restart php-fpm