InMotion Hosting Support Center

PHP is a scripting language used primarily on the web and is available on our shared, VPS, and Dedicated servers. PHP is highly customizable and has many settings that our users can modify themselves. This article will advise you how to change PHP settings in your php.ini file.

Note: If you only need to change your PHP version, see our guide on how to change your PHP version in cPanel.

How to view your current PHP settings

To view your current PHP settings, create a PHPinfo page. If you're not sure how to do this, please see How can I view my PHP settings using a PHPinfo page ?

The steps in updating the values listed in your PHP info page depend on how PHP is setup on your particular server. In general, PHP runs on our servers as either:

  • Apache module
  • CGI Module

To find out how PHP is configured on your server, create a PHP info page (via the above instructions) and look at the "Server API"' value. If the "Server API" is "CGI", then PHP is running as "CGI module". If "Apache" is listed, then your server is running PHP as an "Apache module".

Server API: Apache

If your server runs PHP as an "Apache module", you can change your PHP settings via a .htaccess file. A .htaccess file is a configuration file you can create and use to change many server settings, including PHP settings. The basic syntax to use in your .htaccess file for updating PHP settings is:

php_value Directive value

For example, if you wanted to change the max_input_time from 60 seconds to 120 seconds, add the following to your .htaccess file:

php_value max_input_time 120

After making this change, refresh your PHP info page, and you should see the changes. If you receive a 500 error, please double check the syntax you used as you may have made a misspelling.

If you don't have a .htaccess file, you can simply create a new file named .htaccess. As the .htaccess file begins with a dot (.), it is considered a hidden file. If you are using the cPanel's File Manager, please be sure to select the option to Show Hidden Files (dotfiles), otherwise you will not be able to see your .htaccess file. If you do not see this prompt when opening your File Manager, click the, "reset all interface settings" link at the bottom of your cPanel to reset your File Manager settings.

Server API: CGI

View of the php.ini in the File Manager

If your server runs PHP as a CGI module, you can change your local php.ini file in order to make modifications to your PHP setup. php.ini is a PHP configuration file with a list of PHP directives and their values. In the above example, we modified the max_input_time value. If you open your php.ini file and search for max_input_time, you should see something similar to:

; Resource Limits ;
max_execution_time = 30
max_input_time = 60
memory_limit = 256M
upload_max_filesize = 10M

To change the max_input_time from 30 seconds to 120, for example, simply change 30 to 120 and save the file. Refresh your PHP info page, and you should see the changes.

Increasing PHP memory in the php.ini

A common issue when using free open source software or other PHP intensive programs is the "exhausted memory" error. If you have a PHP memory error on your site, you can increase the memory limit PHP uses for the scripts. To learn how to change the memory limit in your php.ini, please see the following link.

Fixing the Allowed memory size exhausted error

Modifying the PHP.INI file

Here is a quick step-by-step tutorial on editing the PHP.INI file.

  1. Login to the cPanel.
  2. File Manager in the cPanelFind the File Manager in File section of the Cpanel. Review our tutorial on using the Code Editor within the File manager if you're looking on information how to use it.
  3. File Manager iconsNavigate to the directory where you will either save or edit the PHP.INI file and then select the file and use the Code Editor. To open the file, you can click on it to select the file and then click on the Code Editor icon in the menu bar of the File Manager. You can also right-click with your mouse and select Code Editor from the menu that appears.
  4. Edit the section of the PHP.INI that you wish to change.
  5. Click on SAVE CHANGES in the top right hand corner in order to save your modifications or additions to the file.

Common Problems when Updating your php.ini file

I don't have a php.ini file!

Only users running on a server with PHP loaded as a "CGI module" will have a php.ini file. The php.ini file by default will be located at public_html/php.ini. If you do not see a file named php.ini in your public_html, please contact our Support Department and request that we create one for you.

I made changes to the php.ini file, however I do not see the changes!

