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

How to compile and install php5.2

2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

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

This article is to share with you about how to compile and install php5.2, the editor thinks it is very practical, so I share it with you to learn. I hope you can get something after reading this article.

Php5.2 compilation and installation methods: 1, download php;2, download php-fpm;3, install the required dependent packages; 4, through the "make install" to install PHP.

This article operating environment: 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 installations were installed directly by YUM, but the company needed php5.2.x to support the program due to business needs, so it began to compile and install.

1. Download php first

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

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

two。 Download php-fpm

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

3. Install all the dependent packages needed, here I install them in YUM

4. All right, now look at the installation script.

#! / bin/bash# download php and fpm patch cd / optwget-c http://us3.php.net/get/php-5.2.17.tar.gz/from/this/mirrortar zxvf php-5.2.17.tar.gzcd php-5.2.17wget-c http://php-fpm.org/downloads/php-5.2.17-fpm-0.5.14.diff.gzgzip-d php-5.2.17 -fpm-0.5.14.diff.gzpatch-p1 < php-5.2.17-fpm-0.5.14.diff# installation dependent libraries In fact, there are other libraries here, but when installing these libraries, they also have dependencies, and the libraries they rely on are exactly the ones we need to install 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 # install phpcd / 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 enable-sysvmsg disable-debugmakemake testmake install

Supplementary content:

This is how I compiled it when I was in nginx+php, but I can't add the two parameters-- enable-fastcgi-- enable-fpm in the case of apache+php, otherwise the apache startup will report an error after it is installed.

The above is how to compile and install php5.2. The editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.

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

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report