davegfx Posted October 28, 2009 Share Posted October 28, 2009 Hi First off - apologies - i'm not a coder so this may sound very amateur. I'm having an issue with files being uploaded via a submission form. Files under 2mb are fine. Files over 2mb are not. I've deduced that this is being caused by a setting (upload_max_filesize) in php.ini. I ran php.info and the information from there seems to corroborate this: upload_max_filesize 2M (local) 2M (master) post_max_size 8M 8M I assume if i want to allow files of up to 50MB to load that i need to change these settings. Now - the problem - where do i find this ini file? The php.info says its located: Configuration File (php.ini) Path /usr/lib Loaded Configuration File /usr/local/lib/php.ini So, how exactly do i access this? And if i change those settings, do i need to modify anything else? Is max_input_time or max_execution_time going to affect large files as well?? Thanks! Quote Link to comment Share on other sites More sharing options...
trq Posted October 28, 2009 Share Posted October 28, 2009 So, how exactly do i access this? Do you have shell access to your server or are you on shared hosting? Quote Link to comment Share on other sites More sharing options...
taquitosensei Posted October 28, 2009 Share Posted October 28, 2009 you could upload a php.ini to your web root with this as the contents upload_max_filesize = 50M that should override only that setting from the regular php.ini Quote Link to comment Share on other sites More sharing options...
trq Posted October 28, 2009 Share Posted October 28, 2009 you could upload a php.ini to your web root with this as the contents upload_max_filesize = 50M that should override only that setting from the regular php.ini That only works on servers configured to parse php as cgi. Quote Link to comment Share on other sites More sharing options...
newbtophp Posted October 28, 2009 Share Posted October 28, 2009 You could do: In your .htaccess: php_value upload_max_filesize 70M php_value post_max_size 70M or using php's ini_set: <?php ini_set('max_upload_filesize', 73400320); ?> Change the values to your needs. Quote Link to comment Share on other sites More sharing options...
davegfx Posted October 28, 2009 Author Share Posted October 28, 2009 So, how exactly do i access this? Do you have shell access to your server or are you on shared hosting? It's shared so does that mean I don't have access? In cpanel, there is a setting called PHP CONFIGURATION but it says "only the server administrator can change these settings" You could do: In your .htaccess: php_value upload_max_filesize 70M php_value post_max_size 70M I tried this but ended up with the following error when the site reloaded: "he server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, webmaster@collingwoodmanagement.ca and inform them of the time the error occurred, and anything you might have done that may have caused the error. More information about this error may be available in the server error log. Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request. " I will try the route suggested by taquitosensei now and see what happens. Quote Link to comment Share on other sites More sharing options...
keldorn Posted October 28, 2009 Share Posted October 28, 2009 To answer your question, Log into root via SSH with Putty (If on windows), then type. nano /usr/local/lib/php.ini Quote Link to comment Share on other sites More sharing options...
davegfx Posted October 28, 2009 Author Share Posted October 28, 2009 To answer your question, Log into root via SSH with Putty (If on windows), then type. nano /usr/local/lib/php.ini Nah, on Mac, any other suggestions? Quote Link to comment Share on other sites More sharing options...
trq Posted October 28, 2009 Share Posted October 28, 2009 The above instructions would be only of use if you had shell access. See here for your only real option. Quote Link to comment Share on other sites More sharing options...
davegfx Posted October 28, 2009 Author Share Posted October 28, 2009 Sorry thorpe, when i click the link i go to this. Can you confirm thats what you meant? You could do: In your .htaccess: php_value upload_max_filesize 70M php_value post_max_size 70M or using php's ini_set: <?php ini_set('max_upload_filesize', 73400320); ?> Change the values to your needs. Quote Link to comment Share on other sites More sharing options...
trq Posted October 28, 2009 Share Posted October 28, 2009 That is indeed the reply I linked to. Quote Link to comment Share on other sites More sharing options...
keldorn Posted October 28, 2009 Share Posted October 28, 2009 To answer your question, Log into root via SSH with Putty (If on windows), then type. nano /usr/local/lib/php.ini Nah, on Mac, any other suggestions? Well you would have to find a similar program for mac that can emulate the shell login. Quote Link to comment Share on other sites More sharing options...
trq Posted October 28, 2009 Share Posted October 28, 2009 To answer your question, Log into root via SSH with Putty (If on windows), then type. nano /usr/local/lib/php.ini Nah, on Mac, any other suggestions? Well you would have to find a similar program for mac that can emulate the shell login. Bash is mac's default shell, point is, the op doesn't have shell access. Quote Link to comment Share on other sites More sharing options...
Falanas Posted October 28, 2009 Share Posted October 28, 2009 If you areusing wampserver, go to wampserver icon on the taskbar - down there. Left-click on it. Click on config files then you will see php.ini. All the best. Quote Link to comment Share on other sites More sharing options...
davegfx Posted October 30, 2009 Author Share Posted October 30, 2009 Hi guys Just an update and thanks for all the help. I managed to fix the error by uploading a php.ini file to my root - which in turn overwrote the factory settings. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.