我刚在Ubuntu 12.04上更新了我的PHP

现在,所有的奇怪,我做了一个简单的phpinfo.php在我的服务器上,然后这502坏网关开始出现。 我检查/etc/nginx/sites-available/default nginxconfiguration文件,看起来一切正常:
server { listen 80 default_server; listen [::]:80 default_server ipv6only=on; root /usr/share/nginx/html; index index.php index.html index.htm; # Make site accessible from http://localhost/ server_name localhost; location / { # First attempt to serve request as file, then # as directory, then fall back to displaying a 404. try_files $uri $uri/ /index.html; # Uncomment to enable naxsi on this location # include /etc/nginx/naxsi.rules } location /doc/ { alias /usr/share/doc/; autoindex on; allow 127.0.0.1; allow ::1; deny all; } # Only for nginx-naxsi used with nginx-naxsi-ui : process denied requests #location /RequestDenied { # proxy_pass http://127.0.0.1:8080; #} #error_page 404 /404.html; # redirect server error pages to the static page /50x.html # #error_page 500 502 503 504 /50x.html; #location = /50x.html { # root /usr/share/nginx/html; #} # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 # location ~ \.php$ { fastcgi_split_path_info ^(.+\.php)(/.+)$; # NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini # With php5-cgi alone: # fastcgi_pass 127.0.0.1:9000; # With php5-fpm: fastcgi_pass unix:/var/run/php5-fpm.sock; fastcgi_index index.php; include fastcgi_params; } # deny access to .htaccess files, if Apache's document root # concurs with nginx's one # location ~ /\.ht { deny all; } }
不知道是什么问题,我的PHP是好的,我没有升级。
编辑
只是注意到,我去到/var/run/php5-fpm.sock的目录,但没有看到在那里的任何php5-fpm.sock 。 这是原因吗?
检查PHP-FPM正在运行:
ps -ef | grep php
在你的情况下,它没有运行。 检查它是否已安装:
dpkg -s php5-fpm
在你的情况下,包被标记为“状态:卸载”。 原因是你从一个PPA( ppa:ondrej / php5 )升级了PHP,导致你的原始副本被删除。 您可能需要重新安装任何非核心软件包才能重新获得该function。
要加回php-fpm,你可以运行:
apt-get install php5-fpm
在你的情况下,这失败了:
php5-fpm : Depends: libsystemd-daemon0 (>= 31) but it is not installable
由于您使用的PPA的发布者有另一个PPA( ppa:ondrej / systemd )提供此包,请安装该解决scheme来解决缺less的依赖关系,然后重新运行安装。
一旦完成,validation你的安装是成功的,并且php-fpm正在运行。