Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to install and configure PHP to build LMAP architecture

2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

Introduction to PHP PHP, that is, "hypertext preprocessor", is a general open source scripting language. PHP is a scripting language executed on the server side, which is similar to C language and is a commonly used website programming language. According to the requirements of the dynamic website, as a language program, the specificity of PHP language gradually appears in the process of application, and its technical level will directly affect the running efficiency of the website. It is characterized by open source code and high similarity with general language such as C language in program design, so it is easy to understand and operable in the process of operation. Second, the preparatory work before installation this installation of PHP is to build LAMP architecture and achieve self-created web forum. About LAMP Architecture Linux+Apache+Mysql/MariaDB+Perl/PHP/Python is a group of open source software commonly used to build dynamic websites or servers, which are independent programs themselves, but because they are often used together, they become more and more compatible and form a powerful Web application platform. With the vigorous development of open source trend, open source LAMP has formed a tripod with J2EE and .net commercial software, and the project developed by this software has a low investment cost, so it has attracted the attention of the whole IT community. In terms of website traffic, more than 70% of the visit traffic is provided by LAMP, and LAMP is the most powerful website solution. Httpd and mysql must be installed before installing PHP, otherwise PHP will not be installed. 1. 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-devel2, unzip file package tar jxvf php-5.6.11.tar.bz2-C / opt III, manual compilation and installation of PHP 1, will be put into the php folder Configure 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 install3, copy related files, and configure them. Create a soft connection [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 vim / etc/httpd.conf / / to / etc/httpd.conf add the following two lines of code AddType application/x-httpd-php .phpAddType application/x-httpd-php-source .phpsDirectoryIndex index.html index.php// DirectoryIndex index.html followed by index.php

5. Modify htmlvi / usr/local/httpd/htdocs/index.htmlmv index.html index.php

6. Enable the httpd service service httpd stopservice httpd start

7. In the web page test, "http://192.168.111.134/index.php" is successful when the following page appears."

4. The installation process of the forum 1. Create the bbs library and assign the permissions of all tables in the bbs database to bbsusermysql-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)'/ / to the user Bbquser sets the password admin123 and sets all permissions All terminals can log in to 'mysql > GRANT all ON bbs.* TO' bbsuser'@'%' IDENTIFIED BY 'admin123' / / Refresh database / / mysql > flush privileges; mysql > exit

Discuz_X2.5_SC_UTF8.zip, the shared installation package of the mount point, decompresses unzip Discuz_X2.5_SC_UTF8.zip-d / optcp-r upload/ / usr/loacl/httpd/htdocs/bbs

3. Conduct web page testing "http://192.168.111.134/bbs""

The presence of a forum is a success, but full permissions are not enough

4. Change the master permission [root@localhost local] # cd / usr/local/httpd/htdocs/ [root@localhost htdocs] # lsbbs index.php [root@localhost htdocs] # cd bbs [root@localhost bbs] # ls-lash / change the host permission drwxr-xr-x. 2 root root 90 December 27 12:30 configdrwxr-xr-x. 13 root root 26 December 27 12:30 datadrwxr-xr-x. 6 root root 92 December 27 12:30 uc_client// enter [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// permission becomes drwxr-xr-x. 2 daemon root 90 December 27 12:30 configdrwxr-xr-x. 13 daemon root 26 December 27 12:30 datadrwxr-xr-x. 6 daemon root 92 December 27 12:30 uc_client

Chown-R daemon. / config

Chown-R daemon. / data

Chown-R daemon. / uc_client

Chown-R daemon. / uc_server/data

Refresh

These parameters were configured when the previous architecture was built. Fill in in turn

Finally, click next to automatically install

Refresh again or re-enter http://192.168.111.134/bbs/forum.php

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report