Apache2 + PHP5-FPM:保存操作错误500

时间:2016-10-25 07:19:40

标签: php linux apache vagrant debian

我有一个我无法解决的错误(显然否则我不会在这里)

有关环境的一些信息:

  • OS:Debian 8.0(jessie)
  • Apache:2.4.10(以mpm_event模式)
  • PHP:5.6.26(fpm-fcgi)
  • MySQL:5.5.52
  • SQLite3:3.8.7.1

Apache配置(mod-fastcgi):

<IfModule mod_fastcgi.c>
    AddHandler php5.fcgi .php
    Action php5.fcgi /php5.fcgi
    Alias /php5.fcgi /usr/lib/cgi-bin/php5.fcgi
    FastCgiExternalServer /usr/lib/cgi-bin/php5.fcgi -socket /var/run/php5-fpm.sock -pass-header Authorization -idle-timeout 3600
    <Directory /usr/lib/cgi-bin>
       Require all granted
    </Directory>
</IfModule>

php-fpm config:

listen = /var/run/php5-fpm.sock
user = www-data
group = www-data
pm = dynamic
pm.max_children = 10
pm.start_servers = 2
pm.min_spare_servers = 2
pm.max_spare_servers = 5

php modules:

[PHP Modules]
bcmath
bz2
calendar
cgi-fcgi
Core
ctype
curl
date
dba
dom
ereg
exif
fileinfo
filter
ftp
gd
gettext
hash
iconv
json
libxml
mbstring
mcrypt
memcached
mhash
mysql
mysqli
openssl
pcre
PDO
pdo_mysql
pdo_sqlite
Phar
posix
readline
Reflection
session
shmop
SimpleXML
soap
sockets
SPL
sqlite3
ssh2
standard
sysvmsg
sysvsem
sysvshm
tokenizer
wddx
xdebug
xml
xmlreader
xmlwriter
xsl
Zend OPcache
zip
zlib

[Zend Modules]
Xdebug
Zend OPcache

我试图:

  • 增加max_children,min_spare_servers,max_spare_servers,max_request。
  • 更改idle_timeout(更高或更慢)
  • 增加php memory_limit
  • 将request_terminate_timeout定义为30s

无事可做......

只有在我尝试保存数据时才会出现错误。

我不知道我能为解决这个问题做些什么......

在apache错误日志中出现此错误:

[Fri Oct 21 08:43:18.998830 2016] [fastcgi:error] [pid 5332:tid 140321069459200] (104)Connection reset by peer: [client 192.168.33.1:57469] FastCGI: comm with server "/usr/lib/cgi-bin/php5.fcgi" aborted: read failed, referer: http://project.local/myaccount/index
[Fri Oct 21 08:43:18.998886 2016] [fastcgi:error] [pid 5332:tid 140321069459200] [client 192.168.33.1:57469] FastCGI: incomplete headers (0 bytes) received from server "/usr/lib/cgi-bin/php5.fcgi", referer: http://project.local/myaccount/index

在php-fpm日志中我有这个:

[21-Oct-2016 08:43:18] WARNING: [pool www] child 29874 exited with code 1 after 9352.926672 seconds from start
[21-Oct-2016 08:43:18] NOTICE: [pool www] child 5815 started

在我的流浪汉中,opcache是​​禁用的(当我启用它时,错误似乎消失了),但在集成和生产服务器中我有相同的错误但是启用了opcache。

我的流浪者(在开发环境中),集成服务器和生产服务器中都有同样的错误。

我找不到任何解决方案......

帮助plz:)

0 个答案:

没有答案