Portal Home > Knowledgebase > Articles Database > php ini settings question.


php ini settings question.




Posted by Driver01, 03-23-2010, 12:22 PM
I am hosting a website with a provider and am using a commercial retail script, through the script I upload images, now some images are a little larger then usual then is set in the default upload_max_filesize directive file, say 5mb. Now the host was kind enough to edit the ini file to accommodate me and raised the max_filesize too 15mb, and although this change reflects in the phpinfo() function it still hasn't resolved the fact that I am still getting the max_filesize error. FYI I am not getting a timeout? Appreciate some thoughts? or better still solutions?

Posted by vapetrov, 03-23-2010, 04:07 PM
Please provide complete error message. Also check post_max_size option. It must be equal or bigger than upload_max_filesize

Posted by kencox, 03-23-2010, 04:10 PM
Check your local .htaccess file I am not saying that is the problem but your .htaccess file should override global settings.

Posted by techstar, 03-23-2010, 06:18 PM
Also please upload a phpinfo page under your domain and check whether the PHP settings for your domain is getting loaded from the default php.ini file or a file that is separately setup for your domain. Could you place the link to your phpinfo page here? PHPINFO code ************* ************* -Techstar.

Posted by Driver01, 03-23-2010, 07:04 PM
Not exact but the error is roughly: its a custom error to the script and post_max_size in the phpinfo() is showing as 8M .? I presume this means I have a locally loaded file for my domain? perhaps the post_max_size is the problem I'll try and set this to equal and see if it makes a difference?

Posted by techstar, 03-23-2010, 07:12 PM
Loaded Configuration File : /usr/local/lib/php.ini' . This means you are using the common php.ini that is used by all the accounts on the server.

Posted by ksv2nash, 03-24-2010, 04:08 AM
Hello, You Add lines to .htaccess file php_value upload_max_filesize 200M php_value post_max_size 300M php_value output_buffering On php_value max_execution_time 60000 php_value max_input_time 70000 php_value session.gc_maxlifetime 144000

Posted by Driver01, 03-24-2010, 04:59 AM
Well I am stumped, this is the error from opencart on image upload: A phpinfo() query returns that all the settings we have looked at are set as required: upload_max_filesize 20M 20M post_max_size 30M 30M but the script insists my upload_max_filesize value is exceded on a 5mb image upload?

Posted by ClaudiuPopescu, 03-24-2010, 06:02 AM
Run the following while logged on as root: updatedb locate php.ini Then check the values in all this php.ini files, maybe that script uses php cli, I'm not an expert in php but you don't need to be one in order to debug this.

Posted by InstaCarma_Support, 03-24-2010, 06:18 AM
Try with a custom php.ini instead of htaccess. Remove the corresponding entries from the .htaccess file. Create a php.ini file in the exact directory where the upload is being done from. For example, if the upload is being done in the folder /home/username/public_html/abc/uploads then make sure that the custom php.ini is present in that certain directory and NOT simply under the public_html folder. Put the following lines in the custom php.ini Once this is done, create a a file named phpinfo.php at the same location and put the following content in it : Access the file via the browser and check if the new values for the above parameters are being picked up. If yes, then try the upload again.

Posted by ignitionservers, 03-24-2010, 08:28 AM
Well whether the php ini is local or global depends on whether you're inside a VPS, Chrooted or just running a dedicated server. /usr/local/lib/php.ini is basically a global file, so you need to change the settings in there. If, for instance you're chrooted then you need to change the settings in /usr/local/lib/php.ini WITHIN your chroot. What's important is that you change the settings in the right file. And don't forget to restart apache.

Posted by Sileep Kumar M S, 03-24-2010, 07:26 PM
Is the server suPHP enabled?



Was this answer helpful?

Add to Favourites Add to Favourites    Print this Article Print this Article

Also Read
How to host a VPN? (Views: 563)