search
HomeBackend DevelopmentPHP ProblemHow to compile and install php5.2

How to compile and install php5.2: 1. Download php; 2. Download php-fpm; 3. Install the required dependency packages; 4. Install PHP through "make install".

How to compile and install php5.2

The operating environment of this article: linux5.9.8 system, PHP5.2 version, DELL G3 computer

How to compile and install php5.2 ?

Compile and install php5.2.17

Previously, PHP installation was directly installed by YUM, but due to business needs of the company, the program requires php5.2.x. Supported, so I started compiling and installing

1. First download php

wget -c  http://us3.php.net/get/php-5.2.17.tar.gz/from/this/mirror

Because I am using lnmp here, I need to use the fastcgi manager. Here I am using php-fpm. php5.2 does not integrate php-fpm by default, so it needs to be patched. For the understanding, configuration and application of php-fpm, please see http://shuoduanzi.com/?p=288

2. Download php-fpm

wget -c  http://php-fpm.org/downloads/php-5.2.17-fpm-0.5.14.diff.gz

3. Install the required dependency packages. Here I install them with YUM

4. Okay, now look at the installation script

#!/bin/bash
############下载php和fpm补丁
cd /opt
wget -c  http://us3.php.net/get/php-5.2.17.tar.gz/from/this/mirror
tar zxvf php-5.2.17.tar.gz
cd php-5.2.17
wget -c  http://php-fpm.org/downloads/php-5.2.17-fpm-0.5.14.diff.gz
gzip -d php-5.2.17-fpm-0.5.14.diff.gz
patch -p1 < php-5.2.17-fpm-0.5.14.diff
############安装所依赖的库,其实这里还依赖其它库,但是在安装这些库的时候,本身它们也有依赖,它们所依赖的库也正是我们安装php所需要的库。
yum install libxml2 libxml2-devel \
openssl openssl-devel \
curl curl-devel \
libjpeg libjpeg-devel \
gd gd-devel \
bzip2 bzip2-devel \
libmcrypt libmcrypt-devel \
libmhash libmhash-devel \
mysql mysql-devel -y
###########开始安装php
cd /opt/php-5.2.17
./configure --prefix=/usr/local/php --enable-fastcgi --enable-zip --enable-fpm --enable-gd-native-ttf --with-config-file-path=/usr/local/php/etc --with-config-file-scan-dir=/usr/local/php/etc/php.d --with-bz2 --with-curl --with-libxml-dir --with-gd --with-jpeg-dir --with-freetype-dir --with-png-dir --with-mcrypt --with-mhash --enable-mbstring --with-kerberos --with-gettext --enable-bcmath --with-mysql --with-mysqli --with-sqlite --enable-pdo --with-pdo-mysql --with-openssl --enable-ftp --with-pear --with-zlib --enable-inline-optimization --enable-calendar --enable-magic-quotes --enable-sockets --enable-sysvsem --enable-sysvshm --enable-sysvmsg --disable-debug
make
make test
make install

Supplementary content:

This is the compilation method when I use nginx php, but in the case of apache php, you cannot add the two parameters --enable-fastcgi --enable-fpm, otherwise an error will be reported when apache starts after installation.

Recommended learning: "PHP Video Tutorial"

The above is the detailed content of How to compile and install php5.2. For more information, please follow other related articles on the PHP Chinese website!

Statement
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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

Atom editor mac version download

Atom editor mac version download

The most popular open source editor