Snippets

Sergiy Ilchuk Install php 5.3 on Ubuntu 16.04

Created by Sergiy Ilchuk last modified
Install phpbrew https://github.com/phpbrew/phpbrew/wiki/Quick-Start

#to build 5.3.24
sudo phpbrew install 5.3.24  +bz2 +calendar +cli +gd +ctype +dom +iconv +fileinfo +filter +ipc +json +mbregex +mbstring +mhash +mcrypt +pcntl +pcre +pdo +phar +posix +readline +sockets +tokenizer +xml +curl +zip +mysql +debug +apxs2

#/etc/apache2/mods-available/php5.load 
#file must contain 
LoadModule php5_module        /usr/lib/apache2/modules/libphp5.3.24.so
AddType application/x-httpd-php .php

#enable module for apache2
sudo a2dismod php5.6 ; sudo a2dismod php7.0 ; sudo a2enmod php5 ; sudo service apache2 restart

#to install extensions
phpbrew use php5.3.24
phpbrew ext install gd --with-gd=shared,/usr --enable-gd-native-ttf --with-gmp=shared,/usr --with-jpeg-dir=shared,/usr --with-xpm-dir=shared,/usr/X11R6 --with-png-dir=shared,/usr --with-freetype-dir=shared,/usr --with-vpx-dir=shared,/usr

phpbrew ext install --pecl xdebug 2.2.7
phpbrew ext enable xdebug

add to any .ini file(better xdebug.ini) which is loaded in phpinfo()
[Xdebug]
zend_extension=/home/machine/.phpbrew/php/php-5.3.24/lib/php/extensions/debug-non-zts-20090626/xdebug.so
xdebug.remote_enable = 1
xdebug.remote_port = 9000
xdebug.idekey = PHPSTORM
xdebug.max_nesting_level = 512
xdebug.file_link_format = phpstorm://open?%f:%l

Comments (0)