Lamp architecture Deployment--Compile and install PHP

Source: Internet
Author: User
Tags gettext install php

Introduction to LAMP Architecture

LAMP Architecture is one of the most mature application models of enterprise websites, which refers to a complete set of system and related software, which can provide dynamic Web site service and its application development environment. The word lamp is an abbreviation, including: Linux operating system, Apache Web server, MySQL database server, PHP (or Perl, Python) Web programming language.

In the four constituent components of the lamp platform, each component is part of a critical application. Through the past more than 10 years of development, the compatibility between the components has been continuously improved, collaboration and stability has been enhanced, can build a very good Web application system. The main functions of each component are as follows.

l ( platform) Linux: As the basis of the lamp architecture, provides the operating system to support the Web site, with three other components to provide better stability, compatibility (AMP components also support Windows, UNIX and other platforms).

l   ( front desk) Apache: As the front end of the lamp architecture, is a powerful, stable Web server program, The server directly to the user to provide website access, send Web pages, pictures and other file content.

l   ( backstage) MySQL: As the back end of the lamp architecture, it is a popular open source relational database system. In the Enterprise website, business system and other applications, a variety of account information, product information, customer information, business data, etc. can be stored in the MySQL database, other programs can be queried through SQL statements, change this information.

l ( Intermediate Connection) Php/perl/python: As the three programming languages for developing dynamic Web pages, it is responsible for interpreting dynamic Web pages and providing the development and operating environment for Web applications. PHP is a widely used, open-source, multi-purpose scripting language that can be embedded in HTML, especially for Web application development.


Preparatory work

Operating System:Linux Redhat6.5

Related packages: Link: https://pan.baidu.com/s/10OVPYMnHAoQjA_DSMZjMLQ Password: jwkw

PHP Installation Steps

1. First install the GD library and the GD Library Association program ( used to process and generate pictures)

Yum install–y libjpeg-devel libpng-devel freetype-devel zlib-devel gettext-devel libxpm-devel libxml2-devel Fontconfig-devel Openssl-devel Bzip2-devel

2. Unzip the GD package file to the/opt/directory

Tar zxvf gd-2.0.35.tar.gz-c/opt

3. Configure, compile, and install GD

3.1 Enter the GD directory

cd/opt/gd/2.0.35

3.2 Configuration

./configure--PREFIX=/USR/LOCAL/GD

3.3 Compiling and installing

Make && make install

4. Unzip the PHP package file into the/opt/directory

Tar xjvf php-5.4.5.tar.bz2-c/opt

5. Configure, compile, and install PHP

5.1 go to the PHP directory

cd/opt/php-5.4.5/

5.2 Configuration

./configure \

--prefix=/usr/local/php \

--WITH-APXS2=/USR/LOCAL/APACHE/BIN/APXS \

--WITH-GD \

--with-mysql=/usr/local/mysql \

--WITH-CONFIG-FILE-PATH=/ETC \

--enable-sqlite-utf8 \

--with-zlib-dir \

--with-libxml-dir \

--with-freetype-dir \

--with-jpeg-dir \

--with-png-dir \

--WITH-TTF \

--with-iconv \

--WITH-OPENSSL \

--with-gettext \

--enable-mbstring \

--ENABLE-GD-NATIVE-TTF \

--enable-gd-jis-conv \

--enable-static \

--enable-zend-multibyte \

--enable-inline-optimization \

--enable-sockets \

--ENABLE-SOAP \

--ENABLE-FTP \

--disable-ipv6

5.3 Compiling and installing

Make && make install

6. Configure the Apache service to support PHP

Vim/usr/local/apache/conf/httpd.conf

# find AddType application/x-gzip gz. tgz below to add the following:

AddType application/x-httpd-php. php

AddType Application/x-httpd-php-source. Phps

# Re -Check if the following is present, such as the query is not back to the 5th step to reinstall

LoadModule Php5_module modules/libphp5.so

# Add index.php Adjust home page file Settings

DirectoryIndex index.php index.html

7. Restart the httpd service

Service httpd Restart

8. Create a PHP test page

vim/usr/local/apache/htdocs/index.php

# Add the following to the index.php file

<?php

Phpinfo ();

?>

9. Delete the original home page file

Rm–rf/usr/local/apache/htdocs/index.html

Ten. Use the browser to access the IP address to open the Apache home page to view the contents of the PHP test page, for example, on behalf of PHP has been installed, Apache has supported PHP


Lamp architecture Deployment--Compile and install PHP

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.