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

Detailed explanation of building PHP environment under CentOS5.5 (the best LAMP environment)

2025-03-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

This article describes in detail how to build a PHP environment under CentOS5.5 (the best LAMP environment), which can be referenced by those who need it.

This paper describes in detail the construction of PHP environment in Linux system. Because PHP is written by C language and initially runs in Linux system, Linux is the best environment for PHP.

For the software used in this article, please click this link to download.

CentOS5.5 is no longer officially available. It is recommended to use the above version of centos6:

Centos6.8 download address: / / www.iis7.com/softs/499124.html

Centos7.2 download address: / / www.iis7.com/softs/499109.html

[click to download]

In this paper, the author experimented with CentOS 5.5 installed by virtual machine (VMware). The installation is explained in detail below.

1. Preparatory work

First, please confirm whether Apache, MySQL and PHP have been installed in the Linux system you installed, and uninstall them first if you install them.

Check to see if it is installed (Apache as an example)

[root@gamejzy Linux] # rpm-qa | grep httpd

Note: rpm-qa is to view all the software that has been installed on this machine. Grep httpd is software that filters out httpd (apache)-related software. Note: grep php is to view PHP;grep mysql is to view MySQL

If a blank occurs after executing the command, the Apache software is not installed on the machine, and if a situation such as the following indicates that it has already been installed.

If it is as shown in the figure above, then you need to uninstall all three software.

The uninstall command is as follows:

[root@gamejzy Linux] # rpm-e httpd-2.2.3-43.el5.centos-nodeps

Note:-nodeps is a forced uninstall

Please make sure that your Linux system has gcc and Gmail + compilers installed

To check whether the installation is easy, type "gc" or "g +" on the command line, press tab, and see if there is a command display below.

If not, it doesn't matter. The method of installing gcc and Gmail + is very simple.

Install gcc:

Yum-y install gcc

Install the galleys:

Yum install gcc-c++

Copy all the software packages (mostly tar packages) to / tmp/lamp and decompress them

Extract the tar.gz command (php software as an example): tar zxvf php-5.2.6.tar.gz

When this command is executed, a php-5.2.6 folder is created under the current directory, and all extracted files are placed in the php-5.2.6 folder

Please extract all packages in the same way and delete all * .tar.gz files

[root@gamejzy lamp] # rm-rf * .gz

The above command deletes all .gz files

IV. Introduction of compilation and installation software package

The procedure for installing each source code package on the Linux system is as follows:

△ configuration (configure)

△ compilation (make)

△ installation (make install)

2. Build the LAMP environment (please install it in the order given below)

All the software here is installed under / usr/local

First, install libxml

Installation sequence: 1, enter the libxml directory; 2, configuration parameters (including installation path; dependent software; installation functions, etc.); 3, compilation; 4, installation. Note: all software packages are installed similarly

[root@gamejzy lamp] # cd libxml2-2.6.30 / [root@gamejzy libxml2-2.6.30] #. / configure-- prefix=/usr/local/libxml2

. / configure configuration parameter command for the package.-prefix indicates the specified installation directory. Most directories will be created automatically if they are no longer present, and some will not. We need to create them manually.

[root@gamejzy libxml2-2.6.30] # make & & make install http://www.iis7.com/b/ssyqdq/

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