LINUX SERVER PHP configurations.

Yesterday, i finished the whole process to built up a completely new LAMP stacks. After that, i am going to import my test server to my production server.

During this transition, i have to upload my sql database dump from my production server 1 to this new server.

Unfortunately, there is a problem for myself that i left off from yesterday’s process. I did not modify any of the PHP configuration. Therefore, i wasn’t able to upload the sql file which size 14MB.  By default,t he upload single file is only 2MB.

So, today i am going to dig into this php configuration file and do some modifications.

First, i would go to change the file php.ini. You can run following command to edit the php.ini file. (Sometime it’s stored in /etc/php.ini, but it also could be in /etc/php.d/cgi/php.ini or /usr/local/etc/php.ini)

vi /etc/php.ini

Then use the vi ‘s search function to search for below syntax and modify to suit your needs. (type in /strings to find your keyword and use keybaord i to get into insert mode to modify it one by one.)

memory_limit = 32M
upload_max_filesize = 10M
post_max_size = 20M

here is the search function: i type in /post_max and then hit enter


Then, the cursor will jump to the result it found


After all the modification has been completed, you can do following command to restart the apache

sudo service httpd restart

Leave a Reply

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