Articles of php fpm

Vagrant,nginx 404 – 在stderr中发送的fastcgi无法打开主脚本

谷歌很多,并没有find解决scheme。 在这里find了几个接受的答案在stackoverflow,但他们没有帮助我。 我正在使用stream浪者发展,或者至less试图使用它。 有没有安装它的问题,但是当我尝试运行一个网站,我越来越404,我的猜测是,这是更多的Nginx问题,而不是stream浪问题。 我已经添加到我的Windows主机127.0.0.1 lara.dev 这是我的nginx网站configuration如下: server { listen 80; server_name lara.dev; root C:/xampp/htdocs/lara/public; index index.html index.htm index.php; charset utf-8; location / { try_files $uri $uri/ /index.php?$query_string; } location = /favicon.ico { access_log off; log_not_found off; } location = /robots.txt { access_log off; log_not_found off; } access_log off; error_log /var/log/nginx/lara.dev-error.log error; error_page 404 /index.php; […]

在同一个Nginx服务器上运行PHP和Node.js

是否可以在同一个Nginx服务器和VPS上运行PHP和Node.js? 我已经设法使nginx作为node.js的反向代理,但我的问题是如何与PHP一起运行它? 我希望node.mydomain.com在子域上运行,让我说node.mydomain.com而我的PHP应用程序运行在mydomain.com 。

如何为php 5.6和apache 2.2configurationphp-fpm

我通过使用repo从我的centos 6.6安装了php 5.6,apache 2.2和php-fpm https://webtatic.com/packages/php56/ 我遵循这个指令abd尝试使php-fpm工作http://www.garron.me/en/linux/apache-mpm-worker-php-fpm-mysql-centos.html 但是这个教程有些不同之处: fcgi模块的conf文件位置在/etc/httpd/conf.d/fcgid.conf中 在这样的位置没有/ var / lib / cgi-bin / php5-fcgi 在这个位置没有/var/run/php5-fpm.sock fcgid.conf # This is the Apache server configuration file for providing FastCGI support # through mod_fcgid # # Documentation is available at # http://httpd.apache.org/mod_fcgid/mod/mod_fcgid.html LoadModule fcgid_module modules/mod_fcgid.so # Use FastCGI to process .fcg .fcgi & .fpl scripts AddHandler […]

OPcache打破phpBB注册

我不知道发生了什么,但是当用户试图在我的phpBB论坛上注册自己时,nginx会抛出502 Bad gateway ,但是如果我禁用OPcache,一切正常。 这是来自php-fpm的错误日志: WARNING: [pool www] child 14677 exited on signal 11 (SIGSEGV) after 87782.968736 seconds from start 这是nginx错误日志: [error] 14099#0: *78984 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: xxxx, server: x, request: "POST /ucp.php?mode=register HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "x.tld", referrer: "https://x.tld/ucp.php?mode=register" 在我的所有主机上启用Pagespeed以及清漆。 Vhostconfiguration: […] # […]

在nginx中使用fastcgi_split_path_info作为userdir

我试图在我的服务器上执行一个PHP文件在url /〜/ / / /~nik/t.php (实际文件在/home/nik/public_html/t.php )。 这是我的PHP设置的样子: location ~ ^/~(.+?)(/.*)\.php$ { alias /home/$1/public_html; # What should this regex be? fastcgi_split_path_info ^/~nik/(.+?\.php)(/.*)$; if (!-f $document_root$fastcgi_script_name) { return 404; } include fastcgi.conf; fastcgi_pass unix:/var/run/php5-fpm.sock; } 我一直得到一个404,当我回答return 404;条款的return 404; ,我可以看到错误: Unable to open primary script: /home/nik/public_html/~nik/t.php (No such file or directory) 你可以看到我的configuration有什么问题,或者指向我有关如何做到这一点的文档? 不幸的是,先进的正则expression式知识是configurationnginx的要求。

php-frm能让PHP运行得更快吗?

据我了解, php-fpm通过pipe理预先加载的PHP解释器进程的场,使得PHP页面响应更快,因此最终用户不会经历初始化PHP子系统的开销,但是一旦PHP页面开始执行,只要在“正规”的CGI下。 这有点像在mod_perl下运行一个Perl脚本 – 解释器没有运行得更快,因为它绑定到了web服务器可执行文件,它只是启动得更快。 我是对的,还是有一些微妙的事情发动机罩,使整体运行速度更快? 问的原因是我有一个PHP应用程序,我想定期运行(我每隔X秒运行一个“wget”的URL)。 我不担心响应时间,因为它的周期性,但我很困扰执行时间。

WordPress无法写入文件,尽pipe正确的文件权限

我无法自动安装插件或主题在我的新的WordPress的设置。 它给了我这个屏幕: 我相信这通常是由于wordpress目录上的写权限错误。 这些是我迄今为止所做的步骤: nginx在root用户下运行,在nginx用户下有工作进程: # ps -ef | grep nginx | head root 14197 1 0 07:46 ? 00:00:00 nginx: master process nginx nginx 14198 14197 0 07:46 ? 00:00:00 nginx: worker process PHP-FPM在root用户下运行,在nginx用户下有工作进程: # ps -ef | grep php-fpm | head root 14748 1 0 08:38 ? 00:00:00 php-fpm: master process (/etc/php-fpm.conf) nginx […]

更正安装在非根目录下的WordPress的nginx虚拟主机?

假设我的主域是example.com。 我在域上安装SSL,并且可以成功访问域。 我的首选版本是使用www,所以所有的请求将被redirect到https://www.example.com 。 这是我迄今为止所做的,并且在访问根域时效果很好。 # redirect HTTP to HTTPS server { listen 80; server_name example.com www.example.com; rewrite ^ https://$server_name$request_uri? permanent; } # SSL conf server { root /var/www/example.com; index index.html index.htm index.php; access_log /var/log/nginx/example.com.access.log; error_log /var/log/nginx/example.com.error.log; listen 443 ssl spdy; server_name example.com www.example.com; ssl_certificate /etc/ssl/example.com/certificate/join-cert.crt; ssl_certificate_key /etc/ssl/example.com/server-key/ssl.key; # Redirect non-www to www if ($host […]

Ubuntu上的SSL 12 LTS与Apache和PHP-FPM

在阅读了很多教程之后,我成功地在Ubuntu 12 LTS上成功运行了Apache MPM-Worker和PHP-FPM。 我为每个用户都有独立的池,一切都像一个魅力。 不过,我需要为其中一个域安装SSL。 我设法创build自签名证书只是为了获得安全的连接和运行。 我的问题是,我目前的设置,我将无法运行SSL的另一个域名,因为当重新加载Apache设置我得到一个错误(警告): [Sun Mar 15 16:52:59 2015] [warn]第21行的/etc/apache2/sites-enabled/www.my-site-name.com中的Alias指令可能永远不会匹配,因为它与早期的Alias重叠。 我的设置如下: /etc/apache2/conf.d/php5-fpm.conf <IfModule mod_fastcgi.c> AddHandler php5-fcgi .php Action php5-fcgi /php5-fcgi </IfModule> /etc/php5/fpm/pool.d/example.conf [example] user = example group = example listen = /tmp/php5-fpm-example.sock listen.owner = example listen.group = example listen.mode = 0660 /etc/apache2/sites-enabled/www.my-site-name.com <VirtualHost *:80> content goes here </VirtualHost> <IfModule mod_ssl.c> <VirtualHost […]

为什么这些网页被PHP处理?

我已经在Ubuntu 14.04服务器上创build了一个新的nginx和php5-fpm安装,并进行了如下所示的更改,以便configuration工作。 当我浏览到包含index.php的目录或尝试浏览到phpinfo.php文件时,浏览器尝试下载文件(即PHP不处理文件并返回响应)。 如果我浏览到任何其他的PHP文件,如process.php或test.php它运行良好。 configuration 更新/etc/php5/fpm/pool.d/www.conf来侦听TCP套接字 listen = 127.0.0.1:9000 文件:/etc/nginx/nginx.conf user www-data; worker_processes 4; pid /run/nginx.pid; events { worker_connections 768; # multi_accept on; } http { sendfile on; tcp_nopush on; tcp_nodelay on; keepalive_timeout 65; types_hash_max_size 2048; include /etc/nginx/mime.types; default_type application/octet-stream; access_log /var/log/nginx/access.log; error_log /var/log/nginx/error.log; gzip on; gzip_disable "msie6"; include /etc/nginx/conf.d/*.conf; include /etc/nginx/sites-enabled/*; } 文件:/ etc […]