Cài đặt php 5.3 từ source file trên Ubuntu. Setup php 5.3 from source on Ubuntu

Download và Copy source file vào thư mục: cd /usr/local/src/php5-build
cd php-5.3.29

apt-get install aspell libaspell-dev libxml2 libsnmp-base libsnmp15 libxml2-dev libbz2-dev libzip-dev curl libcurl4-openssl-dev libcurl3 libcurl3-gnutls libc-client-dev libfreetype6 libfreetype6-dev libjpeg62 libjpeg62-dev libpng12-0 libpng12-dev libmcrypt-dev libmcrypt4 libtidy-dev libxslt1-dev

need install apache prefox dev

configure: error: libXpm.(a|so) not found > locate libXpm > –with-libdir=/usr/lib/x86_64-linux-gnu

Cannot find imap library (libc-client.a


According to the Internets you need to install apache2-devel. The apx binary should then be located under /usr/bin/apxs2 or /usr/sbin/apxs2.
locate apxs

http://www.bictor.com/2014/05/08/compiling-installing-php-for-ubuntu-14-04/ >> install
https://www.rootusers.com/installing-apache-2-4-and-php-5-4-from-source/  >> config

sudo ./configure -with-config-file-path=/usr/share/php53 \
-with-pear=/usr/share/php53 \
-with-bz2 \
-with-curl \
-with-gd \
-enable-calendar \
-enable-mbstring \
-enable-bcmath \
-enable-sockets \
-with-libxml-dir=/usr \
-with-mysqli \
-with-mysql \
-with-openssl \
-with-regex=php \
-with-zlib \
sudo make
sudo make install

locate apache2 | grep module > /usr/lib/apache2/modules

sudo cp libs/libphp5.so /usr/lib/apache2/modules

sudo cp /usr/local/src/php5-build/php-5.3.29/php.ini-production /usr/share/php53/php.ini

sudo gedit /etc/apache2/httpd.conf
LoadModule php5_module  modules/libphp5.so
AddType application/x-http-php  .php
AddType text/html .php
AddHandler php5-script    .php
DirectoryIndex  index.php  index.html

sudo service apache2 restart

#sudo gedit /usr/share/php53/php.ini
short_open_tag = On
display_errors = Off
display_startup_errors = Off
upload_max_filesize = 20M
max_execution_time = 300
date.timezone =    ‘Asia/Bangkok’



Go to Help->Install New Software
Type php in search box
Choose “–All Available Sites–” from Work With drop down.
Wait until it gives the list.
Click on programming languages -> select PDT and follow the steps.

wordwrap plugin

# sudo cp /etc/apache2/sites-available/default /etc/apache2/sites-available/premier.conf
# gedit /etc/apache2/sites-available/premier.conf
# gedit hosts
# a2ensite premier.conf
# service apache2 reload

Unikey – ibus
# install ibusunikey
Search application ibus > start with ibus keyboard input method > input method > add Tiengviet Unikey
# restart ibus daemon : ibus-daemon -rd

Leave a Reply

Your email address will not be published.