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 version 4.4.7 and 5.2.5 of CentOS PHP

2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

How to compile and install version 4.4.7 and version 5.2.5 of CentOS PHP, this article introduces the corresponding analysis and solution in detail, hoping to help more partners who want to solve this problem to find a more simple and easy way.

CentOS is a community of open source software contributors and users. It recompiles the RHEL source code and becomes one of the many communities that release new releases, and in the process of continuous development, the CentOS community continues to merge with other similar communities, making CentOS Linux gradually become the most widely used RHEL compatible version.

CentOS PHP compilation and installation

For CentOS PHP compilation, we choose to use the source code compilation installation method. Because we have to configure several different servers to use in the future. But we also need to install what is needed to install the GD library [install using YUM] yum install-y gd gd-devel libpng libpng-devel libjpeg libjpeg-devel freetype freetype-devel libxml2 first download two versions of the source package and extract cd / tmp wget http://cn.php.net/get/php-5.2.5.tar.gz/from/cn2.php.net/mirror wget http://cn.php.net/get/php-4.4.7.tar. Gz/from/cn2.php.net/mirror tar zxvf php-5.2.5.tar.gz tar zxvf php-4.4.7.tar.gz follows our CentOS PHP to compile 5.2.5 to apache 2. [compilation is a wait. It is strongly recommended that you compile while watching the disc!]

Cd / tmp/php-5.2.5. / configure-- prefix=/usr/local/php5-- with-apxs2=/usr/sbin/apxs-- with-gd-- enable-trace-vars-- with-zlib-with-mysql-- enable-mbstring=all-- disable-ipv6 make make install. You can also choose to compile 4.4.7 using CentOS PHP

The compilation parameters of cd / tmp/php-4.4.7. / configure-- prefix=/usr/local/php4-- with-apxs2=/usr/sbin/apxs-- with-gd-- enable-trace-vars-- with-zlib-with-mysql-- enable-mbstring=all-- disable-ipv6 make make install are not much different. After compiling.. Manually modify the configuration file of apache2 to support CentOS PHP compilation

Vi / etc/httpd/conf/httpd.conf needs to be changed as follows: generally, add a line of AddType application/x-httpd-php. CentOS PHP under # AddType application/x-tar. TGZ to find DirectoryIndex index.html. Changing this line to DirectoryIndex index.html index.htm index.php means that you specify the three home page files index.html index.htm index.php (of course you can also add other files)

In addition. If you compile with two CentOS PHP. Two CentOS PHP compilations will be loaded in the configuration file. You must cancel one. It should be understandable to find LoadModule php5_module / usr/lib/httpd/modules/libphp5.so LoadModule php4_module / usr/lib/httpd/modules/libphp4.so in the configuration file and casually add'#'to one of the lines. At this point, our apache2 supports CentOS PHP compilation.

The next step is our Apache 1.3.39. Similarly, we need to re-CentOS PHP compilation specific commands are: PHP5.2.5cd / tmp/php-5.2.5 make clean. / configure-- prefix=/usr/local/php5-- with-apxs=/usr/local/apache/bin/apxs-- with-gd-- enable-trace-vars-- with-zlib-with-mysql-- enable-mbstring=all-- disable-ipv6 make make install

PHP4.4.7

Cd / tmp/php-4.4.7 make clean. / configure-prefix=/usr/local/php4-with-apxs=/usr/local/apache/bin/apxs-with-gd-enable-trace-vars-with-zlib-with-mysql-enable-mbstring=all-disable-ipv6 make make install

Similarly; in the same way. Need to modify the configuration file of apache2 as. Modify the configuration file of apache1.3.39. They all work in the same way.

As we go further, CentOS PHP compiles using CGI mode. Because all WEBSERVER except APACHE requires PHP to compile 5.2.5cd / tmp/php-5.2.5 make clean in FAST-CGI mode CentOS PHP. / configure-- prefix=/usr/local/php5-cgi-- enable-force-cgi-redirect-- enable-fastcgi-- with-gd-- enable-trace-vars-- with-zlib-with-mysql-- enable-mbstring=all-- disable-ipv6 make make installPHP4.4.7

Cd / tmp/php-4.4.7 make clean. / configure-prefix=/usr/local/php4-cgi-enable-force-cgi-redirect-enable-fastcgi-with-gd-enable-trace-vars-with-zlib-with-mysql-enable-mbstring=all-disable-ipv6 make make install

Here we need to compile and install CentOS PHP to a different directory. This is also for convenience in the future. Install to / usr/local/php4-cgi and / usr/local/php5-cgi directories, respectively

This is the answer to the question about how to compile and install version 4.4.7 and version 5.2.5 of CentOS PHP. I hope the above content can be of some help to you. If you still have a lot of doubts to be solved, you can follow the industry information channel for more related knowledge.

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