简体   繁体   中英

php image upload 500 internal server error

There is an error when uploading an image on server.It shows 500 internal server error.If i upload small image than everything is ok but when upload large size image there is above error. This is working on local but error on live server.

Check you upload_max_filesize in php.ini

Echo ini_get ("upload_max_filesize");

Also, read this: http://www.radinks.com/upload/config.php

it was:

mod_fcgid: HTTP request length 131308 (so far) exceeds MaxRequestLen (131072)

so I've changed the limit by adding this to global httpd.conf (from cPanel):

MaxRequestLen 15728640

and everything is running fine....

  1. Open your php.ini file
  2. Change memory_limit=128M to memory_limit=256M
  3. Press ctrl+s to save the changes
  4. Restart your Apache or Nginx Server
  5. Now upload any image file of any size
  6. If the error still persists then Repeat from Step-1 above
  7. Keep increasing the memory_limit till the server accepts big files. but dont forget to save the changes and restarting of server or else it will not work.

check this allowed time to execute your script using below,

echo $maxExeTime = ini_get('max_execution_time');

and check how much time your script takes and increase the time execution before execution of your file upload script to increase it you can use below code

ini_set('max_execution_time', '0');

检查您的php.ini文件

upload_max_filesize

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM