Home > php教程 > php手册 > Ubuntu12下编译安装PHP5.3开发环境,ubuntu12php5.3

Ubuntu12下编译安装PHP5.3开发环境,ubuntu12php5.3

WBOY
Release: 2016-06-13 09:09:21
Original
972 people have browsed it

Ubuntu12下编译安装PHP5.3开发环境,ubuntu12php5.3

最近项目遇到一个坑爹的事情,一个源码必须使用PHP5.3,但是现在Ubuntu上自带的版本是5.4,降级之后会出各种奇怪的问题,最后没办法,只能一步步在Ubuntu12.04server上自己编译PHP5.3,比繁琐,共享之。

安装Apache2.2

复制代码 代码如下:
sudo apt-get install apache2 -y

然后安装MySQL5.5

复制代码 代码如下:
sudo apt-get install mysql-server-5.5 -y

接着就是编译依赖环境

复制代码 代码如下:
 sudo apt-get install gcc g++ autoconf build-essential -y
 

相关的lib支持库

复制代码 代码如下:
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 libjpeg62 libjpeg62-dev libfreetype6 libfreetype6-dev libmcrypt4 libmcrypt-dev zlib1g-dev libtidy-dev libmysqlclient-dev  -y

安装:

复制代码 代码如下:
./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

然后安装cli和dev:

复制代码 代码如下:
sudo apt-get install php5-cli php5-dev

最后开启Apache2支持:

复制代码 代码如下:
sudo apt-get install libapache2-mod-php5

最后就大功告成了~

以上所述就是本文的全部内容了,希望大家能够喜欢。

请您花一点时间将文章分享给您的朋友或者留下评论。我们将会由衷感谢您的支持!

Related labels:
source:php.cn
Statement of this Website
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
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template