The php.ini file and changing PHP Settings
The php.ini file is a special file for PHP and various flavors such as suPHP (pronounced sue-p-h-p).
The php.ini file is where you declare changes to your PHP settings. You can use the default settings for the server, change specific settings by editing the existing php.ini, or create a new text file and name it php.ini.
The server is already configured with standard settings for PHP that have been selected by our administrators to be the most optimal setting for a majority of our customers. Unless you specifically need to change one or more of the settings, there is no need to create or modify a php.ini file. If the php.ini file does not exist in your account, then your site will use the default PHP settings defined on the server.
Create a php.ini FileThis file should be created in your cPanel Home directory (
/home/username/). For VPS Plesk users the file should already exist in the following directory:
Be sure to replace "username" with your actual cPanel user name, and "$DOMAIN" with your actual domain.
How to create a new php.ini file in cPanel:
- Login to cPanel.
- In the Files section, click on the File Manager icon.
- Select Home Directory and click Go.
- Click the New File button at the top of the page.
- In the field called New File Name, enter php.ini and click Create New File.
- Click the file named php.ini.
- Select the Edit button at the top of the page and click the Edit button in the pop-up box.
Select a button below for the PHP version used on your account. If you are unsure of what PHP version your site is running, you can use the phpinfo function to locate the correct version.
Making Changes Global
Now that you have an accessible php.ini file you can use the code provided within this section to make the file global for your entire account. This is done by using the SuPHP handler, which designates what php.ini file to execute.
The following code should be placed at the top of your .htaccess file inside the public_html folder.
Be sure to replace "username" with your actual cPanel user name.
deny from all
After the above steps have been completed you can review your settings and confirm your configuration path by utilizing the phpinfo function. For more information on how to use this function, please refer to the following article:
Moving to suPHP
Some common changes must be made when moving from non-secure php environment to suPHP. For example, if your site had these settings in the .htaccess file:
php_flag upload_max_filesize 10M
php_value post_max_size 10M
php_value max_execution_time 30
SuExec users must put them in a php.ini file instead. Here is the proper syntax:
upload_max_filesize = 10M
post_max_size = 10M
max_execution_time = 30
- Our Services
- Web Hosting
- Reseller Hosting
- VPS Hosting
- Dedicated Servers
- Domain Names
- Application Hosting
- Windows Hosting
- Help and Support
- Support Portal
- Video Tutorials
- Ticket System
- Billing System
- Live Chat
- Registry Rocket