July 8, 2021 . 3 MIN READ
Our PHP version naming depending on the name shown below
|
# PHP Name
|
|
|
php[VERSION]rc
|
|
|
# PHP FPM name
|
|
|
php[VERSION]rc-fpm
|
The VERSION are 55, 56, 70, 71, 72 and so on depending on php version 5.5, 5.6, 7.0, 7.1 and 7.2 respectively.
If you would like to start, stop, reload or restart php7.0, you may use:
|
# Start
|
|
|
systemctl start php70rc-fpm
|
|
|
# Stop
|
|
|
systemctl stop php70rc-fpm
|
|
|
# Reload
|
|
|
systemctl reload php70rc-fpm
|
|
|
# Restart
|
|
|
systemctl restart php70rc-fpm
|
|
|
# Automatically start php after server reboot
|
|
|
systemctl enable php70rc-fpm
|
|
|
# Disable php automatic start after reboot
|
|
|
systemctl disable php70rc-fpm
|
Or to start, stop, reload or restart php7.1, you can use:
|
# Start
|
|
|
systemctl start php71rc-fpm
|
|
|
# Stop
|
|
|
systemctl stop php71rc-fpm
|
|
|
# Reload
|
|
|
systemctl reload php71rc-fpm
|
|
|
# Restart
|
|
|
systemctl restart php71rc-fpm
|
|
|
# Automatically start php after server reboot
|
|
|
systemctl enable php71rc-fpm
|
|
|
# Disable php automatic start after reboot
|
|
|
systemctl disable php71rc-fpm
|
Each of your web applications will have their own PHP config. They are located inside /etc/php[VERSION]rc/fpm.d/<web_app_name>.conf
|
# If your web app name is myapp and using php7.0, the config will be located inside
|
|
|
/etc/php70rc/fpm.d/myapp.conf
|
Each PHP is installed inside its own folder with its own setting folder.
|
# Installed location
|
|
|
/RunCloud/Packages/php[VERSION]rc/
|
|
|
# Config location
|
|
|
/etc/php[VERSION]rc/php.ini
|
|
|
# Example
|
|
|
/RunCloud/Packages/php55rc/ # Installed location
|
|
|
/etc/php55rc/php.ini # Config location
|
|
|
/RunCloud/Packages/php56rc/ # Installed location
|
|
|
/etc/php56rc/php.ini # Config location
|
|
|
/RunCloud/Packages/php70rc/ # Installed location
|
|
|
/etc/php70rc/php.ini # Config location
|
|
|
/RunCloud/Packages/php71rc/ # Installed location
|
|
|
/etc/php71rc/php.ini # Config location
|
|
|
/RunCloud/Packages/php72rc/ # Installed location
|
|
|
/etc/php72rc/php.ini # Config location
|
While most of the config can be tweaked from the panel, some of it isn’t supported out of the box. To give you more freedom, we introduced extra PHP-FPM configuration.
You can find your extra PHP-FPM configuration inside /etc/php-extra/<web_application_name>.conf.
What you can do with it is that you can add php.ini tweak here. By default, RunCloud depends on php.ini inside /etc/php<version>rc/php.ini and overwrite it inside /etc/php<version>rc/fpm.d/<web_application_name>.conf. But some of the config isn’t supported to be tweak from the panel and will still be rely on php.ini. By modifying /etc/php<version>rc/fpm.d/<web_application_name>.conf, each of your web applications will get their own exclusive settings. Editing php.ini is a no-no and will affect every web application globally unless you know what you are doing.
Below example will show you how to use extra fpm configuration.
|
; Inside php.ini, there is a setting to enable php short tag.
|
|
|
; Instead of writing <?php you can write <? and php will execute.
|
|
|
; The default value is disabled.
|
|
|
; To turn it on globally, you can just edit php.ini
|
|
|
short_open_tag = On
|
But if you are not going to use this globally, you should add it inside extra php-fpm configuration. For example, my Web Application name is awesomephp. The extra configuration file will be located inside /etc/php-extra/awesomephp.conf. Edit the file by using configuration below and save it.
|
; This will be exclusive to awesomephp Web Application only
|
|
|
php_admin_value[short_open_tag] = On
|
The setting style is clear. You take whatever key you wanted to modified inside php.ini, wrap it with php_admin_value and assign the value you wanted to overwrite.
php_admin_value[key] = value
After you have edited your PHP-FPM extra configuration file, reload your PHP-FPM
|
# systemctl reload php<version>rc-fpm
|
|
|
# If you are using PHP 7.1 for awesomephp Web Application
|
|
|
systemctl reload php71rc-fpm
|
This idea was coming from our customers who are using Wordfence plugin for WordPress. We also have dedicated post for this inside our blog, Wordfence Integration with PHP-FPM inside RunCloud.
https://runcloud.io/docs/guide/cheat-sheet/php