Install the required dependent Database: sudo? Apt-get? -Y? Install? Autoconf ?? Sudo? Apt-get? -Y? Install? Libxml2-dev ?? Sudo? Apt-get? -Y? Install? Bzip2 ?? Sudo? Apt-get? -Y? Install? Libcurl3-openssl-dev ?? Sudo? Apt-get? -Y? Install? Libcurl4-gnutls-dev ?? Sudo? Apt-get? -Y
Install the required dependent Database: sudo? Apt-get? -Y? Install? Autoconf ?? \ Sudo? Apt-get? -Y? Install? Libxml2-dev ?? \ Sudo? Apt-get? -Y? Install? Bzip2 ?? \ Sudo? Apt-get? -Y? Install? Libcurl3-openssl-dev ?? \ Sudo? Apt-get? -Y? Install? Libcurl4-gnutls-dev ?? \ Sudo? Apt-get? -Y
Install the required dependent libraries first:
Sudo? Apt-get? -Y? Install? Autoconf? &&? \
Sudo? Apt-get? -Y? Install? Libxml2-dev? &&? \
Sudo? Apt-get? -Y? Install? Bzip2? &&? \
Sudo? Apt-get? -Y? Install? Libcurl3-openssl-dev? &&? \
Sudo? Apt-get? -Y? Install? Libcurl4-gnutls-dev? &&? \
Sudo? Apt-get? -Y? Install? Libjpeg-dev? &&? \
Sudo? Apt-get? -Y? Install? Libpng-dev? &&? \
Sudo? Apt-get? -Y? Install? Libxpm-dev? &&? \
Sudo? Apt-get? -Y? Install? Libfreetype6-dev? &&? \
Sudo? Apt-get? -Y? Install? Libt1-dev? &&? \
Sudo? Apt-get? -Y? Install? Libmcrypt-dev? &&? \
Sudo? Apt-get? -Y? Install? Libmysql ++-dev? &&? \
Sudo? Apt-get? -Y? Install? Libxslt1-dev? &&? \
Sudo? Apt-get? -Y? Install? Libbz2-dev
Soft link library file:
Cd? /Usr/lib? &&? \
Ln? -S? /Usr/lib/x86_64-linux-gnu/libXpm. so ?.? &&? \
Ln? -S? /Usr/lib/x86_64-linux-gnu/libXpm. ?.? &&? \
Ln? -S? /Usr/lib/x86_64-linux-gnu/libXpm. so.4 ?.? &&? \
Ln? -S? /Usr/lib/x86_64-linux-gnu/libXpm. so.4.11.0 ?.? &&? \
Echo? 'Successful! '
Download the latest php source code, compile and install it:
Cd? /Opt? &&? \
Sudo? Mkdir? Src? &&? \
Cd? Src? &&? \
Sudo? Wget? Http://us1.php.net/distributions/php-5.4.14.tar.gz? &&? \
Sudo? Tar? Zxvf? Php-5.4.14.tar.gz? &&? \
Cd? Php-5.4.14? &&? \
Sudo ?. /Configure? \
-Prefix =/opt/php? \
-With-mysql = mysqlnd? \
-With-mysqli = mysqlnd? \
-With-pdo-mysql = mysqlnd? \
-With-config-file-path =/opt/php/etc? \
-With-zlib? \
-With-curl? \
-With-curlwrappers? \
-With-mcrypt? \
-With-gd? \
-With-openssl? \
-With-mhash? \
-With-xmlrpc? \
-With-jpeg-dir? \
-With-png-dir? \
-With-xpm-dir? \
-With-freetype-dir? \
-With-zlib-dir? \
-Enable-shared? \
-Enable-fpm? \
-Enable-xml? \
-Disable-rpath? \
-Enable-safe-mode? \
-Enable-bcmath? \
-Enable-shmop? \
-Enable-sysvsem? \
-Enable-inline-optimization? \
-Enable-mbregex? \
-Enable-mbstring? \
-Enable-gd-native-ttf? \
-Enable-pcntl? \
-Enable-sockets? \
-Enable-zip? \
-Enable-soap
If there is no problem, execute the last step of compilation and installation:
Sudo? Make? &&? Sudo? Make? Install
Original article address: Compile and install php5.4 or later in ubuntu. Thank you for sharing your thanks.