我最近在Fedora的nginx + php-fpm安装程序中遇到了一些PHP应用程序的问题。 我本来就是跟Owncloud有这个问题的,创造了一个问题,没有太多的运气 ,但我意识到这是一个全球性的问题。
我今天尝试安装Drupal,并且遇到了与之前相同的问题。 我的nginx服务器块是这样的:
server { listen 80; server_name domainname.com; root /var/www/whatever; index index.php; location / { try_files $uri $uri/ =404; #Recommended by Drupal docs for "Clean URLs" error_page 404 = @drupal; } location ~ \.php$ { include fastcgi_params; fastcgi_index index.php; try_files $uri =404; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_pass 127.0.0.1:9000; } #Recommended by Drupal docs for "Clean URLs" location @drupal { rewrite ^(.*)$ /index.php?q=$1 last; } }
这个模块对我的Tiny Tiny RSS设置来说工作得很好,但是当我使用它作为Owncloud或Drupal时,所有资源都无法加载,因为由php生成的URL是mysite.com/var/www/whatever/important/stuff.pony mysite.com/important/stuff.pony 。
我会想象这个问题与Fedora中PHP的默认configuration有关,否则我不知道可能是错误的。