Configuring custom PHP services from cPanel. Configuring PHP services in cPanel is a simple and flexible process that gives you complete control over the behavior of web applications.
By choosing the right version and adjusting important variables, you can ensure compatibility, performance and stability for your website.
Configuring custom PHP services?
What does custom PHP configuration mean?
cPanel offers users the ability to adjust PHP versions and associated settings according to the needs of web applications.
By configuring PHP services, you can modify parameters such as memory limits, execution duration, uploaded file sizes and other options that influence the behavior of web applications written in PHP.
Accessing the PHP version manager
To start PHP configuration, follow the steps below:
- Log into cPanel using your account credentials.
- In the Software section, access the Select PHP Version or MultiPHP Manager option (the name may vary depending on server configuration).
Changing the PHP version for a domain
In “MultiPHP Manager” you can select the PHP version for each hosted domain:
- Select the domain from the list.
- Choose the desired PHP version from the dropdown menu.
- Press the Apply button to save the change.
Configuring PHP variables (php.ini)
After choosing the PHP version, you can configure custom variables:
- Return to “Select PHP Version”.
- Press Options next to the current version.
- Here you can modify settings such as:
memory_limit– maximum memory limit (ex: 256M)upload_max_filesize– maximum size of uploaded filespost_max_size– maximum limit for POST datamax_execution_time– maximum execution time for scriptsdisplay_errors– error display (enable/disable)
- Changes are saved automatically in most modern cPanel panels.
Using the .user.ini file for advanced settings
If you want to apply PHP settings only in a specific directory, create a file named .user.ini in that directory and add the necessary lines. Example:
memory_limit = 256M upload_max_filesize = 50M post_max_size = 100M
Checking active PHP settings
To confirm the active values of PHP variables, create a file named info.php with the following content:
<?php phpinfo(); ?>
Then access the file in your browser (ex: https://your-domain.com/info.php) to see all information about the current PHP configuration.
Recommendations for performance and security
- Don’t set excessive values for
memory_limitormax_execution_time, to avoid unnecessary resource consumption. - Avoid enabling the
display_errorsoption in production environments. - Keep PHP updated to benefit from security patches and performance improvements.

Comments (0)