The php.ini file is not recursive. Updating your php.ini values in public_html/php.ini will not affect PHP files in subfolders of your public_html, such as public_html/staff. To correct this problem, you can make your php.ini file recursive so that it affects all sub folders. More help on this can be found in How can I make my php.ini file recursive?

Considering a VPS or Dedicated Server?

With a VPS or dedicated server, a site owner can truly customize the server to their exact specification. If you are on a Shared Hosting account, and are thinking about upgrading from to a VPS or dedicated server, click here to read more about a VPS vs dedicated server.

Was this article helpful?
n/a Points
2019-01-10 6:00 am

i want php.ini file for website in public_html there is no php.ini file exist

can you send me?

31,595 Points
2019-01-10 9:33 am
If you do not see a file named php.ini in your public_html, please contact our Support Department and request that they copy a default one to your account.

Thank you,
n/a Points
2017-12-15 6:20 am

I want php.ini file for my website. But i didn't find php.ini file in my public_html.

Can you pls send me php.ini flie.

I want to send mail with an attachment . How to configure the settings in the CPanel to send the mail through php code.

I done it in xampp but in this i didn't find necessary files to config.

3,820 Points
2017-12-15 2:25 pm
I recommend contacting our Live Support for assistance in obtaining the default php.ini file for your server.

In regards to configuring cPanel, you should contact the developer of the PHP script that you are using to send mail to determine what settings/configurations are needed server side. For instance, you will need to create an email account in cPanel, however, that email account would depend on what is configured in the PHP script as the sending email.

At the very least, I recommend configuring SPF and DKIM records to secure your server.
n/a Points
2017-11-06 12:05 am


I updated the sever from shared  to VPS. After that php files are not working or executing. only download that file by browser. How to solve that issue


13,821 Points
2017-11-06 7:18 am
It sounds like you changed the PHP version when you upgraded. You can try to <a href="">change the PHP Version</a> and see if that helps.
n/a Points
2017-09-26 2:41 pm
I am trying to adjust my execution time and time limits by entering this in within .htaccess (because the site is on an Apache server) and try as I might, I continuously get a 500 error. It only reverts after I remove the edits. This is even after copying and pasting right from the article here. Here is what I have entered. I would like to be able to run duplicator to back up the site I'm building and this is preventing me from doing so: php_value max_input_time 120 Please assist, this is preventing me from being able to backup my site (and making my client happy.)
11,043 Points
2017-09-26 2:53 pm
Even though the execution time has been adjusted in php.ini, it's possible there is a account-level restriction affecting the full execution of the script. This would be most likely in a shared hosting environment. If you are in a dedicated or VPS environment, you may want to check for PHP errors.
n/a Points
2016-12-23 11:54 am


I have a problem with this:

- Warning! Your PHP configuration limits the maximum number of fields allowed in a form: 1000 for max_input_vars.

I working with the version de Prestashop, Which file do I need to modify to solve this?


2,858 Points
2016-12-23 1:32 pm
David, you can edit this value right in your php.ini file as described in the article above. Please keep in mind that your website host may overwrite, or disallow modifying the value for max_input_vars, and you should contact them if your attempts to modify it are unsuccessful.
n/a Points
2016-07-15 1:40 am

Just to the point, thanks!

n/a Points
2016-02-21 6:26 pm


I intend to move my website, and I'm looking for a reliable

hosting. With the ex-hosting company I faced a problem related to:

"php.ini" + "htaccess" + "Creating Redirect URL".


The Issue Details:

It is an ordinary thing; some websites structures need to change the

php.ini values such as "max_input_vars" to ensure a good performance

of the site.


When the ex-hosting support team have changed

the values, they had to set "suPHP_ConfigPath" as a line

inside "htaccess" to make it effective in my blog subfolder, but

I got an error while I was creating

a redirect URL between my domains, as it is in this screenshot:


Once I removed, I made a redirect without any errors, but

I lost all "php.ini" values like it is not existing!


Do you think I will face the same problem with your



Thank you.

Fahad M.


42,943 Points
2016-02-22 9:39 am
Hello Fahad,

