Why is my custom php.ini file not working?


There can be a number of reasons why your php.ini file is not working.

File Name Issues

If you create the php.ini from scratch, some programs will add the file type to the end of the file name, turning it into php.ini.txt.  If this has happened, you can rename the file and remove the .txt extension either through the File Manager in your eXtend Control Panel or in your FTP program.

Having More Than One php.ini File

If you have more than one php.ini file, the one in the same directory will take precedence over all other files.  So, for example, if you have a php.ini file in /documents/ and one in /public_html/, the one in /documents/ will affect the code, instead of the one in /public_html/.

The best practice is to use a single php.ini file, placed in your /public_html/ directory, which will then affect all PHP scripts running in your webspace.

If you are using PHP 5.3, you should also check for any .user.ini files, which can also override settings.

Setting PHP Directives In The Code

If there are PHP directives in the code itself, this will override any directives in the php.ini.  For example, if you’ve increased the memory limit in your php.ini file, your scripts will not pay attention to the increase if there is a memory limit in your site’s PHP code.

This is common within certain CMS systems.

Syntactically Correct Directives

Check that your commands are spelled and formed correctly.  You can check your directives on the PHP website: http://www.php.net

If you are still having issues with your custom php.ini file, please raise a Support Ticket with our Customer Services team.  Include details of the settings you are attempting to modify, the expected results of these modifications, and the actual results you are getting.



Article ID: 643
Created On: Thu, Apr 9, 2015 at 10:29 AM
Last Updated On: Thu, Apr 23, 2015 at 12:20 PM

Online URL: https://www.heartinternet.uk/support/article/why-is-my-custom-php-ini-file-not-working.html