Home » Php » How to access the php.ini file in godaddy shared hosting linux

How to access the php.ini file in godaddy shared hosting linux

Posted by: admin April 23, 2020 Leave a comment


I have a web, and running well on my localhost.

After I Upload on my godaddy hosting, My web got a bug. the conclusions is, I MUST change the memory_limit on the php.ini file, BUT cant find php.ini on FTP manager.

I have tried to:

  • Find the way for change to the Classing FTP manager.
  • Create / upload php.ini file from local and not work.

My Questions is : How I can Fix this? I Must change php.ini file.
does anyone have experience like me?

How to&Answers:

Create php.ini file with your desired setting and upload it in your root folder of server. It will take effect with this new setting.

You can’t edit the php.ini file of godaddy server, but you can upload your own copy of your php.ini with your new setting.

This new setting will be available only to you. Other websites will not be affected with this new setting.

Previously I faced the same issue, but after doing this my problem was resolved.


As pointed out by @Jason, for most shared hosting environments, having a copy of php.ini file in your public_html directory works to override the system default settings. A great way to do this is by copying the hosting company’s copy. Put this in a file, say copyini.php

  system("cp /path/to/php/conf/file/php.ini  /home/yourusername/public_html/php.ini");

Get /path/to/php/conf/file/php.ini from the output of phpinfo(); in a file. Then in your ini file, make your amendments
Delete all files created during this process (Apart from php.ini of course 🙂 )



  • Go to your CPanel
  • Select PHP version
  • Click on the link Switch to PHP options
  • Edit your configuration
  • don’t forget to click save

enter image description here

You can also follow this screencast



To check whether your php.ini file takes effect, open a plain text editor and create a file called phpinfo.php. Insert the following line:

<?php phpinfo(); ?>

Save this file to the root of your Web site and then browse to yourdomain.com/phpinfo.php to test the settings.



You need to create your own php5.ini file and upload it to your root directory. Using GoDaddy (as I do) you do not have control over the web/conf/ folder to make any changes to their version. Be sure if you’re using PHP5 to name your file php5.ini or php.ini for PHP4. Upload it to your root folder, then restart your page, then check using phpinfo() to see if the directory of your php file has changed correctly.

For more information, check this link out.


if you don’t have a good copy of your php5.ini file in your home directory (a predicament that I recently found myself in), you’ll need to follow a little multi-step process to make your changes.

  1. Create a little code snippet to look at the output of the phpinfo() call. This is simple, and there are multiple web-sites that describe this process.

  2. Examine the output of phpinfo() for the row which contains Configuration File (php.ini) Path. Mine was in /usr/local/lib, but your’s may be a different path (depends on hosting level purchased).

  3. GoDaddy will NOT simply copy this file into your home directory for you –as silly as that sounds! But, you can write a little php program to copy this php.ini file into your home directory. The guy at
    has a drop-box with this code snippet, if you care to use it. Just
    take care to modify two things:

    • a. change the path you read ‘from’ to match the path you uncovered in Step 2.

    • b. change the output file-name to something of your choosing. You’re going to re-name this file in a later step anyway. Let’s call our copied file Foo.ini (but it can be anything).

  4. Rename Foo.ini to .user.ini (for most GoDaddy account types).


Create a new php.ini file with your desired settings and upload it to public_html folder of your Godaddy Hosting Account.

By default, Godaddy doesn’t allow to edit it’s existing php.ini file. However, you can always upload your own copy of your php.ini file with your own settings.

Below is an example of a simple php.ini file with some custom values:

max_execution_time 600
memory_limit 128M
post_max_size 32M
upload_max_filesize 32M


I had this exact problem with my GoDaddy account.

I am running the Linux hosting with cPanel

follow these steps and you should be fine if you are running the same hosting as me:

first, go to you Manage Your Hosting -> Manage

then you will see a section called Files, click on File Manager

you can select the Document Root for: yourwebsite.com then click GO

this should bring you right away in the public_html folder

in that folder, you can add a file (by clicking the +File in top left corner), call it phpinfo.php

right click that new file, and select edit :

right this in it and save changes:

<?php phpinfo(); ?>

it the same public_html folder, add another file called php.ini

edit this one too, right those lines:

max_execution_time 600
memory_limit 128M
post_max_size 32M
upload_max_filesize 32M

now, go back to your Manage Your Hosting -> Manage, look for PHP Process

click Kill Process, this will allows a refresh with your new settings. you are good to go

side note: you can see your new settings by navigating to yourwebiste.com/phpinfo.php


I found a guide to reload the php5.ini file or load a new one right away. You will need to access your Godaddy hosting panel where you will find the option “system process” do a restart there and it will load the php5.ini or php.ini file right away.

2 external guides to assist you:




For some hosting accounts, I’m on Ultimate Classic Linux, the file name you need to use is .user.ini.


It’s an older question, but if anyone has a problem with setting this, their documentation is outdated. I made a copy of the php.ini file named php5.ini and now it works.


Follow below if you use godaddy shared hosting..
its very simple:
we need to access root folder of the server via ftp, create a “php5.ini” named file under public_html folder… and then add 3 stupid lines… also “php5” because I’m using php5.4 for 1 of my client. you can check your version via control panel and search php version. Adding a new file with php5.ini will not hamper anything on server end, but it will only overwrite whatever we are commanding it to do.

steps are simple:
go to file manager..
click on public_html..
a new window will appear..
Click on “+”sign and create a new file in the name: “php5.ini” … click ok/save. Now right click on that newly created php5.ini file and click on edit… a new window will appear… copy paste these below lines & click on save and close the window.

memory_limit = 128M

upload_max_filesize = 60M

max_input_vars = 5000


Not php.ini file, but a way around it. Go to GoDaddy’s

Files > Backup > Restore a MySQL Database Backup

Choose your file and click Upload. No timeouts. Rename the DB if needed, and assign a user in

Databases > MySQL Databases