I copied this config when setting up a basic Nginx / PHP-FPM webserver
server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
root /usr/share/nginx/html;
index index.php index.html index.htm;
server_name server_domain_name_or_IP;
location / {
try_files $uri $uri/ =404;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
Run Code Online (Sandbox Code Playgroud)
它可以正常工作,但我不明白try_files
在location ~ \.php$ { .... }
处理对 php 文件的请求时in块是如何工作的,例如domain.com/test.php
.
我以为这条线
try_files $uri =404;
Run Code Online (Sandbox Code Playgroud)
告诉 nginx 继续尝试提供静态文件 - …
我刚刚通过以下方式在 Ubuntu 14.04 上安装了内存缓存(不是内存缓存)
sudo pecl install memcache
Run Code Online (Sandbox Code Playgroud)
该模块在 phpinfo 输出中显示为已加载。
但我看不到守护进程是否正在运行。
我试过了
sudo ps -e | grep memcache
sudo ps -e | grep memcache
sudo service memcache status
-> sudo: /etc/init.d/memcache: 命令未找到sudo /etc/init.d/memcache status
-> 内存缓存:无法识别的服务大多数谷歌搜索都给出了对我不起作用的memcached 的说明
如何检查 memcache 是否正在运行?