繁体   English   中英

php上传和内部服务器错误

[英]php upload and internal server error

我正在使用带有php的html表单将数据上传到mysql。

当我在我的笔记本电脑(wamp)上使用它时,表单工作正常但是当我在我的专用服务器(ispconfig)上传网站时出现此错误

内部服务器错误
服务器遇到内部错误或配置错误,无法完成您的请求。

我试着改变php.ini的值

post_max_size  64M
upload_max_filesize 64M
max_input_time 3000
max_execution_time 3000

而apache中的那些也在

memory_limit 96M
post_max_size 64M
upload_max_filesize 64M

但我仍然无法上传。

谢谢您阅读此篇。

您需要在httpd.conf文件中增加FcgidMaxRequestLen

使用类似的东西

FcgidMaxRequestLen 67108864

来自FcgidMaxRequestLen指令

警告

在2.3.6之前,这个默认为1GB。 早期版本的大多数用户应使用此指令设置更合理的限制。

接受的答案是正确的。 更具体地说,您需要在httpd.conf文件中添加代码:

# Work around annoying fcgid limitations
<IfModule mod_fcgid.c>
  # 20MB should be enough
  MaxRequestLen 20000000
</IfModule>

你可以在这里查看完整的文章: http//pivica.me/blog/500-internal-server-error-while-uploading-files-bigger-then-100kb-modfcgid-problem

请注意,php / ajax处理脚本中的语法错误可能会报告为“内部服务器错误”。

例如,我正在使用Ravishanker Kusuma的jQuery上传文件插件 ,并收到此消息。

原来它只是一个缺失的)在我的代码中的一个(未使用的)函数中,由AJAX脚本指定的PHP处理器文件。 上传文件时,将调用此脚本,脚本将在未使用的函数内部中断,这是它将报告的错误。

FWIW

以上解决方案都不适合我。 对于使用Plesk Pannel的CentOS用户,请按照以下步骤操作

在模板中更改此值

#grep -ir FcgidMaxRequestLen /usr/local/psa/admin/conf/templates/default/domain/domainVirtualHost.php FcgidMaxRequestLen 16777216

#sed -i's / FcgidMaxRequestLen 16777216 / FcgidMaxRequestLen 1073741824 / g'/usr/local/psa/admin/conf/templates/default/domain/domainVirtualHost.php

#grep -ir FcgidMaxRequestLen /usr/local/psa/admin/conf/templates/default/domain/domainVirtualHost.php FcgidMaxRequestLen 1073741824

重建虚拟主机配置。

#/ usr / local / psa / admin / bin / httpdmng --reconfigure-all#/ usr / local / psa / admin / bin / httpdmng --reconfigure-server

https://support.plesk.com/hc/en-us/articles/213955145-Unable-to-upload-large-files-via-PHP-HTTP-request-length-exceeds-MaxRequestLen

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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