【问题标题】:Need Help Nginx phpmyadmin Ubuntu 14.04, cant run web1.com/phpmyadmin需要帮助 Nginx phpmyadmin Ubuntu 14.04,无法运行 web1.com/phpmyadmin
【发布时间】:2014-12-11 12:36:34
【问题描述】:

我是这方面的新手。我正在尝试在 digitalocean 上使用他们自己的域名设置 3 个 wordpress 网站。 我按照他们的教程,https://www.digitalocean.com/community/tutorials/how-to-configure-single-and-multiple-wordpress-site-settings-with-nginx

我确实安装了 2 个 wordpress 并且能够毫无问题地运行它们。 但现在我需要安装 phpmyadmin,所以我按照本教程进行操作,但我还没有做安全部分,https://www.digitalocean.com/community/tutorials/how-to-install-and-secure-phpmyadmin-with-nginx-on-an-ubuntu-14-04-server

现在当我尝试运行 web1.com/info.php 和 web1.com/phpmyadmin 时,wordpress 主题出现 404 错误。

我把wordpress安装在/home/ap/web1和/home/ap/web2中

server {
server_name web1.com;
    return 301 $scheme://www.web1.com$request_uri;
    }
server_name www.web1.com;
root /home/ap/web1;
access_log /var/log/nginx/www.web1.com.access.log;
error_log /var/log/nginx/www.web1.com.error.log;

    location /phpmyadmin{
    alias /usr/share/phpmyadmin;
    index index.php index.html index.htm;
    }
    include global/common.conf;
    include global/wordpress.conf;
    include global/multisite.conf;
}

我需要解决什么问题?

【问题讨论】:

  • 您是否尝试过在location /phpadmin 中使用root 而不是alias
  • 我已经尝试过但没有用
  • 所以让我们尝试在这个位置添加 .php$ 位置中使用的参数,例如:include /etc/nginx/fastcgi_params; fastcgi_pass backendPool; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  • 你是说这个吗? '位置 ~ \.php$ { try_files $uri =404; fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_pass unix:/var/run/php5-fpm.sock; fastcgi_index index.php;包括 fastcgi_params; }' 这个在 /etc/nginx/sites-available/default
  • 我把你的代码放在'include global/multisite.conf;'之后吗?我这样做了,但我无法重新启动 nginx

标签: wordpress nginx phpmyadmin ubuntu-14.04


【解决方案1】:

我可以通过 sudo ln -s /usr/share/phpmyadmin /home/ap/web1 解决这个问题。以前,我按照教程做了这个sudo ln -s /usr/share/phpmyadmin /usr/share/nginx/html

【讨论】:

    猜你喜欢
    • 2016-09-29
    • 2020-07-09
    • 2018-04-06
    • 2017-01-29
    • 2014-09-20
    • 2016-04-26
    • 1970-01-01
    • 2015-02-19
    相关资源
    最近更新 更多