转自:https://www.jb51.net/article/194017.htm

先修改php的配置文件php.ini,将disable_function里面如下几个函数名删除掉
system, exec, passthru

测试:

<?php
  $shell = "ls -la";
  echo "<pre>";
  system($shell, $status);
  echo "</pre>";
  //注意shell命令的执行结果和执行返回的状态值的对应关系
  $shell = "<font color='red'>$shell</font>";
  if( $status ){
    echo "shell命令{$shell}执行失败";
  } else {
    echo "shell命令{$shell}成功执行";
  }
?>

2020082411444918.png

一:进入“外观”——“编辑当前外观”

1.编辑function.php文档,在function themeConfig下添加可修改变量代码

$bei = new Typecho_Widget_Helper_Form_Element_Text('bei', NULL, NULL, _t('工信部备案号'), _t('留空则不显示'));
$form->addInput($bei->addRule('xssCheck', _t('工信部备案号不能使用特殊字符')));

2.编辑footer.php文档,在footer元素下添加显示代码

<div class="blog-text-center"><a href="https://beian.miit.gov.cn/" target="_blank" rel="nofollow"><?php $this->options->bei(); ?></a></div>

二:进入“外观”——“设置外观”
即可添加ICP备案号

参考文章:https://www.wangfuchao.com/605/

1:安装时无法连接数据库
手动创建typecho数据库即可

2:登录帐号后提示404
到nginx的配置文件夹找到enable-php.conf
修改为如下

location ~ [^/]\.php(/|$)
{
    #try_files $uri =404;
    fastcgi_pass  unix:/tmp/php-cgi.sock;
    fastcgi_index index.php;
    include fastcgi.conf;
    include pathinfo.conf;
}

参考文章:https://qq52o.me/2230.html