Modify php.ini on Shared hosting | Web Programming Tutorial

Modify php.ini on Shared hosting

Published Date: September 20, 2015 |
Published Time: 9:58 pm |

Some days ago I have faced a problem of the web hosting’s POST MAX SIZE. I have to upload large file but the hosting server doesn’t allow it. So the standard process is modify your php.ini file . But most of the time in shared hosting you haven’t access in php.ini file. Then you need to write .htaccess.  But I found the most promising solution is the .user.ini file creation.

In PHP 5.30 and abobe version this option is available.

So what is the process ?

Let go with a simple example …….

You need to increase the maximum post size and the upload file size.  Now

  1. Goto your directory where the code is located for corresponding task.
  2. Create a file named .user.ini  (Don’t forget to write period first) .
  3. Write these line

upload_max_filesize = 40M

post_max_size = 40M

Save it. Then it should work. The original php.ini will be overwritten for this directory with this command.

Let’s try.

Leave a Reply

Your email address will not be published. Required fields are marked *