This is a plugin for the Hestia Control Panel that provides a simple, powerful graphical interface for managing domain-specific PHP settings. It is built upon the hestiacp-pluginable
framework.
Manually editing .user.ini
files via SSH or the File Manager is tedious and error-prone. This plugin solves that problem by allowing users to view and modify common PHP directives for any of their web domains directly from the Hestia UI.
- User-Friendly Interface: A clean, integrated page with a dropdown to select a domain and a form to edit its PHP settings.
- Intelligent Default Loading: If a domain doesn't have a custom
.user.ini
file, the plugin intelligently detects the domain's active PHP version and pre-fills the form with the actual server-wide defaults from the correctphp.ini
file. - Domain-Specific Configuration: Each domain's settings are managed independently in its own
.user.ini
file, located in thepublic_html
directory. - Seamless Integration: Adds a convenient "PHP Settings" button directly to the "Web" tab for easy access.
- Safe & Secure: The plugin ensures that when settings are saved, the resulting
.user.ini
file is created with the correct user ownership, allowing the PHP-FPM process to read it without permission issues.
- A user navigates to the "PHP Settings" page and selects a domain from the dropdown.
- The plugin's backend logic is triggered. It first checks for an existing
.user.ini
file in the domain'spublic_html
directory. - If
.user.ini
exists, its values are parsed and used to populate the form. - If
.user.ini
does not exist, the plugin checks the domain's configuration to find its active PHP version (e.g.,PHP-8.3
). It then reads the main server configuration file (e.g.,/etc/php/8.3/fpm/php.ini
) to get the current server defaults and populates the form with those values. - When the user saves the form, the plugin writes the settings to the domain's
.user.ini
file, creating it if necessary, and sets the correctuser:user
ownership.
- Hestia Control Panel v1.9.X or greater.
- hestiacp-pluginable must be installed first.
- Ubuntu or Debian Linux OS.
root
orsudo
access to the server.
- SSH into your HestiaCP server.
- Navigate to the Hestia plugins directory:
cd /usr/local/hestia/plugins
- Clone this repository:
sudo git clone https://github.com/iniznet/hcpp-phpconfig.git phpconfig
- Set Permissions: Ensure the install/uninstall scripts are executable.
sudo chmod +x phpconfig/install phpconfig/uninstall
- The plugin will be active immediately. Log in to HestiaCP to see the new button and page.
- Log in to the Hestia Control Panel as any user.
- Navigate to the WEB tab.
- Click the new "PHP Settings" button.
- On the settings page, select the domain you wish to configure from the dropdown menu.
- The form will load with the current settings for that domain (either from its
.user.ini
or the server defaults). - Modify the values as needed and click "Save Settings".
This plugin does not install any system-wide packages or create persistent services. Uninstallation is as simple as removing the plugin directory.
- SSH into your server.
- Remove the plugin directory:
sudo rm -rf /usr/local/hestia/plugins/phpconfig
The plugin will be removed instantly.