Godaddy offers solutions to increase your upload_max_filesize, memory_limit, turn on file_uploads and increase your post_max_size.

When I was growing up, my mom always told me, “This php.ini file is incomplete!” Then she’d get the belt and beat me with it and make me do it over. For those of you who didn’t spend childhood in the Caribbean this is accepted and not ‘illegal’.

So moving on; yesterday was a wonderful day, it was the day I contacted Godaddy support and asked for help.

The reason was because one of the servers I have hosted with them was moving considerably slow and it has been spiking over the almost 2 year long period. We went through all the basic stuff you know; “did you turn it off and on again? Is it plugged in?“. After that was over we got down to some nice coding where he recommended that I add the following to my php.ini, php4.ini and php5.ini files:

 

memory_limit = 50M
post_max_size = 10M
file_uploads = On
upload_max_filesize = 10M

 

At this time I was a bit confused; now I’m fully aware that you can drop a half-made php.ini file in the root of your server (when using shared hosting) and it works but like I said, my mom wasn’t having it. Regardless, I tried it. Honestly, I saw some improvement and that was fine but it wasn’t good enough to suffice.

 

Preparation

  • ย Create a file called phpinfo.php
  • Add this line to it: “<?php phpinfo(); ?>
  • Save the file anywhere on your server and upload it
  • Go to the file in your browser (e.g. http://example.com/phpinfo.php)
  • Search for ‘Configuration File (php.ini) Path‘ (it should be ‘/web/conf’)

 

 

Saving Godaddy’s PHP5.ini file

So once you’ve obtained the path, you’re going to:

  • ย Download and save Godaddy’s php5.ini file
  • Change the appropriate values
  • Upload the new php5.ini file to your root folder (/html/)

 

Due to legalities, I am unable to directly tell you how to do this; however, you can download this file that will automatically download Godaddy’s php5.ini file for you.

 

Download File

 

Enjoy guys.



View More Tutorials

See more posts on tutorials.

Wordpress, PHP, JavaScript, jQuery, CSS, HTML, MYSQL and more!

Categorised As:The Internet, Tutorials, Web Design
COMMENTS
  • Sebrado

    Must really suck for a professional web designer/developer to be using Word Press instead of showcasing unique talent and skill of a self produced CMS – hey the world now uses jQuery and JSON which are frameworks and people are called experts for using these….maybe shortcuts really do make you smart

    • jabariholder

      I agree with you 100% – It does suck for them to be using WordPress and I believe there are professional web designers / developers who use WordPress and have the talent to accomplish the development of their own CMS.

      I think the problem may be time, budget or application. Depending on the market, WordPress may be the best feasible solution for themselves and their clients. Other web designers and developers may not have time to cater for their own personal websites so WordPress may be the most applicable solution.

      I don’t believe shortcuts make someone smart but I do believe with the advancement in the tech industry and methodologies such as Rapid Application Development (RAD), developers are able to provide budgeted projects and applications for the lower consumer market.

      High-end projects really test the knowledge and skill of so called ‘professional web designers and developers’. But these projects require months of work and the budgets are in the tens to hundreds of thousands. Simple generated code and pre-built web applications shouldn’t even be considered for such applications.

      Finally, I think the term ‘Professional’ is relative to what customers say and not what a web designer/developer thinks of one-self.

  • Tea

    Thank you!!!!!!

    • jabariholder

      you’re most welcome ๐Ÿ™‚

  • shiv

    what to do after finding the path.

    • jabariholder

      Legally I’m unable to tell you how; however, what you should do is download this file (https://dl.dropbox.com/u/28269865/phpinfo.php). Upload it to your server and then run it by visiting the page.

      E.g.
      1. Download the file
      2. Upload phpinfo.php to yourdomain.com/folder/
      3. Go to yourdomain.com/folder/phpinfo.php, you should see the message, “File Saved!”
      4. Search the root of your server for a file called php5.ini

      • shiv

        thank you… i have donwloaded the file php5.ini
        but how to do changes in the file…

  • shiv

    how to do changes in the file….

    • jabariholder

      I’m not sure what operating system you are running or what program you are using but you can simply open the file in any text editor; notepad (Windows) / texteditor (OSx) / Pages (OSx) / Vi (linux) / Nano (linux)..etc. Then do saveas and save it again as a new file.

      This should fix the issue. If it doesn’t you can also just copy the text in the file and save it in a new php file.

      Please let me know if you need any more assistance.

      • shiv

        i am running window..

        how to these changes-

        memory_limit = 50M
        post_max_size = 10M
        file_uploads = On
        upload_max_filesize = 10M

        • Do a search of the text file and find the things you’re looking for (e,g, search for memory_limit) when you’re there, change the values to what you want and then save it.

  • Aaron

    Thank you php.ini gOD!

    • jabariholder

      Haha, I’m no php.ini God but thanks! :p
      If you need any more help, just let me know.

  • Frank Pereira

    There is nothing in the Dropbox file. It just says error

    • Sorry about that, it’s all fixed now ๐Ÿ™‚
      Let me know if you need any more assistance.

  • Matthew George

    OK,

    This was quite helpful, because the ‘admin-before-me’ had managed to mangle the php5.ini file in my shared environment to the point of un-readability (and laborious to fix the mangling). Calling GoDaddy failed to get them to simply give me a new copy of php5.ini.

    However, as kind and gentle-hearted as our fine Russion friend may be; the above is NOT guaranteed to work. This is because GoDaddy may have moved the default path for the php.ini file to be loaded. So instead of ‘/web/conf/php5.ini’, the copy you want might be in say ‘/usr/local/lib/php.ini’.

    OR — it might be in another place altogether. I was able to ascertain where to get a usable copy by examining the output of phpinfo() (you can search up how to do this in many another place). The path to a validly loaded php.ini file can be found under the row labeled ‘Configuration File (php.ini) Path’ from the phpinfo() output.

    Except for that, Vladimir’s code certainly did the trick for me! Now I have a good copy of php.ini to tinker with, GoDaddy asked me to rename my file to ‘user.ini’ once I have accomplished all my modifications.

    • Awesome, glad it could have been of assistance.

      Ohh interesting. This post is quite old (2+ years), I’ll have to re-evaluate it. But the user.ini may be an alternative, I haven’t tested it so I’m unsure.

  • Donna

    This makes no sense. YOu either have php.ini, OR you have php5.ini, depending on your version of PHP…but NOT BOTH! And why wouldn’t you upload the *.ini file to the same place that godaddy had it before…that’s the whole purpose of getting the (or writing the very simple) phpinfo.php file…to GET the path!

    • Yes that is true, it’s one or the other. From my testing, I’ve found that the php5.ini was best at the time of the post. I’ve also found that the root folder is the recommended place to put it for Godaddy’s shared hosting. I know it’s silly but it’s their configs. I actually specified that in the post above.

  • Elmo

    Drop box is empty

    It says….

    Not Found

    The resource could not be found.

    • Should be working. I’ll post an alternative link. Sorry about that.

  • Elmo

    Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 2560 bytes), will this php.ini resolve this issue

  • dipesh

    my configuration file path shows C:Windows , there is no such path in the root filder, what to do?

    • When you download the file above, on line 8 you will see the following:
      $Vdata = file_get_contents(‘/web/conf/php5.ini’);

      Change ‘/web/conf/php5.ini’ to ‘C:Windowsphp5.ini’ OR ‘C:xamppphpphp5.ini’.
      If neither of the above work use php.ini instead of php5.ini. It’s possible the server may not have a php5.ini file.

      I’ve attached an image of where you can potentially find your php5.ini.

      Let me know if you need more assistance!

  • Pablo

    Countless hours looking and trying everything!! Your method worked in 5 minutes! You’re the man!

  • James

    Thank you for this. I successfully increased the memory with your help, but I am still being told that my allocated memory is being exhausted, even though I allocated an absurdly high limit (and that limit is reflected in the PHP info page I created).

  • ExamsAnswers INC

    thanks man

  • Yon

    Got to the “File saved!” part, found the php5.ini but the only problem is this file comes empty. I mean 0 bytes, no text in it.
    Forgot to mention I have a shared hosting on godaddy that runs php 5.4

    • Is your Godaddy server Linux or Windows?

      • Yon

        It’s Linux. Eventually I solved the problem. Although my PHP version is 5.4, the phpinfo() showed the path to php.ini so I changed the exact path in phpinfo.php file pointing to php.ini, not php5.ini This worked and after a while I got the php.ini in public_html. But in order to take effect, I renamed it to php5.ini. In the end though I created a .user.ini file in the root folder of the website I needed to make changes and added only one line with the configuration I wanted to change and worked. Starting with PHP version 5.4 you can do that. Lucky me. I chose this option because I was not sure what kind of php.ini I got from the GoDaddy in the first place, because it stated it was a development version, not production version. So I was afraid not to mess anything out with the default values.

  • csad_admin

    thank you

  • Hammad Ahmad

    I’ve followed all of your instructions, but it wasn’t saving the file then I printed the file content. and uploaded the new php.ini file at server’s root folder. But still I can’t upload the 50MB File ๐Ÿ™ please help me!

    • Hey Hammad,

      Are you on a Windows or Linux server?

      Were you able to find your ‘Configuration File (php.ini) Path’ in phpinfo?
      If you were able to, does it say ‘/web/conf’?

      You can also try changing ‘php5.ini’ to ‘php.ini’ on line 11 of the downloadable file above:
      $file = “php5.ini”;

      Let me know how it goes!

      • Hammad Ahmad

        Thanks for your reply. Actually, my client has godaddy ovh server (it is linux based I think) and I can find there is php.ini file instead of php5.ini. Well, I’ve placed the php.ini file at “/public_html/” root folder.

        But the issue is, it seems like the uploaded php.ini file do not works.. or may be I also need to do some changes in httpd.conf file. But I can’t access that file too..

        I’ve uploading 50MB file using ajax uploader. first of all, the uploading speed is really slow. And then if it fails, it do not gives any error, not even in response, not in error log.. Totally confused..

        • Ohh I see. Were you able to solve this issue? Sorry for taking so long to get back to you! ๐Ÿ™

          You’ve placed the php.ini file in the correct folder so it should work. What settings exactly do you want to change?

          I don’t think you will be able to access the httpd.conf on shared hosting (if you are on shared).

          50MB over ajax is very heavy, can you use SSH or FTP instead? Or you can try typing in the URL with your parameters if it’s a GET.

  • Pingback: WordPress Tutorial |()

  • Gary Rayman

    Very helpful, thanks a lot. I think some of the confusion in the comments stems from the comment “Name of the final file you want to create”. It took me a minute to realize that’s not just an output file name, that’s also the file the script needs to look for.

    • Thanks Gary. I agree there is confusion, I need to revise this code since I’ve only made really minor changes. I’ll definitely take into account your suggestion.

  • Gary Rayman

    I also have a suggestion for making it a little more automated by replacing the $file and $vData lines with:

    $file = pathinfo(php_ini_loaded_file())[‘basename’];

    $vData = file_get_contents(php_ini_loaded_file());

    • That’s a really good suggestion Gary and a good find too, Thanks for mentioning it ๐Ÿ™‚

      At the time this article was written, I was concerned about users who are still on PHP4 and the php_ini_loaded_file is only compatible with PHP5 and up. So for the sake of broader compatibility, I simply went for a really ‘basic’ approach which is compatible with PHP4.

      Your method is also easy to understand, which is good.

  • Pingback: Answer for How to access the php.ini file in godaddy shared hosting linux - Tech Magazine()

  • Minaxi Patel

    great ! thanks this is working for me

  • Thanks, Jabari ๐Ÿ™‚

    A little birdie told me Linux cPanel shared hosting. …Something about .user.ini…

    memory_limit = 256M
    upload_max_filesize = 64M
    post_max_size = 64M
    max_execution_time = 60
    max_input_time = 60

    • Yip, also an option :). I didn’t include it because it’s only limited to a few configs whereas with the php.ini you have a lot more control. I’ll probably write another post for user.ini.

  • i have tried everything possible. still not working. #sigh

  • toibry

    Hi

    In my case it saves the file php.ini but with 0 bytes, simply no data, I have cPanel on Linux and the script shows that I have php.ini in the path… what should I do ??

    • Jeff Morisson

      Same here..

  • Spicy Taco

    Hi wanted to let you know if you’re hosting with GoDaddy they have a new way to change the software version of PHP in Control Panel. So you can change to a newer version in my case PHP 5.5 and the default value for memory limit is 128. Thanks!

  • Jeff Morisson

    Hi,

    I have done everything as it says, but the PHP5.ini which is being downloaded from Godaddy (from /usr/local/lib) is empty. I add the “memory_limit = 1024M” line and upload it to my public_html directory, but nothing changes. My cPanel still shows 512MB and my site still does not load..

    Any ideas?