How to install Php under linux

墨辰丷
Release: 2023-03-25 20:06:01
Original
1633 people have browsed it

This article mainly introduces how to install PHP under Linux. Interested friends can refer to it. I hope it will be helpful to everyone.

Linux installation php-5.4.5

1. Download php-5.4.5.tar.gz

2. Unzip

[root@test31~] tar -zxvf php-5.4.5.tar.gz

3. Enter the installation file Directory

[root@test31~] cd php-5.4.5

4. Execute

[root@test31 php-5.4 .5]# ./configure --prefix=/usr/local/php5 --with-apxs2=

/usr/local/apache/bin/apxs --with-mysql

Note: Green is marked as your apache installation directory

Problem occurred:

"

configure: error: xml2-config not found. Please check your libxml2 installation."

Check whether the libxm package is installed

[root@test31 php-5.4.5]# rpm -qa |grep libxml2

libxml2-2.6.26-2.1.12
libxml2-python-2.6.26-2.1.12

Reinstall libxml2 and libxml2-devel packages

yum install libxml2

yum install libxml2-devel -y (install this)

After installation, check whether the xml2-config file exists

[root@test31 php-5.4.5]# find / -name "xml2-config"

/usr/bin/xml2- config

Reinstall php if it exists

[root@test31 php-5.4.5]# ./configure --prefix=/ usr/local/php5 --with-apxs2=

/usr/local/apache/bin/apxs --with-mysql

If executed, an error is reported: "

Cannot find MySQL header files under yes

You need to specify the installation path of mysql

[root@test31 php-5.4.5]# ./configure --prefix=/ usr/local/php5 --with-apxs2=

/usr/local/apache/bin/apxs --with-mysql=/usr/local/mysql

The sign of successful installation is:

appears

------------- -------------------------------------------------- ------

| License:                                                                                    , you are bound by the terms of this license agreement. |
| If you do not agree with the terms of this license, you must abort |
| the installation process at this point. -------------------------------------------------- ----------------

Thank you for using PHP.

Related recommendations:

The most detailed linux Installation process of php

Linux installation php module --with-mysql --with-mysqli Do you have to install mysql?

Linux installation php error message Record

The above is the detailed content of How to install Php under linux. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template