的phpmyadmin和nginx的没有给出输入文件
问题描述:
这是我主要的conf文件的phpmyadmin和nginx的没有给出输入文件
# For more information on configuration, see:
# * Official English Documentation: http://nginx.org/en/docs/
# * Official Russian Documentation: http://nginx.org/ru/docs/
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log;
pid /run/nginx.pid;
events {
worker_connections 1024;
}
http {
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
include /etc/nginx/mime.types;
default_type application/octet-stream;
# Load modular configuration files from the /etc/nginx/conf.d directory.
# See http://nginx.org/en/docs/ngx_core_module.html#include
# for more information.
include /etc/nginx/conf.d/*.conf;
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name mysite.com www.mysite.com;
root /home/mysite/www;
sendfile off;
# Load configuration files for the default server block.
include /etc/nginx/default.d/*.conf;
index index.php index.html index.htm;
location/{
}
location /pma {
alias /usr/share/phpmyadmin;
location ~ \.php$ {
try_files $uri @php;
}
}
location @php {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass php-fpm;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_intercept_errors off;
}
error_page 404 /404.html;
location = /40x.html {
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
}
}
}
phpMyAdmin的文件在/ usr /共享/ phpMyAdmin的/ 如果我去www.mysite.com/pma/它给我 没有输入文件中指定 而在错误日志:
2016/06/12 15:48:47 [error] 15999#0: *1 FastCGI sent in stderr: "Unable to open primary script: /home/mysite/www/pma/index.php (No such file or directory)" while reading response header from upstream, client: my-ip, server: mysite.com, request: "GET /pma/ HTTP/1.1", upstream: "fastcgi://unix:/run/php-fpm/www.sock:", host: "my server ip"
我用尽了一切,改变别名有根还没有帮助,它被下载index.php文件到一个名为“下载”文件 我读过我应该使用别名而不是root。但它似乎并没有解决我的问题......
编辑 我也有包括
# pass the PHP scripts to FastCGI server
#
# See conf.d/php-fpm.conf for socket configuration
#
index index.php index.html index.htm;
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
try_files $uri =404;
fastcgi_intercept_errors on;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass php-fpm;
}
答
请更改别名根,并确保正确的路径到你的phpmyadmin这里面default.d在/ usr/share/pma中。 在这个配置中使用套接字php-fpm。对不起我的英文不好
# # configure phpmyadmin path
location /pma {
root /usr/share;
index index.php;
location ~ ^/pma/(.+\.php)$ {
try_files $uri $uri/ /index.php?$args;
root /usr/share;
fastcgi_pass unix:/var/run/php-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $request_filename;
#fastcgi_param PATH_INFO $fastcgi_script_name;
include fastcgi_params;
fastcgi_buffer_size 128k;
fastcgi_buffers 256 4k;
fastcgi_busy_buffers_size 256k;
fastcgi_temp_file_write_size 256k;
fastcgi_intercept_errors on;
}
location ~* ^/pma/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ {
root /usr/share;
}
}
这是一项正在进行的工作吗?因为我看不到你的main(非phpmyadmin)应用程序应该如何运行'.php'文件。 –
请参阅编辑的回复 – John