Docker安装zblog个人网站

1、下载源码包,上传到nginx的网站根目录下,解压
1
unzip Z-BlogPHP_1_5_2_1935_Zero.zip
2、进入mysql容器创建数据库并授权
1
2
docker exec -it lnmptest-mysql /bin/bash
mysql -u root -p123456
1
2
3
4
mysql> create database zblog;
mysql> grant all on zblog.* to zblog@'%' identified by '123456';
mysql> grant all on zblog.* to zblog@'localhost' identified by '123456';
mysql> flush privileges;
3、浏览器访问IP安装
1
http://192.168.1.88

ik200I.png

ik2B7t.png

ik2fns.png

ikRSN6.png

4、按照上图中的提示去创建文件,然后点击完成
1
vim c_option.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<?php
return array (
'ZC_CLOSE_WHOLE_SITE' => false,
'ZC_DATABASE_TYPE' => 'mysqli',
'ZC_SQLITE_NAME' => '',
'ZC_SQLITE_PRE' => 'zbp_',
'ZC_MYSQL_SERVER' => 'lnmptest-mysql',
'ZC_MYSQL_USERNAME' => 'zblog',
'ZC_MYSQL_PASSWORD' => '123456',
'ZC_MYSQL_NAME' => 'zblog',
'ZC_MYSQL_CHARSET' => 'utf8',
'ZC_MYSQL_PRE' => 'zbp_',
'ZC_MYSQL_ENGINE' => 'MyISAM',
'ZC_MYSQL_PORT' => '3306',
'ZC_MYSQL_PERSISTENT' => false,
'ZC_PGSQL_SERVER' => 'localhost',
'ZC_PGSQL_USERNAME' => 'postgres',
'ZC_PGSQL_PASSWORD' => '',
'ZC_PGSQL_NAME' => '',
'ZC_PGSQL_CHARSET' => 'utf8',
'ZC_PGSQL_PRE' => 'zbp_',
'ZC_PGSQL_PORT' => '5432',
'ZC_PGSQL_PERSISTENT' => false,
'ZC_YUN_SITE' => '',
);
5、上一步点击完成之后报错了

ikRn4f.png

解决办法:

1、登录nginx容器
1
docker exec -it lnmptest-nginx /bin/bash
2、授权
1
chown -R nginx:nginx /usr/local/nginx/
3、登录zblog后台
4、清空缓存并重新编译模板

ikRKC8.png

博主QQ:1012405802
技术交流QQ群:830339411
版权声明:网站内容有原创和转载,如有侵权,请联系删除,谢谢!!
感谢打赏,93bok因你们而精彩!!(支付宝支持花呗)
0%