It can be quite a challenge to find your and edit a PHP.INI on GoDaddy because php ini may not be where you think it should be and is not likely named what you think it is named.
1: Determine the PHP.INI Your Site Is Using:
- Create a new text file named info.php then open it with a plain text editor like Notepad
- Copy / Paste this command
<?php phpinfo(); ?>
into your info.php then save it - FTP that info.php to your website (i.e. using FileZilla )
- Open that file with your browser (i.e. surf to www.YourSite.com/info.php
You can see that GoDaddy does NOT use PHP.INI or PHP5.INI as is often reported, but in my case was using PHP56.INI . This makes sense because I am using PHP 5.6… but this certainly was not obvious until I saw it on the PHP info page.
2: How To Edit or Add a PHP.INI File To Your GoDaddy Hosted Site
Once you have the PHP.INI path and file name determined, you have two things to do:
- If the path to your ini is something you can access from FTP software like FileZilla, then just edit it
- To have the new or updated php ini take effect, end all processes which you can do through the GoDaddy administration tool (either in cPanel or in “Hosting Details” under SYSTEM PROCESSES
- If the path to your ini is in something like
/var/charoot/web/conf
your site is using the default PHP INI from GoDaddy and that can not be changed – see the GODADDY DEFAULT PHP.INI section at the bottom of this article. - This means you need to create a text file with the exact same name (in my case php56.ini )
- Make whatever changes you want
- FTP it to the root of your site
- To have the new or updated php ini take effect, end all processes which you can do through the GoDaddy administration tool (either in cPanel or in “Hosting Details” under SYSTEM PROCESSES
- Open the INFO.PHP file with your browser (i.e. surf to www.YourSite.com/info.php) again and see if it now points to your new php ini file
WARNING: After you are done, make sure you delete the info.php file from your site because it will provide hackers with lots of very dangerous information about your site.
GODADDY DEFAULT PHP.INI
After you have determined the path, you will have to use Putty or some other SSH tool to connect to your site, because GoDaddy hides its PHP.ini below the level you can reach with an FTP tool.
- Launch Putty (or your other SSH tool) which you can download from HERE for free
- Enter the name of your site (the host name you use when you FTP to your site) in the HOST NAME field, and press your ENTER key.
- Sign in using your typical FTP credentials
- Type
pwd
in lower case and press the enter key – this will display the full path to your site on GoDaddy’s host – this is not needed but helpful - Type
cd
and the path to the folder – in my case it is cd /var/charoot/web/conf
Unfortunately in my case that file was located in a read only location and even GoDaddy support refused to change it.