Articles of php fpm

无法使用chroot wordpress获取静态文件

我试图用php-fpm和mysqlconfigurationchroot。 我设法解决,但是当我试图达到除index.php以外的文件(如CSS,PNG等),它不断给404。 但是,当我禁用chroot时,它工作%100正确。 我的目录结构是这样的; /var/www #my chroot directory /var/www/tmp #related pid and sock files /var/www/log #related log directory /var/www/public_html #wordpress directory 而我的nginxconfiguration是这样的; server { listen 80; ## listen for ipv4; this line is default and implied root /public_html; index index.php; server_name _; location / { index index.php; } if (!-e $request_filename) { rewrite ^.*$ /index.php […]

Django(uWSGI)和php(fastcgi)NGINX

我是configuration服务器的新手,我有问题让PHP使用我的django应用程序在nginx上使用UWSGI。 Django的伟大作品使用uwsgi和PHP伟大的时候,我删除了Django网站的conf,但是当我一起使用Django和PHP一起PHP文件不工作(浏览器只是下载它们),任何想法(请具体我是新来的东东)? 我接受build议,在这里变得有点绝望。 谢谢 这里是我的nginx的django站点conf文件: # mysite_nginx.conf #################### # the upstream component nginx needs to connect to upstream django { # server unix:///home/appdeploy/uwsgi-tutorial/mysite/mysite.sock; # for a file socket server 127.0.0.1:8001; # for a web port socket (we'll use this first) } # configuration of the server server { # the port your site will be […]

在虚拟主机中使用mod fastcgi为apache2.2设置HHVM

我想设置一个运行HHVM的虚拟主机来尝试新的“Facebook Hack”语言。 我遵循Apache 2.2的说明: https : //github.com/facebook/hhvm/wiki/FastCGI 目前hhvm是这样运行的: hhvm -ms -vServer.Type = fastcgi -vServer.Port = 9001 而我的虚拟主机configuration是: <VirtualHost *:80> ServerName example.com ServerAlias www.example.com DocumentRoot /home/tijmen/sites/example.com php_value engine off #<IfModule fastcgi_module> Alias /hhvm.fastcgi /home/tijmen/sites/example.com/hhvm.fastcgi FastCGIExternalServer /home/tijmen/sites/example.com/hhvm.fastcgi -host 127.0.0.1:9001 <Directory "/home/tijmen/sites/example.com/"> <Files "hhvm.fastcgi"> Order deny,allow </Files> </Directory> RemoveHandler .php AddHandler hhvm-hack-extension .hh AddHandler hhvm-php-extension .php Action hhvm-hack-extension […]

nginx重写tweetnest的规则

最近我把我的最后一个Apache迁移到了nginx(+ php-fpm)。 除了tweetnest月份链接(tweetnest / yyyy / mm)以外,一切正常。 tweetnest提供的Apache重写规则( .htaccess )工作正常OOTB Apache的.htaccess RewriteEngine On RewriteBase /tweetnest RewriteRule ^sort/?$ ./sort.php [L] RewriteRule ^favorites/?$ ./favorites.php [L] RewriteRule ^search/?$ ./search.php [L] RewriteRule ^([0-9]+)/([0-9]+)/?$ ./month.php?y=$1&m=$2 RewriteRule ^([0-9]+)/([0-9]+)/([0-9]+)/?$ ./day.php?y=$1&m=$2&d=$3 但是,对于nginx没有例子。 我设法find这个https://github.com/graulund/tweetnest/issues/37 但这是CNAME,与我的tweetnest用例 – > domain.com/tweetnest不完全一样。 我尝试了各种组合,但没有得到它的工作。 目前我在nginx vhostconfiguration文件中使用下面的块 # tweetnest rewrite rules location ~ /tweetnest { root /var/www/path; rewrite ^/sort/?$ sort.php […]

试图find瓶颈… 6万现场访客

