缘起宇轩阁 2019-12-28
[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
[ php-5.6.11]# cp php.ini-development /usr/local/php5/php.ini [ 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
出现论坛即成功,但是全权限不够
[ local]# cd /usr/local/httpd/htdocs/ [ htdocs]# ls bbs index.php [ htdocs]# cd bbs [ 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 //输入 [ bbs]# chown -R daemon ./config [ bbs]# chown -R daemon ./data [ bbs]# chown -R daemon ./uc_client [ 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