linux – 在浏览器控制台中出现错误的空白页面example.com/phpmyadmin

前端之家收集整理的这篇文章主要介绍了linux – 在浏览器控制台中出现错误的空白页面example.com/phpmyadmin前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我已经在我的LEMP服务器(PHP 7)上安装了PHPmyadmin并对其进行了符号链接.但是当我转到hostname / PHPmyadmin时,它会在标题栏上返回一个带有PHPmyadmin图标的空白页面.

浏览器控制台中有3个错误

Failed to load resource: net::ERR_INCOMPLETE_CHUNKED_ENCODING

Uncaught ReferenceError: $is not defined

Uncaught ReferenceError: PMA_commonParams is not defined

我尝试了很多解决方案,但无法找到问题:(

服务器配置:

  1. server {
  2. # listen 80 ;
  3. # listen [::]:80 default_server;
  4.  
  5. # SSL configuration
  6. #
  7. listen 443 ssl default_server;
  8. listen [::]:443 ssl default_server;
  9. #
  10. # Note: You should disable gzip for SSL traffic.
  11. # See: https://bugs.debian.org/773332
  12. #
  13. # Read up on ssl_ciphers to ensure a secure configuration.
  14. # See: https://bugs.debian.org/765782
  15. #
  16. # Self signed certs generated by the ssl-cert package
  17. # Don't use them in a production server!
  18. #
  19. # include snippets/snakeoil.conf;
  20.  
  21. root /var/www/laravel/public;
  22.  
  23. # Add index.PHP to the list if you are using PHP
  24. index index.PHP index.html index.htm index.Nginx-debian.html;
  25.  
  26. server_name example.com ;
  27.  
  28. ssl on;
  29. ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem;
  30. ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem;
  31.  
  32.  
  33. location / {
  34. # First attempt to serve request as file,then
  35. # as directory,then fall back to displaying a 404.
  36. try_files $uri $uri/ /index.PHP?$query_string;
  37. }
  38.  
  39. location /PHPmyadmin {
  40.  
  41. alias /var/www/laravel/public/;
  42. index index.PHP index.html index.htm;
  43. }
  44.  
  45.  
  46. # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
  47.  
  48. location ~ \.PHP${
  49. include snippets/fastcgi-PHP.conf;
  50. fastcgi_split_path_info ^(.+\.PHP)(/.+)$;
  51.  
  52. # # With PHP7.0-cgi alone:
  53. # fastcgi_pass 127.0.0.1:9000;
  54. # # With PHP7.0-fpm:
  55. fastcgi_pass unix:/run/PHP/PHP7.0-fpm.sock;
  56.  
  57. include fastcgi_params;
  58. }
  59.  
  60.  
  61. # deny access to .htaccess files,if Apache's document root
  62. # concurs with Nginx's one
  63. #
  64. location ~ /\.ht {
  65. deny all;
  66. }
  67. location ~ /.well-known {
  68. allow all;}
  69.  
  70.  
  71. }
  72.  
  73.  
  74. # Virtual Host configuration for example.com
  75. #
  76. # You can move that to a different file under sites-available/ and symlink that
  77. # to sites-enabled/ to enable it.
  78. #
  79. server {
  80. listen 80;
  81. # listen [::]:80;
  82. #
  83. server_name example.com;
  84. #
  85. # root /var/www/example.com;
  86. # index index.html;
  87. #
  88. # location / {
  89. # try_files $uri $uri/ =404;
  90. # }
  91.  
  92. return 301 https://example.com$request_uri;
  93. }

解决方法

Nginx中的PHP-FPM:fastcgi的缓冲区不够大.

尝试将此添加到您的配置:

  1. fastcgi_buffers 8 512k;
  2. fastcgi_buffer_size 256k;
  3. fastcgi_send_timeout 5m;
  4. fastcgi_read_timeout 5m;
  5. fastcgi_connect_timeout 5m;

我的Nginx配置:

  1. server {
  2. client_max_body_size 100M;
  3.  
  4. listen 80;
  5.  
  6. server_name PHPmyadmin.dev;
  7.  
  8. root /usr/share/PHPmyadmin;
  9.  
  10. access_log off;
  11.  
  12. index index.PHP index.html index.htm;
  13.  
  14. location ~ ^/(.+\.PHP)${
  15. try_files $uri = 404;
  16. fastcgi_pass unix:/var/run/PHP5-fpm.sock;
  17. fastcgi_index index.PHP;
  18. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  19. include /etc/Nginx/fastcgi_params;
  20.  
  21. fastcgi_buffers 8 512k;
  22. fastcgi_buffer_size 256k;
  23. fastcgi_send_timeout 5m;
  24. fastcgi_read_timeout 5m;
  25. fastcgi_connect_timeout 5m;
  26. }
  27. }

猜你在找的Linux相关文章