我想从Apache 2.2移动到Apache 2.4,但是没有mod_fastcgi ,推荐的升级path是mod_proxy_fcgi 但是我不知道如何完成以下内容: <IfModule mod_fastcgi.c> Alias /php5.fcgi /usr/local/www/fastcgi/php5.fcgi FastCGIExternalServer /usr/local/www/fastcgi/php5.fcgi -flush -host 127.0.0.1:9000 AddType application/x-httpd-fastphp5 .php Action application/x-httpd-fastphp5 /php5.fcgi <Directory "/usr/local/www/fastcgi/"> Order deny,allow Deny from all <Files "php5.fcgi"> Order allow,deny Allow from all </Files> </Directory> </IfModule> 这允许所有的虚拟主机和所有需要PHP使用一个PHP-FPM进程,新的ProxyPassMatch要求我为每个虚拟主机设置一个单独的条目,这是耗时且容易出错的… ProxyPassMatch ^/(.*\.php(/.*)?)$ fcgi://127.0.0.1:9000/path/to/vhost/$1 现在我已经恢复到了Apache 2.2,但我很想find解决这个问题的方法。
我试图定期使用Cron重新启动PHP5-FPM,但我没有运气。 我可以手动重新启动,没有问题,使用service php5-fpm restart或/usr/sbin/service php5-fpm restart 但是,当我使用相同的命令(包括使用/usr/sbin/service的完整path)时,什么都不会发生。 cronjob确实运行(正如我从syslog中看到的那样),但是PHP5-FPM不会重新启动。 我的root用户的crontab的相关行如下所示: * * * * * /usr/sbin/service php5-fpm restart 我已经确认了which servicepath确实是/usr/sbin/service 。 为什么这不起作用?
我们最近升级到了Apache 2.4,并希望摆脱2.2版本中的Prefork + mpm-itk设置。 问题是,我们主持了大约60个领域,而我们控制着PHP的发展,我们仍然希望每个领域都是孤立的,因为多年来,我们有很多不同的开发人员,插件等等。 我知道我们必须为每个域创build一个FPM池,但是我们如何处理它将创build的所有进程呢? 有没有人有任何build议,他们如何处理和限制这一点,而不会造成稳定性问题。
在我的Web服务器上,为了安全起见,我将chroot更改为仅访问我的网站主目录的根目录,而不是其他文件系统的根目录。 不过,我注意到,自从这个改变以后,我似乎无法在PHP中识别OpenSSL。 试图从我的服务器发送邮件,我得到以下错误: Warning: stream_socket_enable_crypto(): SSL: Success in /public/lib/mailer/class.smtp.php on line 274 2014-05-04 23:32:29 CLIENT -> SERVER: QUIT 2014-05-04 23:32:29 SERVER -> CLIENT: 2014-05-04 23:32:29 SMTP ERROR: QUIT command failed: SMTP connect() failed OpenSSL文件要做什么我需要在chroot中包含脚本才能运行脚本? 有没有其他的方式可以让PHP访问OpenSSL而不改变我的chroot? 任何帮助,将不胜感激。 谢谢。
我有3个域名,1个服务器和1个IPv4和1ipv6。 我已经创build了一个logging到我的ipv4(我现在不使用IPv6)。 我的3个网站使用Wordpress。 我为一个域configuration了Nginx和php-fpm。 /etc/nginx/conf.d/php5-fpm: upstream php5-fpm-sock { server unix:/var/run/php5-fpm.sock; } /etc/nginx/sites-available/domain.com.conf: server { listen 80; server_name domain.com; root /var/www/domain.com; index index.php index.html; #charset koi8-r; access_log /var/log/nginx/domain.com.access.log; error_log /var/log/nginx/domain.com.error.log; #include global/common.conf; #include global/wordpress.conf; location / { try_files $uri $uri/ /index.php?$args; } location ~ \.php$ { try_files $uri =404; fastcgi_index index.php; fastcgi_pass php5-fpm-sock; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; […]
我遇到了PHP-FPM和mysql的问题。 当我需要处理一个input文件时,它会为每一行产生几个select/插入/更新,它会在大约60秒后停止,消息Lost connection to the server或者Mysql server has gone away 。 查询很简单,只需更新几个字段,没有BLOB,每个小于1KB。 禁用MOD_PHP的PHP-FPM解决了这个问题 – 但它不是ini设置问题,因为它们共享相同的ini文件。 原来是这个问题build议的request_slowlog_timeout 。 据我所知,这是没有意义的,因为它不应该终止或干扰脚本执行 我的问题是,这是PHP-FPM的错误还是只是我失去了一些东西? 服务器configuration: Percona Mysql 5.5.19,Apache / 2.2.23(Unix)mod_ssl / 2.2.23 OpenSSL / 1.0.0-fips域名服务器mod_fastcgi / 2.4.6 mod_perl / 2.0.5 Perl / v5.10.1,PHP 5.3.24
我的服务器有以下规格 CPU: 6 Cores Intel(R) Xeon(R) CPU E5-2650 v2 @ 2.60GHz RAM: 32 GB 我有一个nginx + php-fpm的问题。 由于不明原因,他们占用了太多的资源。 即使我重新启动nginx + php-fpm启动过程将使用许多资源。 我的nginxconfiguration如下: user nginx; worker_processes auto; error_log /var/log/nginx/error.log warn; pid /var/run/nginx.pid; worker_rlimit_nofile 300000; events { worker_connections 6000; use epoll; } http { include /etc/nginx/mime.types; default_type application/octet-stream; log_format main '$remote_addr – $remote_user [$time_local] "$request" ' '$status […]
我正在虚拟服务器上运行一个nginx + php-fpm + mysql,这个服务器有8个内核和16G RAM。我的应用程序是一个简单的API提供程序服务器,它根据请求返回从mysql数据库生成的JSON。 数据集很简单,只有几千字节大。 但是,每秒1000k用户的高负载。 简单的请求需要10 sekonds !!! ..这是很长的。 我认为它的MYSQL,导致缓慢的反应。 因为我有一个testing数据库 – 对testing数据库的相同请求需要1sek。 可能是我需要调整我的MySQLconfiguration,使请求更快? 我正在使用mysqli和绑定技术来产生与PHP输出, 这里是我的configuration: /etc/nginx/nginx.conf # For more information on configuration, see: # * Official English Documentation: http://nginx.org/en/docs/ # * Official Russian Documentation: http://nginx.org/ru/docs/ user nginx; worker_processes 8; error_log /var/log/nginx/error.log; #error_log /var/log/nginx/error.log notice; #error_log /var/log/nginx/error.log info; pid /var/run/nginx.pid; events { […]
我正在使用cPhalcon编写Web应用程序。 我testing的机器是严格的开发,所以没有任何来自外部的stream量。 问题是,当我试图做 $this->flashSession->getMessages(); 我总是这样的错误: [Fri Jul 04 00:49:44 2014] [error] [client xxxxxx] (104)Connection reset by peer: FastCGI: comm with server "/var/www/…/cgi-bin/php5-fcgi-*-80-domain.com" aborted: read failed [Fri Jul 04 00:49:44 2014] [error] [client xxxxxx] FastCGI: incomplete headers (0 bytes) received from server "/var/www/…/cgi-bin/php5-fcgi-*-80-domain.com" [Fri Jul 04 00:49:44 2014] [error] [client xxxxxx] client denied by server configuration: […]
我有一个在debian上运行的nginx。 Nginx将每2分钟刷新一次以获取新创build的虚拟主机。 过了一段时间,新的虚拟主机不再加载,但老的虚拟主机仍然由nginx提供服务 在我的nginx错误日志中,我可以find多个错误。 2014/08/10 06:30:05 [alert] 27891#0: epoll_ctl(1, 4) failed (9: Bad file descriptor) 2014/08/10 06:30:05 [alert] 27892#0: close() channel failed (9: Bad file descriptor) 2014/08/10 06:30:05 [alert] 27893#0: close() channel failed (9: Bad file descriptor) 2014/08/10 06:30:19 [alert] 4806#0: worker process 27891 exited with fatal code 2 and can not be respawn 2014/08/10 […]