PHP5.3 under Debian (Squeeze)

From HostmasterWiki
Jump to: navigation, search
Error creating thumbnail: File missing
Warning:
This Version of PHP has reached EOL. There will be no more security updates. Therefor it is strongly advised to not install it.


Prepare[edit]

$ sudo apt-get install make gcc 
$ wget -O php-5.3.29.tar.bz2 http://de2.php.net/get/php-5.3.29.tar.bz2/from/this/mirror
$ tar xvfj php-5.3.29.tar.bz2

$ sudo apt-get install \
libssl-dev \
libxml2-dev \
libcurl4-openssl-dev \
libjpeg62-dev \
libpng12-dev \
libxpm-dev \
libfreetype6-dev \
libc-client2007e-dev \
libmcrypt-dev \
libxslt1-dev \
libtidy-dev \
libbz2-dev \
g++

Compile & Install[edit]

The following instructions will install PHP5.3 into a non-standard folder so it can run in parallel with other PHP versions.

CLI[edit]

$ ./configure \
--prefix=/opt/php53 \
--disable-cgi \
--with-config-file-path=/opt/php53/etc/php5/cli \
--with-libxml-dir \
--with-openssl \
--with-pcre-regex \
--with-regex=php \
--with-zlib \
--with-bz2 \
--enable-calendar \
--with-curl \
--enable-exif \
--enable-ftp \
--with-gd \
--with-jpeg-dir \
--with-png-dir \
--with-xpm-dir=/usr \
--with-freetype-dir \
--enable-gd-native-ttf \
--enable-gd-jis-conv \
--with-gettext \
--with-imap \
--with-imap-ssl \
--with-kerberos \
--enable-bcmath \
--enable-mbstring \
--with-mcrypt \
--with-mysql=mysqlnd \
--with-mysqli=mysqlnd \
--with-pdo-mysql=mysqlnd \
--enable-shmop \
--enable-soap \
--enable-sockets \
--with-xmlrpc \
--with-xsl \
--enable-zip \
--with-iconv-dir \
--with-pear \
--with-tidy \
--enable-sqlite-utf8 \
--enable-pcntl

$ make
$ sudo make install
$ make clean

FPM[edit]

$ ./configure \
--prefix=/opt/php53 \
--disable-cli \
--disable-cgi \
--without-pear \
--enable-fpm \
--with-config-file-path=/opt/php53/etc/php5/fpm \
--with-libxml-dir \
--with-openssl \
--with-pcre-regex \
--with-regex=php \
--with-zlib \
--with-bz2 \
--enable-calendar \
--with-curl \
--enable-exif \
--enable-ftp \
--with-gd \
--with-jpeg-dir \
--with-png-dir \
--with-xpm-dir=/usr \
--with-freetype-dir \
--enable-gd-native-ttf \
--enable-gd-jis-conv \
--with-gettext \
--with-imap \
--with-imap-ssl \
--with-kerberos \
--enable-bcmath \
--enable-mbstring \
--with-mcrypt \
--with-mysql=mysqlnd \
--with-mysqli=mysqlnd \
--with-pdo-mysql=mysqlnd \
--enable-shmop \
--enable-soap \
--enable-sockets \
--with-xmlrpc \
--with-xsl \
--enable-zip \
--with-iconv-dir \
--with-tidy \
--enable-sqlite-utf8

$ make
$ sudo make install
$ make clean

$ sudo cp sapi/fpm/init.d.php-fpm /etc/init.d/php53-fpm
$ sudo chmod +x /etc/init.d/php53-fpm
$ sudo update-rc.d php53-fpm defaults

Configure[edit]

Notice[edit]

Compiling and Installing PHP extensions[edit]

$ phpize
$ ./configure --with-php-config=/opt/php53/bin/php-config
$ make
$ sudo make install

You may want to add: /opt/php53/lib/php to your php.ini include_path