创建了一个PHP网站,Example.com,登录页面为example.com/admin
当我在example.com/admin上填写用户名和密码详细信息时。
页面已成功加载并显示成功重定向到您,但仪表板或管理面板显示空白屏幕。
检查下面的错误日志
2019/05/04 02:21:52 [emerg] 16768#16768: unexpected end of file, expecting "}" in /etc/nginx/sites-enabled/default:92
2019/05/04 02:23:21 [notice] 16780#16780: signal process started
thrown in /var/www/html/core/library/geoip.inc on line 572" while reading response header from upstream, client: 171.79.224.202, server: 157.230.229.11, request: "GET /admin/ HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php7.2-fpm.sock:", host: "157.230.229.11"
2019/05/04 03:23:16 [error] 30120#30120: *187 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught Error: Call to undefined function mb_internal_encoding() in /var/www/html/core/library/geoip.inc:572
Stack trace:
#0 /var/www/html/core/library/geoip.inc(464): _geoip_seek_country(Object(GeoIP), 2874138826)
#1 /var/www/html/core/library/geoip.inc(503): geoip_country_id_by_addr(Object(GeoIP), '171.79.224.202')
#2 /var/www/html/admin/controllers/dashboard.php(106): geoip_country_name_by_addr(Object(GeoIP), '171.79.224.202')
#3 /var/www/html/admin/app.php(129): require('/var/www/html/a...')
#4 /var/www/html/admin/index.php(41): require('/var/www/html/a...')
#5 {main}
thrown in /var/www/html/core/library/geoip.inc on line 572" while reading response header from upstream, client: 171.79.224.202, server: 157.230.229.11, request: "GET /admin/ HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php7.2-fpm.sock:", host: "157.230.229.11"
nginx /站点可用/默认文件为
server {
listen 80 default_server;
listen [::]:80 default_server;
root /var/www/html;
index index.php index.html index.htm index.nginx-debian.html;
server_name 157.230.229.11;
location / {
#try_files $uri $uri/ =404;
try_files $uri $uri/ /index.php?q=$uri&$args;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
}
location ~ /\.ht {
deny all;
}
}
当我单击显示主页的页面/子页面中的任何一个时,或者如果更改为该页面,则显示404找不到nginx错误,但主页工作文件。
请与此帮助任何人
答案 0 :(得分:2)
在您的.htaccess文件中尝试
RewriteEngine on
RewriteCond $1 !^(index\.php|public|\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?$1