[TOC]
Article Directory
1. Introduction to PHP
2. Preparations before installation
3. Manual Compilation and Installation of PHP
IV. Installation Process of Forum
1. Introduction to PHP
PHP, which is used to interpret dynamic Web page files, provides a development and running environment for Web applications.
PHP is a widely used open source, multi-purpose scripting language that can be embedded in HTML for Web application development
PHP has better web page execution speed, supports the vast majority of popular databases, and multiple operating systems.
2. Preparations before installation
PHP is installed to build a LAMP architecture and create your own web forums.
You must install httpd and mysql before installing PHP, otherwise PHP will not be installed.
Apache, Mysql compilation installed in the previous blog, blog link: Apache configuration to build LMAP architecture (last)
Mysql Database Configuration for LMAP Architecture (Part Two)
1. First install gd, libpng, libpng-devel, pcre, pcre-devel, libxml2-devel and libjpeg-deve through yum.
yum -y install \ gd \ libpng \ libpng-devel \ pcre \ pcre-devel \ libxml2-devel \ libjpeg-devel
2. Unzip File Compression Pack
tar jxvf php-5.6.11.tar.bz2 -C /opt
3. Manual Compilation and Installation of PHP
1. Will go into php folder for configuration
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
2. Compile and Install
make && make install
3. Copy related files, configure them, and create soft connections
[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/
4. Add in/etc/httpd.conf
vim /etc/httpd.conf //Add the following two lines of code to the blank line AddType application/x-httpd-php .php AddType application/x-httpd-php-source .phps DirectoryIndex index.html index.php // Add index.php after DirectoryIndex index.html
5. Modify html
vi /usr/local/httpd/htdocs/index.html <?php phpinfo(); ?> mv index.html index.php
6. Open httpd service
service httpd stop service httpd start
7. Testing on the Web http://192.168.111.134/index.php"
Success occurs on the following page
IV. Installation Process of Forum
1. Create a bbs library and assign permissions to bbsuser for all tables in the bbs database
mysql -u root -p //Create a database// mysql> CREATE DATABASE bbs; mysql> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | bbs | | mysql | | performance_schema | | test | +--------------------+ 5 rows in set (0.00 sec) '//Set password admin123 to user bbquser and set all permissions, all terminals can log on ' mysql> GRANT all ON bbs.* TO 'bbsuser'@'%' IDENTIFIED BY 'admin123'; //Refresh database// mysql>flush privileges; mysql>exit
Dismount Point Shared Installation Package Discuz_X2.5_SC_UTF8.zip Unzip
unzip Discuz_X2.5_SC_UTF8.zip -d /opt cp -r upload/ /usr/loacl/httpd/htdocs/bbs
3. Perform web page tests" http://192.168.111.134/bbs"
Success occurs when a forum appears, but full access is insufficient
4. Change of sovereignty
[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 //Change host permissions 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 //input [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 //Permissions become 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