Typecho安装常见问题汇总,记录一下,帮助有缘人

1.File not found.

访问首页,出现以下以下错误
2023-07-28T06:39:26.png
检查日志发现
2023-07-28T06:39:54.png
解决办法:配置PHP文件根目录
2023-07-28T06:40:05.png

2.Mysql is not available

2023-07-28T06:43:54.png
解决办法:安装php-pdo_mysql扩展

3.ctype 未定义

2023-07-28T06:45:51.png
解决办法:安装php-ctype扩展

4.mb_strlen 未定义

2023-07-28T06:47:11.png
解决办法:安装php-mbstring扩展

5.只有首页能打开,其他页面无法打开

2023-07-28T06:48:24.png
解决办法:在nginx配置文件配置pathinfo
2023-07-28T06:49:20.png

6.session 未定义

2023-07-28T06:51:33.png
解决办法:安装php-session扩展

7.token 未定义

2023-07-28T06:52:28.png
解决办法:安装php-tokenizer扩展

总结:需要安装的php扩展:

php82-ctype
php82-gd
php82-mbstring
php82-mysqlnd
php82-pdo_mysql
php82-session
php82-tokenizer

nginx相关键配置文件:

server {
    listen       80;
    listen  [::]:80;
    server_name  localhost;

    access_log  /var/log/nginx/host.access.log  main;

    location / {
        root   /var/www/html;
        index  index.php index.html index.htm;  #增加索引页
        if (!-f $request_filename) {  #rewrite相关配置
            rewrite (.*) /index.php;
        }
    }
    # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
    #
    location ~ \.php(\/.*)*$ {
        root           /var/www/html; #文档根目录
        fastcgi_pass   php3:9000;
        fastcgi_index  index.php;
        #脚本路径
        fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;  
        include        fastcgi_params;
    }
}

"""
#
# 批量刷日志配置,config_log.py
#
# @author lk
# @copyright Copyright (c) 2023 lk team (http://www.uqn.cn)
# @license GNU General Public License 2.0
# @version 1.0.0(23.7.11)
#
"""

from netmiko import ConnectHandler
n = 0
cmds = ['info-center loghost 10.25.1.17 facility local6']  # 配置日志
with open('ip.txt') as f:       # 配套文件,每行一个IP
    for ips in f.readlines():
        ip = ips.strip()
        n = n + 1
        connection_info = {
                'device_type': 'huawei',
                'ip': ip,
                'username': 'h3cadmin',
                'password': '******',
        }
        with ConnectHandler(**connection_info) as conn:
            output = conn.send_config_set(cmds)
            # 以下命令为模拟用户保存
            saveput = conn.send_command(command_string='save',
expect_string=r'Are you sure?',strip_prompt=False,strip_command=False)
            saveput = conn.send_command(command_string='y',
expect_string=r'[flash:/startup.cfg]',strip_prompt=False,strip_command=False) 
            saveput = conn.send_command(command_string='startup.cfg',
expect_string=r'overwrite?',strip_prompt=False,strip_command=False)
            saveput = conn.send_command(command_string='y',
expect_string=r'>',strip_prompt=False,strip_command=False)
            print(f'{n} 已经成功登陆交换机 {ip},日志配置:{output} {saveput}')