1

问题:我面临的问题是当我打开localhost/phpmyadmin它时"No Input file Specified"

我正在尝试在 Windows 上配置 Nginx 和 php。Nginx 安装路径是E:\server\nginx php 安装路径is E:\server\php PhpMyAdmin 安装路径是E:\phpmyadmin\ 我的根目录路径是E:\server\www

以下代码来自nginx.conf文件。

server {
   listen       80;
   server_name  localhost;
   root E:\server\www;                  

   index index.php index.html;

   location / {
   try_files $uri $uri/ /index.php;
   }

   location ~ \.php$ {
    try_files $uri /index.php =404;
    fastcgi_split_path_info ^(.+\.php)(/.+)$;
    fastcgi_index   index.php;
    fastcgi_pass    127.0.0.1:9000;
    include         fastcgi_params;
    fastcgi_param   SCRIPT_FILENAME $document_root$fastcgi_script_name;
} 

    location /phpmyadmin/ {
    alias E:/server/phpmyadmin/;
    try_files $uri /phpmyadmin/index.php =404;

       location ~ \.php$ {
       try_files $uri /index.php =404;
       fastcgi_split_path_info ^(.+\.php)(/.+)$;
       fastcgi_index   index.php;
       fastcgi_pass    127.0.0.1:9000;
       include         fastcgi_params;
       fastcgi_param   SCRIPT_FILENAME   $document_root$fastcgi_script_name;
      }
   }
}

我正在从命令提示符运行 nginx 和 php

cd `E:\server\nginx\
nginx.exe`

cd E:\server\php\
php-cgi.exe -b 127.0.0.1

服务器运行良好。我可以访问localhost/ 我也可以从 www 文件夹访问任何 .php 文件。

问题:我面临的问题是当我打开 localhost/phpmyadmin 它给了我"No Input file Specified"

请告诉我我做错了。先感谢您。

4

1 回答 1

1

尝试一下:

server {
  listen       80;
  server_name  localhost;
  root         E:\server\www;                  

  index index.php index.html;

  location / {
    try_files $uri $uri/ /index.php;
  }

  location ~ \.php$ {
    try_files $uri /index.php =404;
    fastcgi_split_path_info ^(.+\.php)(/.+)$;
    fastcgi_index   index.php;
    fastcgi_pass    127.0.0.1:9000;
    include         fastcgi_params;
    fastcgi_param   SCRIPT_FILENAME $document_root$fastcgi_script_name;
  }

  location /phpmyadmin {
    alias E:/server/phpmyadmin/;
    index index.php;

    location ~ \.php$ {
      fastcgi_pass  127.0.0.1:9000;
      fastcgi_index index.php;
      fastcgi_param SCRIPT_FILENAME $request_filename;
      include       fastcgi_params;
    }
  }
}
于 2017-10-12T12:12:20.863 回答