InMotion Hosting Support Center

All servers have a main php.ini file. This is a file that allows you to control the php settings. The main php.ini file controls the settings for the entire server. By placing a php.ini file within a folder, it will override the main server php.ini and allow you to customize settings for the files and folders under it.

Most of the time, editing a php.ini file at a more local level is sufficient, however there are times when you may want to alter the main file to provide the setting change as a default to the entire server. This can only be done with the root access on VPS and dedicated servers. The instructions below walk you through how to do that.

How to change your main php.ini file on VPS and Dedicated servers

  1. Log into your server via SSH.
  2. Use the following command to open the file for editing.
    nano /usr/local/lib/php.ini
  3. Search for desired settingActivate the Find feature by pressing crtl+W and then entering desired setting. The interface will scroll to that setting. In our case, we searched for post_max_size.
  4. After the setting is changedAlter the setting to your desired configuration. We changed the post_max_size setting to 16M.
  5. Name file during save.Save the changes by pressing crtl+O. You will be prompted for a filename, press Enter to keep the same name.
  6. Exit the editor by pressing ctrl+X.
  7. Exit your SSH Client.
Now that your php.ini settings have been saved, they will begin to work for your server.
Note: Those on FastCGI or DSO servers will need to restart Apache for the changes to take place.
Was this article helpful?

Related Questions

Here are a few questions related to this article that our customers have asked:
Ooops! It looks like there are no questions about this page.
Would you like to ask a question about this page? If so, click the button below!
Ask a Question

Forum Login

You are NOT logged in. You can still browse our Support Center.

To participate within our Community Support Forum:

n/a Points
2016-02-19 4:48 pm

after doing everything and try to save it says  Permission denied, any ideas?

10,077 Points
2016-02-19 5:47 pm
Hello Mohamed,

It means that your user does not have permissions to edit the file you are attempting to save.

Best Regards,
TJ Edens
n/a Points
2015-03-03 6:25 pm
No need. Worked well for me.
n/a Points
2014-10-08 3:15 am
It's enough!

Post a Comment

Email Address:
Phone Number:

Please note: Your name and comment will be displayed, but we will not show your email address.

4 Questions & Comments

Post a comment

Back to first comment | top

Need more Help?


Ask the Community!

Get help with your questions from our community of like-minded hosting users and InMotion Hosting Staff.

Current Customers

Chat: Click to Chat Now E-mail:
Call: 888-321-HOST (4678) Ticket: Submit a Support Ticket

Not a Customer?

Get web hosting from a company that is here to help. Sign up today!