Modifying a php.ini file
IMPORTANT - Many PHP variables can now be configured in your cPanel control panel on the 'Select PHP Version' page, without the need to create a php.ini file. Please contact our support team if you still require a php.ini file.
The php.ini file contains the PHP configuration variables. These variables determine the different PHP limits/settings placed on your hosting account.
You can modify the php.ini file on your hosting account if you want to change PHP variables. This is sometimes required if your website software requires custom PHP variables.
The custom php.ini file is normally located in the "public_html" directory on your hosting account. If there is no custom php.ini file in that directory, then your website will use the default php.ini file for the server. Ã?Â If you want to create a custom php.ini file, please contact our support team and ask them to create a copy of the server's php.ini file in your public_html directory. You can then modify it as you require.
To protect the php.ini file, you can add these lines to your .htaccess file:
- <Files .php.ini>
- order allow,deny
- deny from all
This way, it can not be displayed when somebody types in the file path into their browser.
Also, in the .htaccess file, you will need to add the following line:
- suPHP_ConfigPath /home/username/public_html
Replace username with your actual cPanel user name. This will tell your account where your php.ini file exists.
Please note: Adjusting the memory limit on the shared hosting plans is not recommended. Since you are on a shared hosting platform, your memory limits are pre-determined by the server you are hosting on, and trying to use more memory than you have assigned to you will cause you issues in the future.