How to build LAMP architecture
What this article shares with you is a detailed tutorial on building LAMP architecture. I believe most people don't know how to build it yet. In order to let you learn, I summed up the following contents. Without saying much, let's read on.
LAMP is an open source software architecture for building dynamic websites, which forms a powerful Web application platform with low investment cost in software projects, so it is concerned by the whole IT industry and used by a large number of companies.
1. There are two ways to build a LAMP architecture, one is to install online using yum, and the other is to compile and install based on the source code.
1) yum online installation
# yum install httpd httpd-devel mysql mysql-server mysql-devel php php-devel php-mysql-y
# service httpd restart
# service mysqld restart
2) install based on source code: LAP (CentOS+Apache+PHP): 192.168.153.142
Apache: https://blog.51cto.com/sky9896/2467218
MySQL: https://blog.51cto.com/sky9896/2467552
PHP: source code compilation and installation
[root@lap tools] # wget http://mirrors.sohu.com/php/php-5.3.28.tar.gz
-- 2020-01-20 10 1214 00 muri-http://mirrors.sohu.com/php/php-5.3.28.tar.gz
Parsing host mirrors.sohu.com (mirrors.sohu.com)... Failure: unknown name or service.
Wget: unable to resolve host address "mirrors.sohu.com"
[root@lap tools] # cat / etc/resolv.conf
# Generated by NetworkManager
Nameserver 202.101.224.68
Nameserver 8.8.8.8
[root@lap tools] # tar-zxf php-5.3.28.tar.gz
[root@lap tools] # cd php-5.3.28
[root@lap php-5.3.28] #
[root@lap php-5.3.28] # / configure-- prefix=/usr/local/php5-- with-config-file-path=/usr/local/php5/etc-- with-apxs2=/usr/local/apache2/bin/apxs-- with-mysql=mysqlnd-- with-mysqli=mysqlnd-- with-pdo-mysql=mysqlnd-- with-mysql=/usr/local/mysql/
.
Configure: error: xml2-config not found. Please check your libxml2 installation.
[root@lap php-5.3.28] # yum install libxml2 libxml2-devel-y
[root@lap php-5.3.28] # / configure-- prefix=/usr/local/php5-- with-config-file-path=/usr/local/php5/etc-- with-apxs2=/usr/local/apache2/bin/apxs-- with-mysql=mysqlnd-- with-mysqli=mysqlnd-- with-pdo-mysql=mysqlnd-- with-mysql=/usr/local/mysql/
.
Thank you for using PHP.
[root@lap php-5.3.28] # make
In file included from / tools/php-5.3.28/ext/standard/basic_functions.c:49:0:
/ tools/php-5.3.28/Zend/zend_language_parser.h:317:5: error: conflict with 'zendparse' type
Int zendparse (void)
/ tools/php-5.3.28/Zend/zend_globals_macros.h:35:5: note: 'zendparse' 's last statement is here
Int zendparse (void * compiler_globals)
Make: * * [ext/standard/basic_functions.lo] error 1
[root@lap Zend] # pwd
/ tools/php-5.3.28/Zend
[root@lap Zend] # vim zend_language_parser.h
# int zendparse (void); # you can delete this statement
Int zendparse (void * compiler_globals); # add this statement
[root@lap php-5.3.28] # make
.
Build complete.
Don't forget to run 'make test'.
[root@lap php-5.3.28] # make install
.
/ tools/php-5.3.28/build/shtool install-c ext/phar/phar.phar / usr/local/php5/bin
Ln-s-f / usr/local/php5/bin/phar.phar / usr/local/php5/bin/phar
Installing PDO headers: / usr/local/php5/include/php/ext/pdo/
[root@lap /] # vim / etc/php.ini
LoadModule php5_module modules/libphp5.so
DirectoryIndex index.php ndex.html index.htm
AddType application/x-httpd-php .php
[root@lap htdocs] # cat > / usr/local/apache2/htdocs/index.php
> EOF
two。 Configure Discuz PHP discussion installation: LAP (CentOS+Apache+PHP): 192.168.153.142
[root@lap tools] # unzip Discuz_X3.4_SC_UTF8.zip-d / usr/local/apache2/htdocs/
Bash: unzip: command not found
[root@lap tools] # yum install unzip
[root@lap tools] # unzip Discuz_X3.4_SC_UTF8.zip-d / usr/local/apache2/htdocs/
[root@lap bbs] # unzip Discuz_X3.4_SC_UTF8.zip-d / usr/local/apache2/htdocs/bbs/
[root@lap tools] # cd / usr/local/apache2/htdocs/bbs/
[root@lap bbs] # mv upload/*.
[root@lap bbs] # chmod 757-R data/ uc_server/ config/ uc_client/
3.MySQL database related configuration: 192.168.153.143
MySQL [(none)] > create database ultrax; # create initialization database first
MySQL [(none)] > grant all on ultrax.* to root@'192.168.153.142' identified by "sky9890"; # Licensing
# the above two steps are important, otherwise the following error will be reported:
4.Discuz PHP discusses the installation process: LAP (CentOS+Apache+PHP): 192.168.153.142
This is the end of the detailed tutorial on building LAMP architecture. I hope the above content can be of some help and learn more knowledge. If you think the article is good, you can share it for more people to see.