2

This is driving me crazy. I have a php file upload script hosted on CPanel-controlled web hosting, whenever I try to upload files larger than 3-4 MB I get a HTTP 500 Internal Server Error. Now, I did create a php.ini file in my public_html directory and did specify:

upload_max_filesize = 250M
post_max_size = 250M

and indeed, when I execute phpinfo() I see that both of these values are set and active. When I run the exact same script on my local wamp configuration it works.

I'm out of options here. What could it be? Memory exhaustion? Highly doubt it.

EDIT:

Weird: when I go to PHP Configuration in CPanel, upload_max_filesize is set to 2MB even though phpinfo() shows 250MB. So apparently it is blocked server-wide in WHM? Why does it say otherwise in phpinfo?

astralmaster
  • 2,344
  • 11
  • 50
  • 84
  • Cpanel has a log viewer if I recall correctly. Check it out. – Álvaro González Dec 16 '13 at 17:52
  • and it shows nothing, even though it is active. – astralmaster Dec 16 '13 at 17:53
  • I assume you mean the "Error Log" feature. – astralmaster Dec 16 '13 at 17:53
  • Yes... Apache normally displays the exact error on its error log. If that's not the case, it's possible that PHP is not configured to log/display error messages. – Álvaro González Dec 16 '13 at 17:54
  • It does show some irrelevant logs, so presumably it is active. Nothing related to this particular case though – astralmaster Dec 16 '13 at 17:58
  • See http://stackoverflow.com/questions/2992376/how-to-set-upload-max-filesize-in-htaccess - you may be able to override with .htaccess - also 250M is kind of big, try something a bit lower. – tremor Dec 16 '13 at 18:16
  • Every 500 should leave a detailed error message in the log, check it out – Pekka Dec 16 '13 at 18:18
  • @tremor - tried everything suggested there, didn't work - same HTTP 500. – astralmaster Dec 16 '13 at 18:22
  • It *must* somewhere - if not in the logs you're seeing, then somewhere else. Might be worth asking the hosting company – Pekka Dec 16 '13 at 18:24
  • Couple questions: 1. What OS is your site running, NIX or Win? 2. Is your site using a CMS like Wordpress or Drupal (those often have their own settings independant of cpanel and php.ini? 3. Who is your host, they may have some FAQs or info in their support that could help? – tremor Dec 16 '13 at 18:28
  • @tremor 1. Nix, 2. None, just one .php file with simple upload code in it. 3. Local ISP, I am trying to contact them for the past several hours with no luck. – astralmaster Dec 16 '13 at 19:10
  • @astralmaster - 1 more question, probably should have asked this one first... is the directory in which your files are being saved into on the server set to WRITEABLE? – tremor Dec 16 '13 at 19:15

1 Answers1

2

Looks like this may have been answered on stack already:

You need to increase FcgidMaxRequestLen in httpd.conf file

use something like

FcgidMaxRequestLen 67108864

php upload and internal server error

Community
  • 1
  • 1
tremor
  • 3,068
  • 19
  • 37
  • Unfortunately I don't have access to httpd.conf file. – astralmaster Dec 17 '13 at 07:40
  • Besides, I have checked and - I am able to upload files of max. 2 MB. and I can clearly see that limitation in CPanel PHP Configuration. So I doubt it has something to do with Apache. – astralmaster Dec 17 '13 at 07:41