标签:手工编译 论坛 html 数据库配置 string info 目录 配置 img
搭建LMAP架构之 PHP 配置(最终篇)[TOC]
yum -y install gd libpng libpng-devel pcre pcre-devel libxml2-devel libjpeg-devel
tar jxvf php-5.6.11.tar.bz2 -C /opt
cd /opt/php-5.6.11
./configure --prefix=/usr/local/php5 --with-gd --with-zlib --with-apxs2=/usr/local/httpd/bin/apxs --with-mysql=/usr/local/mysql --with-config-file-path=/usr/local/php5 --enable-mbstring
make && make install
[root@localhost php-5.6.11]# cp php.ini-development /usr/local/php5/php.ini
[root@localhost php-5.6.11]# ln -s /usr/local/php5/bin/* /usr/local/bin/
vim /etc/httpd.conf
//在空白行添加下面两行代码
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
DirectoryIndex index.html index.php
// DirectoryIndex index.html 后面添加 index.php
vi /usr/local/httpd/htdocs/index.html
<?php
phpinfo();
?>
mv index.html index.php
service httpd stop
service httpd start
mysql -u root -p
//创建一个数据库//
mysql> CREATE DATABASE bbs;
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| bbs |
| mysql |
| performance_schema |
| test |
+--------------------+
5 rows in set (0.00 sec)
‘//给用户bbquser设置密码admin123并设置所有权限,所有终端都可登录‘
mysql> GRANT all ON bbs.* TO ‘bbsuser‘@‘%‘ IDENTIFIED BY ‘admin123‘;
//刷新数据库//
mysql>flush privileges;
mysql>exit
unzip Discuz_X2.5_SC_UTF8.zip -d /opt
cp -r upload/ /usr/loacl/httpd/htdocs/bbs
出现论坛即成功,但是全权限不够
[root@localhost local]# cd /usr/local/httpd/htdocs/
[root@localhost htdocs]# ls
bbs index.php
[root@localhost htdocs]# cd bbs
[root@localhost bbs]# ls -l
//改变宿主权限
drwxr-xr-x. 2 root root 90 12月 27 12:30 config
drwxr-xr-x. 13 root root 216 12月 27 12:30 data
drwxr-xr-x. 6 root root 92 12月 27 12:30 uc_client
//输入
[root@localhost bbs]# chown -R daemon ./config
[root@localhost bbs]# chown -R daemon ./data
[root@localhost bbs]# chown -R daemon ./uc_client
[root@localhost bbs]# chown -R daemon ./uc_server/data
//权限就变成
drwxr-xr-x. 2 daemon root 90 12月 27 12:30 config
drwxr-xr-x. 13 daemon root 216 12月 27 12:30 data
drwxr-xr-x. 6 daemon root 92 12月 27 12:30 uc_client
chown -R daemon ./config
chown -R daemon ./data
chown -R daemon ./uc_client
chown -R daemon . /uc_server/data
标签:手工编译 论坛 html 数据库配置 string info 目录 配置 img
原文地址:https://blog.51cto.com/14557584/2462375