Compile and install the PHP5.3 development environment in Ubuntu12

Source: Internet
Author: User
This article will share with you the methods and steps for compiling and installing the PHP5.3 development environment under Ubuntu12. It is very detailed and recommended to you. If you need it, you can refer to it.

This article will share with you the methods and steps for compiling and installing the PHP5.3 development environment under Ubuntu12. It is very detailed and recommended to you. If you need it, you can refer to it.

Recently, the project encountered a problem where a source code must use PHP5.3, but the current Ubuntu version is 5.4. After downgrading, There will be various strange problems and there will be no way at last, you can only compile PHP5.3 on Ubuntu12.04server step by step, which is more complicated and shared.

Install Apache2.2

The Code is as follows:


Sudo apt-get install apache2-y

Then install MySQL5.5

The Code is as follows:


Sudo apt-get install mysql-server-5.5-y

Next, compile the dependent environment:

The Code is as follows:


Sudo apt-get install gcc g ++ autoconf build-essential-y

Related lib support libraries:

The Code is as follows:


Sudo apt-get install libxml2 libxml2-dev libevent-1.4-2 libevent-dev bzip2 libbz2-dev libcurl3-gnutls libcurl4-gnutls-dev libpng12-0 libpng12-dev lib000062 libjpeg62-dev libfreetype6 libfreetype6-dev libmcrypt4 libmcrypt-dev zlib1g-dev libtidy-dev libmysqlclient-dev-y

Installation:

The Code is as follows:


. /Configure -- prefix =/usr/local/php -- with-mcrypt -- with-gettext -- with-mysql -- with-gd -- with-jpeg-dir -- with-png-dir -- with-curl -- with-freetype-dir -- enable-gd-native-ttf -- enable-mbstring -- enable-sockets -- with-pdo-mysql -- enable-fpm -- with-zlib -- enable-zip -- with-bz2 -- enable-bcmath -- with-tidy -- with-fpm-user = daemon -- with-fpm-group = daemon
Sudo make
Sudo make install

Then install cli and dev:

The Code is as follows:


Sudo apt-get install php5-cli php5-dev

Finally, enable Apache2 support:

The Code is as follows:


Sudo apt-get install libapache2-mod-php5

The final result is complete ~

The above is all the content of this article. I hope you will like it.

Please take a moment to share your article with your friends or leave a comment. Thank you for your support!

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.