Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/amazon-web-services/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Amazon web services phpmyadmin在amazon ec2实例上的linux ami中的nginx web服务器上不工作_Amazon Web Services_Nginx_Amazon Ec2_Phpmyadmin - Fatal编程技术网

Amazon web services phpmyadmin在amazon ec2实例上的linux ami中的nginx web服务器上不工作

Amazon web services phpmyadmin在amazon ec2实例上的linux ami中的nginx web服务器上不工作,amazon-web-services,nginx,amazon-ec2,phpmyadmin,Amazon Web Services,Nginx,Amazon Ec2,Phpmyadmin,我的工作内容: 实例-AmazonEC2, OS-LinuxAMI, 网络服务器-nginx 我已经根据AWS文档中提到的内容安装了phpmyadmin 我已经安装并运行了mysql,还有php fpm和nginx。我还在phpMyAdmin所在的目录(即/var/www/html/phpMyAdmin->/usr/share/nginx/www/html)之间创建了一个符号链接 下面是我的nginx.conf文件中的内容 server{ listen 80;

我的工作内容: 实例-AmazonEC2, OS-LinuxAMI, 网络服务器-nginx

我已经根据AWS文档中提到的内容安装了phpmyadmin

我已经安装并运行了mysql,还有php fpm和nginx。我还在phpMyAdmin所在的目录(即/var/www/html/phpMyAdmin->/usr/share/nginx/www/html)之间创建了一个符号链接

下面是我的nginx.conf文件中的内容

server{
        listen       80;
        server_name  localhost;
        root         /var/www/html/phpMyAdmin;

        # Load configuration files for the default server block.
        include /etc/nginx/default.d/*.conf;


        # redirect server error pages to the static page /40x.html
        #
        error_page 404 /404.html;
            location = /40x.html {
        }

        # redirect server error pages to the static page /50x.html
        #
        error_page 500 502 503 504 /50x.html;
            location = /50x.html {
        }

        # proxy the PHP scripts to Apache listening on 127.0.0.1:80
        #
        #location ~ \.php$ {
        #    proxy_pass   http://127.0.0.1;
        #}

        #location ^~ /phpMyAdmin/ { 
        #   root /var/www/html/phpMyAdmin; 
        #   index index.php; 
        #   include fastcgi_params; 
        #   fastcgi_pass  unix:/var/run/php-fpm.sock;
        #   fastcgi_index index.php; 
        #   fastcgi_param SCRIPT_FILENAME script/$fastcgi_script_name; 
        #} 

        # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
        #
        location ~ \.php$ {
            root             /var/www/html/phpMyAdmin;
            fastcgi_index    index.php;
        fastcgi_pass     unix:/var/run/php-fpm.sock;
        include          fastcgi_params;
        fastcgi_param    SCRIPT_FILENAME  /scripts$fastcgi_script_name;
        }

        # deny access to .htaccess files, if Apache's document root
        # concurs with nginx's one
        #
        location ~ /\.ht {
            deny  all;
        }   
    }

但这一切似乎都不起作用。我试了几个小时,但无法找出可能是什么问题导致它无法工作。任何帮助都会非常好。谢谢

您可以尝试使用下面的vhost配置文件。错误页面重定向处理显示配置文件有问题

server {

listen 80;
    root /var/www/html/phpMyAdmin; # Change the PHPMyAdmin location
    index index.php;

    server_name default_server;# Set server name based on sub-domain

    access_log /var/log/nginx/phpMyAdmin-access.log;
    error_log /var/log/nginx/phpMyAdmin-error.log notice;

    charset utf-8;
    error_page 404 403 500 502 503 504 /index.php;

    location / {
        try_files $uri $uri/ /index.php?$args;
        access_log off;
        expires max;
    }

    location ~* .(jpg|jpeg|png|gif|ico|css|js|ico|swf)$ { expires 365d; access_log off; log_not_found off;}

    location = /favicon.ico { log_not_found off; access_log off; allow all; }

    location = /robots.txt { access_log off; log_not_found off; allow all; }

    location ~ \.php$ {
        expires off;
        fastcgi_read_timeout 600;
        try_files $uri =404;
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_param SCRIPT_FILENAME
        $document_root$fastcgi_script_name;
        fastcgi_pass unix:/var/run/php/phpmyadmin.sock;
        fastcgi_index index.php;
    include fastcgi_params;
    }
}

到底是什么问题-您在浏览器中看到了什么错误消息,错误日志上说了什么,等等?