If you’re running a website built with PHP, you might encounter situations where you need to increase certain PHP values to improve performance or accommodate larger files. Some common PHP values that you might need to increase include memory_limit
, post_max_size
, upload_max_filesize
, and max_execution_time
. In this article, we’ll show you how to increase these values from cPanel.
What is cPanel?
cPanel is a popular web hosting control panel that allows you to manage various aspects of your website and hosting account. With cPanel, you can create email accounts, manage files, install applications, and perform many other tasks related to website management.
How to increase PHP values from MultiPHP INI Editor
To increase PHP values from cPanel, follow these steps:
Step 1: Log in to your cPanel account
To get started, log in to your cPanel account. You can usually access your cPanel account by typing your domain name followed by /cpanel
in your web browser’s address bar. For example, if your domain name is example.com
, you can access your cPanel account by visiting example.com/cpanel
.
Step 2: Navigate to the “MultiPHP INI Editor” option
Once you’re logged in to your cPanel account, navigate to the “MultiPHP INI Editor” option. This option can usually be found under the “Software” section of cPanel.
Once you’re on the “MultiPHP INI Editor” page, you will see a list of all the domains associated with your cPanel account. To select the domain you want to modify PHP values for, simply locate the domain in the list.
After you choose the domain it will display various PHP settings that you can modify, such as memory_limit, post_max_size, upload_max_filesize, and max_execution_time.
Step 3: Save the changes
After making the desired changes, click on the “Apply” button to save the changes to the php.ini
file.
How to increase PHP values from php.ini
file
If you want to change PHP values directly from the php.ini
file, you can do so by following these steps:
Step 1: Locate the php.ini
file
The php.ini file is a configuration file used by PHP to define various settings. The location of the php.ini file may vary depending on your server configuration. In most cases, the php.ini file is located in the WordPress directory (/home/Your-cPanel-user/public_html/domain-name.com/).
Step 2: Open the php.ini
file
Using the File Manager you can edit the php.ini
file, you can right-click on the file and use Edit.
Inside the php.ini
file, you will find various PHP settings, such as memory_limit
, post_max_size
, upload_max_filesize
, and max_execution_time
. You can modify these settings by changing the corresponding values.
For example, to increase the memory_limit
value, you can find the line that reads memory_limit = 128M
and change the value to a higher number, such as memory_limit = 256M
. Similarly, to increase the post_max_size
and upload_max_filesize
values, you can find the corresponding lines and change the values to a higher number. Finally, to increase the max_execution_time
value, you can find the line that reads max_execution_time = 30
and change the value to a higher number, such as max_execution_time = 60
.
Step 3: Save the changes
After making the desired changes, save the php.ini
you need to save the changes from the top right button “Save”.
Final thoughts
In summary, changing PHP values such as memory_limit
, post_max_size
, upload_max_filesize
, and max_execution_time
can be crucial for the performance and stability of your website. Depending on your server configuration and access level, you can modify these values either through the cPanel interface or directly from the php.ini
file.
If you’re using cPanel, the “MultiPHP INI Editor” feature provides an easy-to-use interface for modifying PHP values for specific domains. This method is recommended for users who are not familiar with server administration or prefer a graphical interface.
On the other hand, if you have access to the php.ini
file, you can modify PHP values directly. This method provides more flexibility and control over the PHP configuration of your website, but it requires more technical knowledge and may not be suitable for beginners.
Regardless of the method you choose, it’s important to make informed decisions when modifying PHP values. Modifying certain values, such as memory_limit
or max_execution_time
, can have a significant impact on your website’s performance and stability. It’s recommended that you consult with a qualified developer or your web host before making any changes and always make a backup of your website and its files before making any modifications.