typecho博客进入不了后台,提示404
今天安装lnmp非常顺利,安装typecho也非常顺利。但是打开首页后点文章无法查看文章内容。从网上搜了几个答案说是nginx伪静态、pathinfo等问题。
于是找了很多方法还是不行,下面说说试过的方法
1:typecho常见问题中说:在某些老版本的php里面,可能还要打开php.ini里的cgi.fix_pathinfo改为cgi.fix_pathinfo = 1,好,我改,改了之后不行
2:有篇博客中说可以直接在conf/vhost/.....com.conf中改,(1)、确保有“include typecho.conf;”这么一行,并且没有被“#”号注释;
(2)、用“#”号注释“try_files $uri =404;”这一行;
(3)、取消“#include pathinfo.conf;”这一行前面的的“#”号;
按照这种方法做了还是不行。我又想是不是那个location那里不对,就改成了location ~ .*\.php(\/.*)*$,改来改去还是不行。
3来论坛搜索,军哥在一篇帖子中说只要1.2上直接include enable-php.conf;替换为include enable-php-pathinfo.conf;我又在上面的基础上改了这里。改到现在我只想说,正确的方法到底是什么呢,不过想搭个博客实在太过困难了吧。
希望有人能给出一套切实可行的方法。
我使用的lnmp是最新的1.2,使用的typecho程序是最新的1.0版本。
谢谢大家的帮助
最后附上我的vhost的nginx那个配置文件
server
{
listen 80;
#listen [::]:80;
server_name www.kuiblog.com kuiblog.com *.kuiblog.com;
index index.html index.htm index.php default.html default.htm default.php;
root /home/wwwroot/www.kuiblog.com;
include typecho.conf;
#error_page 404 /404.html;
#location ~ [^/]\.php(/|$)
location ~ .*\.php(\/.*)*$
{
# comment try_files $uri =404; to enable pathinfo
#try_files $uri =404;
fastcgi_pass unix:/tmp/php-cgi.sock;
fastcgi_index index.php;
include fastcgi.conf;
include pathinfo.conf;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}
location ~ .*\.(js|css)?$
{
expires 12h;
}
access_log off;
}
搜索更多相关主题的帖子:
lnmp typecho