温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

nginx下找不到phpmyadmin文件怎么办

发布时间:2020-12-24 11:01:01 来源:亿速云 阅读:164 作者:小新 栏目:数据库

小编给大家分享一下nginx下找不到phpmyadmin文件怎么办,希望大家阅读完这篇文章之后都有所收获,下面让我们一起去探讨吧!

问题:

已经安装了最新的稳定版本的Nginex(1.4.4),并且想安装phpMyAdmin,不幸的是当我尝试在我的浏览器中通过http:// 192打开phpMyAdmin时出现以下错误. . . / phpMyAdmin的:

nginx下找不到phpmyadmin文件怎么办

究竟Nginx找不到phpMyAdmin文件的原因是什么?

这是我的/etc/nginx/nginx.conf文件的内容:

nginx下找不到phpmyadmin文件怎么办

解决方法:

正确的方法是创建一个名为php的文件并添加到/ etc / nginx / sites-available.您可以复制下面的文件,但将端口号更改为其他内容。

server {
        listen 30425;
        # Don't want to log accesses.        
        #access_log  /dev/null main;
        access_log  /var/log/nginx/php.acces_log main;
        error_log   /var/log/nginx/php.error_log info;

        root /usr/share/phpmyadmin;
        index  index.php index.html index.htm;
        error_page 401 403 404 /404.php;

        location ~ .*.php${
                include fastcgi_params;
                fastcgi_pass  127.0.0.1:9000;
                fastcgi_index index.php;
                fastcgi_param  SCRIPT_FILENAME $document_root$fastcgi_script_name;
                fastcgi_param SERVER_NAME $http_host;
                fastcgi_ignore_client_abort on;

        }}

现在,您需要对启用了站点的目录进行符号链接

ln -s / etc / nginx / sites-available / php // etc / nginx / sites-enabled

现在您需要将此代码添加到nginx.conf的Logging Settings部分

log_format main ‘$remote_addr – $remote_user [$time_local] ‘
                ‘”$request” $status $body_bytes_sent “$http_referer” ‘
                ‘”$http_user_agent” “$http_x_forwarded_for”‘ ;

现在您可以使用http://example.com:30425访问您的phpmyadmin。

看完了这篇文章,相信你对“nginx下找不到phpmyadmin文件怎么办”有了一定的了解,如果想了解更多相关知识,欢迎关注亿速云行业资讯频道,感谢各位的阅读!

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI