Home >Database >phpMyAdmin >The phpmyadmin file cannot be found under nginx

The phpmyadmin file cannot be found under nginx

王林
王林Original
2019-12-13 10:16:002186browse

The phpmyadmin file cannot be found under nginx

Problem:

Have installed the latest stable version of Nginex (1.4.4) and want to install phpMyAdmin, unfortunately when I try to The following error occurs when opening phpMyAdmin via http://192 in the server. . ./phpMyAdmin:

The phpmyadmin file cannot be found under nginx

##What is the reason why Nginx cannot find the phpMyAdmin file?

This is the content of my /etc/nginx/nginx.conf file:

The phpmyadmin file cannot be found under nginx

Solution:

The correct way is Create a file called php and add it to /etc/nginx/sites-available. You can copy the file below but change the port number to something else.

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;

        }}

Now you need to make a symlink to the site-enabled directory

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

Now you need to add this code to the Logging Settings section of nginx.conf

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

Now You can access your phpmyadmin using

http://example.com:30425.

Recommended related articles and tutorials:

phpmyadmin tutorial

The above is the detailed content of The phpmyadmin file cannot be found under nginx. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn