Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typecho 1.0 (14.10.10)启用返回首页出错SQLSTATE[HY000]: General error: 1 no such function: now #5

Closed
Gopfu opened this issue Apr 14, 2017 · 7 comments

Comments

@Gopfu
Copy link

Gopfu commented Apr 14, 2017

Typecho版本:1.0 (14.10.10)
GreenGrapes-1.1.1
移动GreenGrapes-1.1.1到usr/themes目录下并重命名
在外观设置中启动插件,返回网站报错:
SQLSTATE[HY000]: General error: 1 no such function: now

exception 'Typecho_Db_Query_Exception' with message 'SQLSTATE[HY000]: General error: 1 no such function: now' in /srv/var/Typecho/Db/Adapter/Pdo.php:105
Stack trace:
#0 /srv/var/Typecho/Db.php(352): Typecho_Db_Adapter_Pdo->query(Object(Typecho_Db_Query), Object(PDO), 1, 'SELECT')
#1 /srv/var/Typecho/Db.php(382): Typecho_Db->query(Object(Typecho_Db_Query), 1)
#2 /srv/usr/themes/green/functions.php(22): Typecho_Db->fetchAll(Object(Typecho_Db_Query))
#3 /srv/usr/themes/green/sidebar.php(30): theme_random_posts()
#4 /srv/var/Widget/Archive.php(1935): require('/srv/usr/themes...')
#5 /srv/usr/themes/green/index.php(58): Widget_Archive->need('sidebar.php')
#6 /srv/var/Widget/Archive.php(2018): require_once('/srv/usr/themes...')
#7 /srv/var/Typecho/Router.php(138): Widget_Archive->render()
#8 /srv/index.php(23): Typecho_Router::dispatch()
#9 {main}

@hongweipeng
Copy link
Owner

你表结构是不是改过了啊

@Gopfu
Copy link
Author

Gopfu commented Apr 14, 2017

没改过吧,我在docker alpine3.5里面安装好环境后,把typecho目录映射进去,然后安装再启用插件就这样,没改到表吧

@hongweipeng
Copy link
Owner

哦对,你用的数据库是MySQL吗

@Gopfu
Copy link
Author

Gopfu commented Apr 14, 2017

sqlite,忘写了

hongweipeng added a commit that referenced this issue Apr 14, 2017
@hongweipeng
Copy link
Owner

确认,sqlite没有now函数,已修复,感谢指出

@Gopfu
Copy link
Author

Gopfu commented Apr 14, 2017

建议用sqlite完整测试下

exception 'Typecho_Db_Query_Exception' with message 'SQLSTATE[HY000]: General error: 1 no such function: RAND' in /srv/var/Typecho/Db/Adapter/Pdo.php:105
Stack trace:
#0 /srv/var/Typecho/Db.php(352): Typecho_Db_Adapter_Pdo->query(Object(Typecho_Db_Query), Object(PDO), 1, 'SELECT')
#1 /srv/var/Typecho/Db.php(382): Typecho_Db->query(Object(Typecho_Db_Query), 1)
#2 /srv/usr/themes/green/functions.php(21): Typecho_Db->fetchAll(Object(Typecho_Db_Query))
#3 /srv/usr/themes/green/sidebar.php(30): theme_random_posts()
#4 /srv/var/Widget/Archive.php(1935): require('/srv/usr/themes...')
#5 /srv/usr/themes/green/index.php(58): Widget_Archive->need('sidebar.php')
#6 /srv/var/Widget/Archive.php(2018): require_once('/srv/usr/themes...')
#7 /srv/var/Typecho/Router.php(138): Widget_Archive->render()
#8 /srv/index.php(23): Typecho_Router::dispatch()
#9 {main}

hongweipeng added a commit that referenced this issue Apr 17, 2017
@hongweipeng
Copy link
Owner

已测

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants