Home > Article > Backend Development > Compile and install PHP5.3 development environment under Ubuntu12, ubuntu12php5.3_PHP tutorial
Recently, the project encountered a cheating thing. A source code must use PHP5.3, but now Ubuntu automatically The version I brought is 5.4. After downgrading, various strange problems will occur. In the end, I have no choice but to compile PHP5.3 on Ubuntu 12.04 server step by step. It is more cumbersome and I want to share it.
Install Apache2.2
Copy code The code is as follows:
sudo apt-get install apache2 -y
Then install MySQL5.5
Copy code The code is as follows:
sudo apt-get install mysql-server-5.5 -y
Then there is the compilation dependency environment :
Copy code The code is as follows:
sudo apt-get install gcc g autoconf build-essential -y
Related lib support library :
Copy code 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 libjpeg62 libjpeg62-dev libfreetype6 libfreetype6-dev libmcrypt4 libmcrypt-dev zlib1g -dev libtidy-dev libmysqlclient-dev -y
Installation:
Copy code 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:
Copy code The code is as follows:
sudo apt-get install php5-cli php5-dev
Finally enable Apache2 support:
Copy code The code is as follows:
sudo apt-get install libapache2-mod-php5
Finally it’s done~
The above is the entire content of this article, I hope you all like it.
Please take a moment to share the article with your friends or leave a comment. We will sincerely thank you for your support!