admin管理员组文章数量:1332864
I'm a newbie of WordPress. My environment is Ubuntu 18 + Nginx + PHP 7.
Following the tutorial(/), the wordpress directory was placed on /var/www/html/device1
.
Then I config the nginx, here is my nginx config:
server {
listen 80;
server_name www.device1 device1;
server_name device1;
root /var/www/html/device1;
index index.php;
# log files
access_log /var/log/nginx/device1.access.log;
error_log /var/log/nginx/device1.error.log;
location = /favicon.ico {
log_not_found off;
access_log off;
}
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}
location / {
try_files $uri $uri/ /index.php?$args;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php7.2-fpm.sock;
}
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
expires max;
log_not_found off;
}
}
But, when I tried to connect to .php
the Nginx responses 404, instead of returning the wordpress install page.
I don't have any idea of checking the issue. Thanks for your suggestion.
I'm a newbie of WordPress. My environment is Ubuntu 18 + Nginx + PHP 7.
Following the tutorial(https://www.myfreax/how-to-install-wordpress-with-nginx-on-ubuntu-18-04/), the wordpress directory was placed on /var/www/html/device1
.
Then I config the nginx, here is my nginx config:
server {
listen 80;
server_name www.device1 device1;
server_name device1;
root /var/www/html/device1;
index index.php;
# log files
access_log /var/log/nginx/device1.access.log;
error_log /var/log/nginx/device1.error.log;
location = /favicon.ico {
log_not_found off;
access_log off;
}
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}
location / {
try_files $uri $uri/ /index.php?$args;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php7.2-fpm.sock;
}
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
expires max;
log_not_found off;
}
}
But, when I tried to connect to http://device1/wp-admin/install.php
the Nginx responses 404, instead of returning the wordpress install page.
I don't have any idea of checking the issue. Thanks for your suggestion.
Share Improve this question asked Jul 6, 2020 at 14:43 DennisLiDennisLi 1011 Answer
Reset to default 0This is because the directory of wordpress is wrong.
the whole of wordpress files should have been extracted in /var/www/html/device1
.
本文标签: phpWhy can39t I connect to the wordpress install page with Nginx
版权声明:本文标题:php - Why can't I connect to the wordpress install page with Nginx? 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742286786a2447072.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论