Notes for upgrading php and GD libraries in linux

Source: Internet
Author: User
Upgrade php and GD library notes in linux-Linux Enterprise Application-Linux server application information. The following is a detailed description. Php-5.1.2.tar.gz

Software packages required for installing php
(Libxml2 is required to install php5. The reason is why you need to stay in perl .)
Libxml2-2.6.19.tar.gz
Libxslt-1.1.15.tar.gz
ActivePerl-5.8.8.817-i686-linux-2.2.17-gcc-257965.rpm
Curl-7.15.0.tar.gz

Software packages required by the GD library
(Some people say that the PHP source package contains GD2.0.28 and zlib,
You only need to install three support packages for GD: jpg, png, and freetype, but we still download them)
Gd-2.0.33.tar.gz
Freetype-2.1.10.tar.gz
Jpegsrc.v6b.tar.gz
Libpng-1.2.8.tar.gz
Zlib-1.2.3.tar.gz

// Install jpeg
[Root @ as4 local] # mkdir-p/home/servers/users 6
[Root @ as4 local] # mkdir-p/home/servers/users 6/bin
[Root @ as4 local] # mkdir-p/home/servers/users 6/lib
[Root @ as4 local] # mkdir-p/home/servers/users 6/include
[Root @ as4 local] # mkdir-p/home/servers/users 6/man
[Root @ as4 local] # mkdir-p/home/servers/users 6/man1
[Root @ as4 local] # mkdir-p/home/servers/users 6/man/man1

# Tar-zvxf restart src.v6b.tar.gz
# Cd jpeg-6b
#./Configure -- prefix =/home/servers 6/-- enable-shared -- enable-static
# Make; make install


B. Install libpng
# Cd ..
# Tar-zvxf libpng-1.2.8.tar.gz
# Cd libpng-1.2.8
# Cp scripts/makefile. std makefile
# Make; make install


C. Install freetype
# Cd ..
# Tar-zvxf freetype-2.1.10.tar.gz
# Cd freetype-2.1.10
# Mkdir-p/home/servers/freetype
#./Configure -- prefix =/home/servers/freetype
# Make; make install


D. Install zlib
# Cd ..
# Tar-zxvf zlib-1.2.3.tar.gz
# Cd zlib.1.2.3
#./Configure
# Make; make install


E. Install the GD library
# Cd ..
# Tar-zvxf gd-2.0.33.tar.gz
# Mkdir-p/home/servers/gd2
# Cd gd-2.0.33
#. /Configure -- prefix =/home/servers/gd2 -- with-jpeg =/home/servers/users 6/-- with-png =/usr/local/lib/-- with-zlib = /usr/local/lib/-- with-freetype =/home/servers/freetype/
# Make; make install

E. Install the Curl Library
# Cd ..
# Tar-zxvf curl-7.15.0.tar.gz
# Mkdir-p/home/servers/curl
#./Configure -- prefix =/home/servers/curl
# Make; make install

5. Install php5. php5 must support libxml2!
A. Install libxml2
# Cd ..
# Tar-zxf libxml2-2.6.19.tar.gz
# Cd libxml2-2.6.19
# Mkdir-p/home/servers/libxml2
#./Configure -- prefix =/home/servers/libxml2
# Make; make install

B. Install libxslt (optional)
# Cd ..
# Tar-zxf libxslt-1.1.15.tar.gz
# Mkdir-p/home/servers/libxslt
# Cd libxslt-1.1.15
#./Configure -- prefix =/home/servers/libxslt -- with-libxml-prefix =/home/servers/libxml2
# Make; make install

C. Install php5
# Cd ..
# Tar-zvxf php-5.1.2.tar.gz
# Mkdir-p/usr/local/php
# Cd php-5.05
#. /Configure -- prefix =/home/servers/php5 -- with-apxs2 =/home/servers/apache/bin/apxs -- with-mysql =/home/servers/mysql522 -- with-curl = /home/servers/curl -- enable-ftp -- with-libxml-dir =/home/servers/libxml2 -- with-expat-dir =/usr/lib -- enable-soap -- -gd =/home/servers/gd2/-- with-jpeg-dir =/home/servers/users 6/-- with-zlib-dir =/usr/local/lib/-- -png =/usr/local/lib/-- with-freetype-dir =/home/servers/freetype/
# Make
# Make install
# Cp php. ini-dist/usr/local/php/lib/php. ini (don't forget it)

During PHP5.2 compilation, if you encounter

Checking for MySQL support... yes
Checking for specified location of the MySQL UNIX socket... no
Checking for MySQL UNIX socket location... no
Configure: error: Cannot find libmysqlclient_r under/usr/local/mysql.
Note that the MySQL client library is not bundled anymore!

Note that you may use the -- with-mpm module when compiling APACHE. Add -- enable-thread-safe-client when compiling MYSQL.

This is an improvement in PHP5.2. MYSQL does not need to enable secure threads in versions earlier than PHP5.2.0.
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.