Sorry for the problems with the re-direct. In general, if we can see the re-direct commands being set, then we can determine the cause and fix the issue. We can't guarantee you that your particular re-direct will work without seeing what it is that you're trying to do, but it doesn't make any sense that local php.ini files written to your account would just disappear. At the very lease, we would recommend making backups of the file so that we would be able to recover if something did happen. Finding a particular host will always be YOUR choice, and you're welcome to try our service if you wish.

If you have any further questions or comments, please let us know.

Arnel C.
n/a Points
2015-10-21 11:06 pm

Hi, I don't have a php.ini. Can I just make one? or are there special configurations needed?



31,595 Points
2015-10-22 9:58 am
Hello Mark,

Thank you for contacting us. Only users running on a server with PHP loaded as a "CGI module" will have a php.ini file. The php.ini file by default will be located at public_html/php.ini. If you do not see a file named php.ini in your public_html, please contact our Support Department and request that we create one for you.

Thank you,
n/a Points
2015-09-11 5:36 pm

I can't tell you how grateful I am for your site, thank you.

n/a Points
2015-08-07 7:09 pm

hello, how do i change maximum execution time from 60 to 300sec from my cpanel, when i open my  .htaccess file this what i find 

ErrorDocument 404 /.errors/404.php


# BEGIN WordPress

<IfModule mod_rewrite.c>

RewriteEngine On

RewriteBase /

RewriteRule ^index\.php$ - [L]

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule . /index.php [L]



# END WordPress


and i do not have any php.ini  file in all my file folders so i created one for my cpanel and open it with the code editor and pasted the command code

max_execution_time = 300  and clicked o save but when i checked my php.infor of my website the max execution time still remains at 60 no changes were noticed, what do i do, thanks in advance


10,077 Points
2015-08-10 8:17 am
Hello Eric,

That may be a hard setting set by your host. As to ensure customers do not run processes for long periods I believe we also have ours set to 60 seconds as the max. However your php.ini insert is the correct method to increase the max_execution_time if you were able to.

Best Regards,
TJ Edens
n/a Points
2015-06-24 7:55 am

Hiiiiii Friends,

       I want to receive mail on my own website mailbox can you help me for this type code for the receive unread mail using core php


42,943 Points
2015-06-24 3:16 pm
Hello Ashwini,

We do not provide programming services through the support center so we cannot provide custom code for you to set up your own mail service. If you want to use the existing mail service, you can use phpMail or you can use the existing mail interfaces and administration through the cPanel.

Arnel C.
n/a Points
2015-06-06 11:22 am

I updated my php.ini file to allow 512mb uploads, but it's been over a day and WordPress still reports that I can only upload 128mb. How do I get the server to accept my changes?

43,761 Points
2015-06-08 2:59 pm
Hello Shawn,

You will also need to ensure the php.ini file is recursive.

Kindest Regards,
Scott M
n/a Points
2015-04-12 12:10 am

It doesn't work...

I have changed the value of max_file_uploads = 100 (its default is 20) and check it by <? phpinfo(); ?>.

the max_file_uploads value has changed to 100 but i still can upload only 20 files as the default.




43,761 Points
2015-04-13 11:43 am
Hello BiBoy,

Have you set the php.ini to be recursive to all folders under that directory?

Kindest Regards,
Scott M
n/a Points
2015-03-16 10:14 am

i am having error when uploading bulk product data through csv of internal server, tried all changes in the php but still same out of 7k product list only 200 or 300 some times get uploaded and i get 500 internal server error i am using Prestashop version

thanks in advance3

42,943 Points
2015-03-16 2:37 pm
Hello Paresh Shah,

The problem you're having has to do with the SIZE of your product list. The server allows for a program to run for a period of time, but when your input list is 7000 products, you are basically causing the program to time out. I highly recommend you break down that product list so that you have 14 groups of 500 products. You're definitely stressing the server with a list of 7000. Trying importing in smaller groups and it should work.

