我在我的Debian服务器上运行PHP-FPM。 我的问题是关于内存使用情况。 我只能在PHP中设置memory_limit,对于某些请求来说不应该太低。 我也只能在PHP-FPM中设置进程的数量,也不能太低,因为我运行了很多PHP请求。 在大多数情况下,进程只能使用大约2-20mb。 进程限制是512,所以这大概是5-10GB的RAM。 但是,由于一些PHP脚本可以使用更多的内存,最大允许的内存大约是1TB(512进程* 2048mb)。 如果出现问题,Debian OOM Killer将会随机杀死进程。 有什么办法来限制php-fpm的总内存使用量吗? 像php-fpm不会产生更多的进程,因为它超出了所有的RAM。
我在两个不同的服务器上有一个特定的Magento商店的问题。 问题是,当我保存pipe理面板,我得到一个502错误。 这些值实际上保存到数据库,因为按下浏览器加载设置了新值的pipe理页面。 但是,保存后页面将始终为502,而不是刷新,手动按下是继续工作的唯一方法。 日志文件显示如下: /var/log/php5-fpm.log exited on signal 11 (SIGSEGV – core dumped) after 3.555010 seconds from start /var/log/nginx/website_dev_error.log [error] 38501#0: *625 recv() failed (104: Connection reset by peer) while reading response header from upstream 池文件variables [website.dev] listen = /var/run/php5-fpm.website.dev.sock user = www-data group = www-data listen.owner = www-data listen.group = www-data listen.mode = […]
正当我试图从Apache 2切换到Nginx时,我遇到了许多问题,并且仍在修复它们。 无论如何,我试图让他们工作,但没有运气。 所以我在这里寻求帮助/以前的经验。 我使用默认的configuration来运行PHP,并且只在运行PHP文件时效果很好。 但不幸的是,codeigniter的URL不会以* .PHP结尾。 所以我认为PHP-FPM不会将我的脚本当作PHP文件,因为URL不会以*.PHP 。 我只是猜测。 那么,有没有什么办法让他们工作? 对我来说似乎是不可能的,我尝试了很多configuration(在修改它们以适应我的环境,ofcource之后),但是它们中没有一个与Codeigniter一起工作。 希望张贴我目前的configuration,正常的PHP文件的作品,将导致一些解决scheme。 注意:这与Nginx的Codeigniter框架的wiki页面中的内容完全相同。 server { server_name _;#_ to catch all requests. root /usr/share/nginx/www; index index.html index.php; # set expiration of assets to MAX for caching location ~* \.(ico|css|js|gif|jpe?g|png)(\?[0-9]+)?$ { expires max; log_not_found off; } location / { # Check if a file exists, or […]
我们运行一个默认安装了php 5.3.10的Ubuntu 12.04服务器。 我以为Ubuntu只是在更新中应用了错误修正,所以像5.3.x这样的微软应该可以通过。 显然,我们的版本没有更新,但是我们在5.3.15中解决了一个关键的bug 。 我应该等待更长的时间这个释放泡沫? 还是有安全的资源库用于Ubuntu不断更新PHP和PHP相关的软件包?
我已经迁移到nginx设置〜2个月前的php5-fpm。 一切都很好,直到几天前,当我注意到我的PHP网站没有响应(浏览器只是等待数据,最终超时)。 重新启动php5-fpm帮助。 这是我的/var/log/php5-fpm.log的结尾: [09-Feb-2013 07:22:46] NOTICE: [pool www] child 26802 started [09-Feb-2013 20:09:07] WARNING: [pool www] server reached pm.max_children setting (10), consider raising it [10-Feb-2013 07:22:40] WARNING: [pool www] child 5986 exited on signal 11 (SIGSEGV – core dumped) after 40414.794799 seconds from start [10-Feb-2013 07:22:40] NOTICE: [pool www] child 13596 started [11-Feb-2013 07:22:14] […]
每次我在CentOS上升级php(通过yum升级),我的/ var / lib / session文件夹的所有权变成root:apache,拥有600个权限。 我使用nginx作为我的web服务器。 这打破了我的网站,并防止会话被存储。 解决方法是简单地将nginx:nginx文件夹。 但是我必须每次yum更新php时手动执行此操作。 我想这个问题源于事实,当我最初设置箱子,我跑了阿帕奇。 我可以在哪里修改这个configuration为“nginx”来解决这个问题? 我看了一下php.ini,但在那里看不到任何相关的东西。 会话目录是指定的,但没有关于用户。
我使用Ubuntu 14.10,nginx 1.6.2,php 5.5.12。 我有一个这样的网站设置: server { root /usr/share/nginx/www/oliviataussig; index index.php; server_name oliviataussig.com www.oliviataussig.com; location / { try_files $uri $uri/ /index.php =404; } location ~ \.php$ { try_files $uri =404; include fastcgi.conf; fastcgi_pass unix:/var/run/php5-fpm.sock; } } 当我去主页(index.php),它工作正常。 但是,当我点击页面上的任何链接(这是一个类似于WordPress的CMS)时,我想回到/index.php ,并且这样做,但是index.php被下载而不是被执行。 我如何解决这个问题?
我有两个目录,我需要提供静态资产: /srv/web :包含图片,JavaScript,HTML等的静态资源 /srv/php :dynamicPHP脚本以及一些静态资产。 我正在使用NGINX并configuration它,如下所示: server { listen 80; server_name _; # root /; index index.php index.html index.htm; try_files /srv/web/$uri /srv/php/$uri =404; location ~ \.php$ { root /srv/php; try_files $uri =404; fastcgi_pass unix:/var/run/php5-fpm.sock; fastcgi_index index.php; # fastcgi_param SCRIPT_FILENAME /srv/php$fastcgi_script_name; include fastcgi_params; } } 我在Ubuntu 14.04上,PHP FPM包版本是5.5.9,NGINX包版本是1.4.6。 这里的简单目标是首先为/srv/web提供静态文件,如果失败/srv/php ,则返回404.所有以\.php$结尾的\.php$将通过Unix套接字从PHP FPM请求,这是工作。 我目前遇到的问题是, server上的index指令没有按计划运行。 我在/srv/web有一个index.html文件,当我这样做 curl -is […]
我需要在Ubuntu 16.04上为Nginx 1.10和PHP-FPM 7增加允许打开的最大文件数量。 根据一些教程,我改变了/etc/security/limits.conf中每个用户打开文件的最大数量 * soft nofile 64000 * hard nofile 68000 我还在/etc/sysctl.conf中更改了整个系统的最大打开文件数 fs.file-max = 200500 重新加载我的虚拟机后,我检查了用户login到系统的软硬限制 igor@ubuntu:~$ ulimit -Sn 64000 igor@ubuntu:~$ ulimit -Hn 68000 如您所见,限制适用于用户。 我的问题是,我不能改变Nginx和PHP的限制 igor@ubuntu:~$ sudo ps aux|grep nginx root 1124 0.0 0.0 45988 980 ? Ss 01:04 0:00 nginx: master process /usr/sbin/nginx -g daemon on; master_process on; www-data 1125 0.0 […]
我正在使用不同的根path/cloud但每当我尝试请求任何/cloud/*.php文件nginx说404文件未find。 我可以访问/cloud/*.html没有任何问题。 我甚至可以访问任何/*.php但不知道/cloud 。 我的configuration文件看起来像 server { listen 80 default_server; listen [::]:80 default_server; root /var/www/html; index index.html index.htm index.nginx-debian.html index.php; server_name _; location /cloud { root /home/fhost/public_html; } location / { try_files $uri $uri/ =404; } location ~ \.php$ { include snippets/fastcgi-php.conf; fastcgi_pass unix:/run/php/php7.0-fpm.sock; } location ~ /\.ht { deny all; } }