我知道这很难,但我愿意尝试问答路线。 我有一个Wordpress网站,目前在该网站上有60,000个访问者。 我使用EC2 m3.xlarge , php/php-fpm 5.5.10 , nginx 1.4.7 , php-apc 。 对于caching插件,我正在使用WP-Super-Cache。 我注意到一个非常缓慢的响应时间,大量的502错误,再加上…我有像这些在我的nginx日志中的吨错误: 10319#0: *57132 connect() to unix:/tmp/php5-fpm.sock failed (11: Resource temporarily unavailable) while connecting to upstream 我很困惑瓶颈是什么… 我有4个CPU核心,每个在约15%…总负载平均.85-1常数 〜4GB使用的16GB RDS占用60%CPU,读取和写入延迟低 对于我的设置…基本上用尽了我所有的知识+ Google的小时… 100个max_children for php-fpm 4096积压&somaxconn nginx:worker_rlimit_nofile 200000 nginx:worker_processes 8 nginx:worker_connections 32768 我不知道其中的一些是太高还是太低,我尽量调整它以尽我所能 我甚至不知道如何find问题。 当我通过缓慢的日志来看,这只是很多随机的东西,可能是因为一切都变得缓慢…不只是一件事。

连接超时在Web服务器上?

我的服务器当前正在超时,当我尝试查看该网站。 我试过重新启动nginx。 我试过重启php-fpm。 我试过重新启动MySQL。 没有骰子。 我尝试重新启动盒子。 还没有骰子。 我最近没有应用任何更新。 我应该在哪里寻找/我应该运行什么testing来解决这个问题? nginx错误日志充满了: “上游超时(110:连接超时)连接到上游” 静态文件(.jpeg,.html等)似乎工作正常,所以这是一个PHP的问题,我假设。 编辑:修正,见下面的评论

Nginx别名或重写Horde Groupware ActiveSync URL不会处理rpc.php文件

我试图用Nginxbuild立一个部落群件。 web界面的工作原理,但我没有得到的ActiveSync特定的URL工作。 部落维基解释了如何在这里使用Apache Webserver。 我的问题是,我设置了一个重写(尝试别名)以通过/horde/rpc.php脚本来提供位置/horde/Microsoft-Server-ActiveSync 。 但是用我当前的configuration,nginx重写并返回一个200状态码。 但它看起来像PHP文件没有执行。 如果我直接去/horde/rpc.php它打开login对话框。 所以这似乎是正确的。 首先,我在Google上search这个问题,但找不到一个可行的解决scheme。 所以现在我想问你。 configuration应该允许通过URL /horde/Microsoft-Server-ActiveSync访问ActiveSync部分。 部落的web界面已经可以通过/horde访问。 我的configuration如下所示: 默认的ssl.conf server { listen 443 ssl; ssl on; ssl_certificate /opt/nginx/conf/certs/server.crt; ssl_certificate_key /opt/nginx/conf/certs/server.key; server_name example.com; index index.html index.php; root /var/www; include sites-available/horde.conf; } horde.conf location /horde { rewrite_log on; rewrite ^/horde/Microsoft-Server-ActiveSync(.*)$ /horde/rpc.php$1 last; try_files $uri $uri/ /rampage.php?$args; location ~ \.php$ […]

编译PHP的问题make:*** 错误1

这是我得到的消息: Undefined symbols for architecture x86_64: "_iconv_close", referenced from: _zif_iconv_substr in iconv.o _zif_iconv_mime_encode in iconv.o _php_iconv_string in iconv.o __php_iconv_strlen in iconv.o __php_iconv_strpos in iconv.o __php_iconv_mime_decode in iconv.o _php_iconv_stream_filter_cleanup in iconv.o … "_iconv_open", referenced from: _zif_iconv_substr in iconv.o _zif_iconv_mime_encode in iconv.o _php_iconv_string in iconv.o __php_iconv_strlen in iconv.o __php_iconv_strpos in iconv.o __php_iconv_mime_decode in iconv.o _php_iconv_stream_filter_factory_create in iconv.o […]

重新启动后的PHP-FPM用户权限

出于某种原因,我重新启动php-fpm后台程序后,使用PHP(Twig模板caching)生成的文件无法再被PHP访问。 我想这是关于php-fpm用户/组(_www / _www)。 Unable to write in the cache directory (/Users/iber/Work/Projects/Work/app/public/assets/compile/3f/87) 唯一的解决办法是完全删除文件夹内容并重新加载Twig的页面来重新编译文件。 compile目录有0777权限。 php-fpm(v5.5)通过自制软件安装。 这里可能是什么问题?

在yum上更新时,防止php-fpm安装默认的conf文件

每当我更新我的服务器上的php-fpm,它就会安装一个新的www.conf文件,它会干扰我现有的configuration。 有没有办法阻止它每次被覆盖?