Arnel C.
n/a Points
2014-10-29 10:33 am

How can I use local php setting while using php in CLI. For example, if I am using composer and the command is "php composer update", how can I use local settings for this? I am getting out of memory while running "php composer update".

n/a Points
2014-10-29 11:04 am

Later I checked it and found that CLI uses local settings. Unfortunately, I could not solve my out of memory issue while using composer.

42,943 Points
2014-10-29 11:12 am
Hello Debiprasad,

Thanks for the question. I am unable to find out if you are an InMotion customer, so that I could see the server type you're using. When I researched this issue, I was told that there need to be some type of configuration added to your CLI command to help with the memory management. Otherwise, memory would be managed by the server php.ini settings. In order to change the server settings you would need to have access to the server as a root user. This would not be possible on a shared server account with InMotion.

I hope this helps to provide some clarity on the issue. Please let us know if you continue to have any further questions or comments.

Arnel C.
n/a Points
2014-10-30 2:28 am

My client is an InMotion customer. And it's a shared hosting. Is there any chance to run the CLI command without the out of memory error (in other words to increase allowed memory).

31,595 Points
2014-10-30 9:54 am
Hello Debiprasad,

Thank you for your question. You can specify the php.ini file in command in for example:

php -c /home/userna5/public_html/php.ini /home/userna5/public_html/somefile.php

You also, can specify php.ini settings in the command, such as:

php -c /home/userna5/public_html/php.ini /home/userna5/public_html/somefile.php -d memory_limit=256M

If you have any further questions, feel free to post them below.

Thank you,
n/a Points
2014-10-31 2:04 am

Thank you for letting me know about those two tricks. But unfortunately, I am unable to run "php composer update" properly. Even if I set the memory to 2048M, it's not working and showing out of memory error.

31,595 Points
2014-10-31 10:37 am
Hello Debiprasad,

Thank you for the additional information. I found the official Composer guide on troubleshooting Memory errors in Composer.

It provides several solutions, and you can even submit a ticket to them directly to investigate further.

If you have any further questions, feel free to post them below.

Thank you,
n/a Points
2016-09-08 6:47 am

Hi, I have the same issue. Tried all the tricks. Did you manage to get it working? Best I can do at the moment is delete the entire vendor folder and run "composer install" instead, but it's a pain and not really a fix.

n/a Points
2014-10-20 6:40 am


how to increase  max_input_vars  values....  In htaccess it is throwing error.     

It is not working for me.!

31,595 Points
2014-10-20 8:51 am
Hello ajay,

Thank you for your question. Typically, you would increase the max_input_vars value in the php.ini file.

Can you provide a link to the error?

If you have any further questions, feel free to post them below.

Thank you,
n/a Points
2014-09-03 11:08 am

And how that line should be to change vars?

31,595 Points
2014-09-03 1:07 pm
Hello Enzo,

Thank you for your question. To change the variable, just adjust modify the number following the rule you want to change. For example:
memory_limit = 256M

To increase the memory_limit in this case, just change the number to what you need:
memory_limit = 512M

Thank you,
n/a Points
2014-04-22 1:53 am

Thanks for this article. It quite clear.

But, how do you change the max input vars when using a CGI server?

There is no max_input_vars in the local php.ini.


Thanks in advance.


11,186 Points
2014-04-22 7:49 am
While it may not already be located in your local file, you may always add the line which will change what is defined there. The php.ini variables are still the same regardless of how you are running PHP.
2013-05-15 10:40 am
I just wanted to thank you for this. I have spent 2 hours combing through blog-spam and other crap on the internet until i found this. This was hands down one of the best tutorials on anything i have seen in a long time. It worked perfectly the first time with no issues.
n/a Points
2016-04-27 12:56 am


Thaks for post

I edited the .htaccess file to change php limits, but the issue I have is that there are 4 .htaccess file in my public_html folder, one in root and the other in subfolders...should I edit them all or the one in the root will suffice ? thanks

Post a Comment

Email Address:
Phone Number:

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

42 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!