作为一个附带项目,我一直在关注如何从这里设置 Nginx Web 服务器的指南:http: //arstechnica.com/information-technology/2012/12/web-served-part-4 -get-your-database-on/2/
一切都很顺利,直到我安装了 Sqlbuddy。当我尝试导航到 {server address}/sqlbuddy 页面保持白色,这出现在 nginx 的 error.log 中:
2013/12/19 01:03:38 [error] 1949#0: *1 FastCGI sent in stderr: "PHP message: PHP Warning: include(/usr/share/nginx/html/sqlbuddy/includes/types.php): failed to open stream: No such file or directory in /usr/share/nginx/html/sqlbuddy/functions.php on line 28
PHP message: PHP Warning: include(): Failed opening '/usr/share/nginx/html/sqlbuddy/includes/types.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /usr/share/nginx/html/sqlbuddy/functions.php on line 28
PHP message: PHP Warning: include(/usr/share/nginx/html/sqlbuddy/includes/class/GetTextReader.php): failed to open stream: No such file or directory in /usr/share/nginx/html/sqlbuddy/functions.php on line 29
PHP message: PHP Warning: include(): Failed opening '/usr/share/nginx/html/sqlbuddy/includes/class/GetTextReader.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /usr/share/nginx/html/sqlbuddy/functions.php on line 29
PHP message: PHP Warning: include(/usr/share/nginx/html/sqlbuddy/includes/class/Sql.php): failed to open stream: No such file or directory in /usr/share/nginx/html/sqlbuddy/functions.php on line 34
PHP message: PHP Warning: include(): Failed opening '/usr/share/nginx/html/sqlbuddy/includes/class/Sql.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /usr/share/nginx/html/sqlbuddy/functions.php on line 34
PHP message: PHP Fatal error: Class 'GetTextReader' not found in /usr/share/nginx/html/sqlbuddy/functions.php on line 128" while reading response header from upstream, client: 192.168.0.122, server: localhost, request: "GET /sqlbuddy/ HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.soc:", host: "192.168.0.123"
我在 /etc/nginx/sites-available/www 中的设置:
server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
root /usr/share/nginx/html;
index index.html index.htm index.php;
# Make site accessible from http://localhost/
server_name localhost;
location / {
try_files $uri $uri/ =404;
}
location ~ /sqlbuddy/.*\.php$ {
try_files $uri =404;
include fastcgi_params;
fastcgi_pass php5-fpm-sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_intercept_errors on;
}
location ~ \.php$ {
try_files $uri =404;
include fastcgi_params;
fastcgi_pass php5-fpm-sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_intercept_errors on;
}
location ~ /\. {access_log off; log_not_found off; deny all;}
location ~ ~$ {access_log off; log_not_found off; deny all;}
...unrelated...
}
我采取的步骤:
- chmod 755'ed 整个 /html 目录及其下面的所有内容
- chown www-data:www-data /sqlbuddy'ed 目录
- 确保我的用户名是 www-data 组的一部分
- 根据上面的说明卸载并重新安装了几次sqlbuddy
- 将所有文件从 /sqlbuddy/src 移动到 /sqlbuddy (请注意,无论我是否移动这些文件,它仍然损坏)
- 重启php-fpm,nginx,和服务器本身几次
不用说,这是非常令人困惑的。我承认很多这样的事情都超出了我的工资等级(可以说是一些核心错误),但我绝对没有理由相信,如果我按照书面的所有说明进行操作,它就不会起作用。