#1 Basics – Understanding php.ini And Changing PHP Settings
The php.ini file is a special file for PHP which will let you declare changes to your PHP settings. It can be used as the default settings for the server, with letting you change specific settings by editing the existing php.ini or to let you create a new text file and/or name it php.ini.
#2 What Are The Default Settings?
By default, the server comes configured with PHP standard settings while if in case, you think and feel like requiring something more, there will be no need of changing or modifying a php.ini file. Also, if as per with default settings, if php.ini is not there in your server, then still you need not to worry about it as then your site will use the default PHP settings defined on the server.
#3 Best Way To Make Changes?
While there is no doubt that having a copy of the default php.ini file with you is the best. The php.ini file is basically gets located in your cPanel Home Directory (/home/username).
#4 Where Custom php.ini Basically Located?
For the cPanel, the php.ini by default is located at /home/username/php.ini while for Plesk for VPS, it can be found at /var/www/vhost/$DOMAIN/etc/php.ini. In either case, make sure you do replace “username” with your actual cPanel user name and “$DOMAIN” with your actual domain.
#5 How To Make Changes?
There are two ways by which you can accomplish this.
Method 1: Through the “php.ini QuickConfig”
You can make the changes to php.ini through the “php.ini QuickConfig” utility in the “Software/Services” section in your cPanel.
- Login to cPanel.
- Once you are in your cPanel, click on php.ini QuickConfig in the “Software/Services” section.
- If QuickConfig not enabled, then enable it.
- Change the settings that you want to change and save it.
Note: Whatever you change here through the above steps mentioned may possibly overwrite the current PHP settings on your account.
Method 2: Alternate Method
Since you got the complete freedom at your end onto to place your php.ini file in your home directory, you can also make changes yourself by following the simple steps below:
- To start with, add the codes to your primary .htaccess (/home/username/public_html/.htaccess).
- Make sure you replace “username” with your actual cPanel username.
deny from all