fastcgi

Random PHP FastCGI / Connection reset by peer / incomplete headers

寵の児 提交于 2020-01-31 03:30:06
问题 I've been having random 500 Internal Server errors on my PHP / MySQL based sites on various shared hosts. I'm using PHP 5.2.17 through CGI/FastCGI on a shared Linux server. When I look in the logs, I see this: [error] [client 75.71.176.224] (104)Connection reset by peer: FastCGI: comm with server "/dev/shm/blackmou-php.fcgi" aborted: read failed, referer: ... [error] [client 75.71.176.224] FastCGI: incomplete headers (0 bytes) received from server "/dev/shm/blackmou-php.fcgi", referer: ...

DNS not working in PHP (but does in general)

旧城冷巷雨未停 提交于 2020-01-24 17:23:05
问题 The following script: <?php $dnsrecs = dns_get_record('google.com'); foreach($dnsrecs as $dnsrec){ foreach($dnsrec as $label=>$val){ echo $label.':'. $val . '<br>'; } } echo file_get_contents('https://google.com'); ?> Gives back a list of DNS records, but ends up failing on the file_get_contents, although phpinfo() says: allow_url_fopen On On allow_url_include Off With the following error: PHP message: PHP Warning: file_get_contents(https://google.com): failed to open stream: php_network

Perl benchmark between FCGI and PSGI

怎甘沉沦 提交于 2020-01-24 17:19:25
问题 What I know about the FCGI protocol is, the first time the application is called, it loads it into memory, run it, return the response to the server, finish the response but does not end the application, it keeps it running in memory, then next requests will use this compiled in memory copy of the application to process the request. Reading about the PSGI protocol, it seems to be working the same way. My question is, is my assumption correct, they are the same regarding the application speed

problems using mod_headers with php-fpm/mod_fastcgi

落花浮王杯 提交于 2020-01-22 14:14:45
问题 I'm trying to add HSTS headers to every response, across my app. My first thought was to use mod_headers — I placed this directive in an .htaccess file at the documentroot: Header set Strict-Transport-Security "max-age=7776000" This works fine on my local setup using Apache 2.2 and mod_php. All resources respond with the appropriate HSTS header. My deployment environment uses Apache 2.2 and mod_fastcgi and the above technique works for any resource except php files. Another SO question had a

.user.ini file only works 2 level of folder

微笑、不失礼 提交于 2020-01-14 13:58:09
问题 I have Apache with PHP installed (on Windows) and run as fastCGI. My php.ini has this value, upload_max_filesize = 2M. I override this value in .user.ini file to 10M. Every thing works fine until the folder level is deeper than 2 level. For example: If I put .user.ini file into www root. http://localhost/ -> ini_get('upload_max_filesize') result is 10M http://localhost/test -> ini_get('upload_max_filesize') result is 10M http://localhost/test/lv2 -> ini_get('upload_max_filesize') result is

.user.ini file only works 2 level of folder

耗尽温柔 提交于 2020-01-14 13:58:04
问题 I have Apache with PHP installed (on Windows) and run as fastCGI. My php.ini has this value, upload_max_filesize = 2M. I override this value in .user.ini file to 10M. Every thing works fine until the folder level is deeper than 2 level. For example: If I put .user.ini file into www root. http://localhost/ -> ini_get('upload_max_filesize') result is 10M http://localhost/test -> ini_get('upload_max_filesize') result is 10M http://localhost/test/lv2 -> ini_get('upload_max_filesize') result is

Apache PHP5-FPM connection reset by peer

三世轮回 提交于 2020-01-13 12:06:31
问题 Things like this keep popping up in my apache logs. How can I go about debugging this and/or preventing this in the future: (104)Connection reset by peer: FastCGI: comm with server "/var/www/php5.external" aborted: read failed FastCGI: incomplete headers (0 bytes) received from server "/var/www/php5.external", (4)Interrupted system call: FastCGI: comm with server "/var/www/php5.external" aborted: select() failed 回答1: In relation to your "select() failed" error and possibly the others, check

Apache PHP5-FPM connection reset by peer

◇◆丶佛笑我妖孽 提交于 2020-01-13 12:04:27
问题 Things like this keep popping up in my apache logs. How can I go about debugging this and/or preventing this in the future: (104)Connection reset by peer: FastCGI: comm with server "/var/www/php5.external" aborted: read failed FastCGI: incomplete headers (0 bytes) received from server "/var/www/php5.external", (4)Interrupted system call: FastCGI: comm with server "/var/www/php5.external" aborted: select() failed 回答1: In relation to your "select() failed" error and possibly the others, check

Apache PHP5-FPM connection reset by peer

人走茶凉 提交于 2020-01-13 12:03:06
问题 Things like this keep popping up in my apache logs. How can I go about debugging this and/or preventing this in the future: (104)Connection reset by peer: FastCGI: comm with server "/var/www/php5.external" aborted: read failed FastCGI: incomplete headers (0 bytes) received from server "/var/www/php5.external", (4)Interrupted system call: FastCGI: comm with server "/var/www/php5.external" aborted: select() failed 回答1: In relation to your "select() failed" error and possibly the others, check

fastcgi, cherrypy, and python

末鹿安然 提交于 2020-01-13 10:33:30
问题 So I'm trying to do more web development in python, and I've picked cherrypy, hosted by lighttpd w/ fastcgi. But my question is a very basic one: why do I need to restart lighttpd (or apache) every time I change my application code, or the code for an underlying library? I realize this question extends from a basic mis(i.e. poor)understanding of the fastcgi model, so I'm open to any schooling here, but I'm used to just changing a PHP file and it showing up, versus having to bounce the web