0

I installed laravel on centos 7 .Laravel's home page works fine but when I try to connect myipaddres/phpmyadmin ,I am getting 404 not found error.I don't know what error message I have to show you to help me.I am using nginx.

nginx configuration:

server {
    listen       80 default_server;
    listen       [::]:80 default_server;

    server_name myipaddress;
    root         /usr/share/nginx/html;

    .
    include /etc/nginx/default.d/*.conf;

    location / {
      root /var/www//public_html;
      index index.html index.htm;
      try_files $uri $uri/ =404;
    }

    error_page 404 /404.html;
        location = /40x.html {
    }

    error_page 500 502 503 504 /50x.html;
        location = /50x.html {
    }
}
This is laravel.conf


server {
        listen 80;
        listen [::]:80 ipv6only=on;

    # Log files for Debugging
        access_log /var/log/nginx/laravel-access.log;
        error_log /var/log/nginx/laravel-error.log;

    # Webroot Directory for Laravel project
        root /var/www/laravel/public;
        index index.php index.html index.htm;

        # Your Domain Name
        server_name myipaddress;

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

    # PHP-FPM Configuration Nginx
        location ~ \.php$ {
                try_files $uri =404;
                fastcgi_split_path_info ^(.+\.php)(/.+)$;
                fastcgi_pass unix:/run/php-fpm/php-fpm.sock;
                fastcgi_index index.php;
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                include fastcgi_params;
        }
}

This is phpmyadmin.conf


server {
   listen       80;
   server_name  myipaddress;
   root   /usr/share/nginx/html;

   # note that these lines are originally from the "location /" block

    location / {
        index index.php index.html index.htm;
}

#    location / {
#        try_files $uri $uri/ =404;
#    }

   error_page 404 /404.html;
   error_page 500 502 503 504 /50x.html;
   location = /50x.html {
       root /usr/share/nginx/html;
   }

   location ~ \.php$ {
       try_files $uri =404;
       fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
       fastcgi_index index.php;
       fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
       include fastcgi_params;
  }

}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.