Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- apt-get install -y libcurl4 curl libcurl4-openssl-dev libc-client2007e libc-client2007e-dev libssl1.1 libssl-dev \
- libsnmp-dev comerr-dev krb5-multidev libgssrpc4 libkadm5clnt-mit11 libkadm5srv-mit11 libkdb5-9 libpam0g-dev libpci-dev \
- libsensors4-dev libudev-dev libwrap0-dev zlib1g-dev
- #php5.3 libraries/tools for compile
- apt-get install -y build-essential autoconf automake autotools-dev re2c cmake cmake-data libjsoncpp1 librhash0
- apt-get install -y apache2-dev libbz2-dev libssl1.0.0 bzip2-doc libapr1-dev libaprutil1-dev libexpat1-dev \
- libldap2-dev libsctp-dev libsctp1 uuid-dev
- apt-get install -y libedit-dev libenchant-dev libfreetype6 libfreetype6-dev enchant hunspell-en-us libbsd-dev \
- libenchant1c2a libglib2.0-bin libglib2.0-dev libglib2.0-dev-bin libhunspell-1.6-0 libncurses5-dev libpng-dev \
- libpng-tools libtinfo-dev pkg-config python3-distutils
- apt-get install -y libgeoip-dev libgmp3-dev libgmp-dev unixodbc-dev libaspell-dev libpspell-dev \
- geoip-bin libgmpxx4ldbl odbcinst odbcinst1debian2
- apt-get install -y libkrb5-dev libltdl7 libltdl-dev libmcrypt4
- apt-get install -y libmagickwand-dev \
- gir1.2-freedesktop gir1.2-gdkpixbuf-2.0 gir1.2-rsvg-2.0 javascript-common libcairo-gobject2 libcairo-script-interpreter2 \
- libcairo2-dev libdjvulibre-dev libdjvulibre-text libdjvulibre21 libexif-dev libexif-doc libexif12 libfontconfig1-dev \
- libgdk-pixbuf2.0-0 libgdk-pixbuf2.0-bin libgdk-pixbuf2.0-common libgdk-pixbuf2.0-dev libice-dev libice6 libilmbase-dev \
- libilmbase12 libjbig-dev libjpeg-turbo8-dev libjs-jquery liblcms2-dev liblqr-1-0-dev \
- liblzma-dev libmagickcore-6-arch-config libmagickcore-6-headers libmagickcore-6.q16-3-extra libmagickcore-6.q16-dev \
- libmagickwand-6-headers libmagickwand-6.q16-dev libopenexr-dev libopenexr22 libpixman-1-dev libpthread-stubs0-dev \
- librsvg2-2 librsvg2-common librsvg2-dev libsm-dev libsm6 libtiff-dev libtiff5-dev libtiffxx5 libwmf-dev libwmf0.2-7 \
- libx11-dev libx11-doc libxau-dev libxcb-render0-dev libxcb-shm0-dev libxcb1-dev libxdmcp-dev libxext-dev libxml2-dev \
- libxrender-dev libxt-dev libxt6 x11-common x11proto-core-dev x11proto-dev x11proto-xext-dev xorg-sgml-doctools \
- xtrans-dev
- apt-get install -y libmcrypt-dev libmhash-dev libmhash2 libpam0g-dev libpng-dev html2text
- apt-get install -y libpq-dev libreadline-dev libsasl2-dev libsnmp-dev libsqlite3-dev
- apt-get install -y libtidy-dev libxml2 libxml2-dev libxslt1-dev libz3-dev libzip4 gettext libz3-4
- apt-get install -y xfonts-base xfonts-75dpi fonts-liberation libfontenc1 xfonts-encodings xfonts-utils libxpm4 libxpm-dev
- apt-get install -y librecode-dev librecode0 librecode-dev librecode0
- # 18.04 only, otherwise you are missing icu-config made avaialble via icu-devtools
- apt-get install -y --allow-downgrades libicu-dev=60.2* icu-devtools=60.2* gir1.2-harfbuzz-0.0 libgraphite2-dev libharfbuzz-dev libharfbuzz-gobject0 libharfbuzz-icu0 libicu-le-hb-dev libicu-le-hb0 libiculx60
- apt-get install -y libtool-bin # 18.04 only?
- #install different versions of gcc - is easier to compile php with gcc 5.5.0
- apt-get install -y gcc-5
- rm /usr/bin/gcc
- update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 55
- update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 74
- update-alternatives --set gcc /usr/bin/gcc-5
- mkdir -p /usr/include/x86_64-linux-gnu/curl/include
- ln -s /usr/include/x86_64-linux-gnu/curl /usr/include/x86_64-linux-gnu/curl/include/curl
- cd /tmp
- wget https://www.openssl.org/source/openssl-1.0.2s.tar.gz
- tar -xzf openssl-1.0.2s.tar.gz
- cp -r openssl-1.0.2s /usr/src
- cd /usr/src/openssl-1.0.2s
- ./config --prefix=/usr/local --openssldir=/usr/local/openssl shared
- make -j$(nproc) 2>&1 | tee build.make.openssl.log
- make install
- make clean
- #make custom paths for php compile
- mkdir -p /usr/local/openssl/include
- ln -s /usr/local/include/openssl /usr/local/openssl/include/openssl
- mkdir -p /usr/local/openssl/lib
- #ln -s /usr/src/openssl-1.0.2s /usr/local/openssl/lib/x86_64-linux-gnu
- ln -s /usr/local/lib /usr/local/lib/x86_64-linux-gnu
- cd /tmp
- wget https://museum.php.net/php5/php-5.3.29.tar.bz2
- tar -xjf php-5.3.29.tar.bz2
- cp -r php-5.3.29 /usr/src/
- export APACHE_RUN_USER=httpservice
- export APACHE_RUN_GROUP=httpusers
- export APACHE_PID_FILE=/var/run/apache2/apache2$SUFFIX.pid
- export APACHE_RUN_DIR=/var/run/apache2$SUFFIX
- export APACHE_LOCK_DIR=/var/lock/apache2$SUFFIX
- export APACHE_LOG_DIR=/var/log/apache2$SUFFIX
- export EXTENSION_DIR=/usr/lib/php/5.3/20090626
- cd /usr/src/php-5.3.29
- # the following modules need to be compiled after, as they require openssl 1.1 vs the main php program which requires openssl 1.0
- # cannot seem to force compile c-client /w openssl 1.0 to make imap work
- # probably can build later after compiling base php and switching system package versions back to openssl 1.1 default packages
- # snmp must be skipped at main compile for same reason
- # --with-imap=shared,/usr/include
- # --with-snmp
- # --enable-intl
- # causes apache php module segfaults if compiling with main php program
- # --enable-ftp
- #note: curl seems to compile fine as part of the main php with --with-curl=shared,/usr/include/x86_64-linux-gnu/curl
- #but i have decided to compile it below instead, as it appears to be able to compile with openssl 1.1 that way despite main program using 1.0
- # for phar to avoid this error message:
- # PEAR package PHP_Archive not installed: generated phar will require PHP's phar extension be enabled.
- # run pear install PHP_Archive-alpha once pear is working
- #note: cannot include zlib (shared or static) if using --enable-mysqlnd=shared
- #either that, or --enablemysqlnd=shared is not possible while using it for mysql/mysqli
- ./configure --prefix=/usr/lib/php/5.3 --with-pear=/usr/lib/php/5.3/pear --with-config-file-path=/etc/php/5.3/apache2 --with-config-file-scan-dir=/etc/php/5.3/apache2/conf.d \
- --with-apxs2=/usr/bin/apxs2 --disable-embed --disable-fpm --disable-cgi --disable-cli \
- --with-libdir=lib/x86_64-linux-gnu --disable-gcov \
- --enable-inline-optimization --enable-maintainer-zts --enable-short-tags --enable-zend-multibyte --enable-libgcc \
- --with-openssl=shared,/usr/local --with-zlib=/usr \
- --enable-pdo --with-pgsql=shared,/usr/bin --with-pdo-pgsql=shared,/usr/bin \
- --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-mysql-sock=/var/run/mysqld/mysqld.sock --with-pdo-mysql=mysqlnd \
- --with-sqlite3=shared,/usr --with-pdo-sqlite=sqlite3 --with-unixODBC=shared,/usr --with-pdo-odbc=unixODBC,/usr \
- --disable-ctype --disable-dom --disable-fileinfo --disable-filter --disable-hash --disable-json \
- --disable-posix --disable-simplexml --disable-tokenizer --disable-xmlreader --disable-xmlwriter \
- --build=x86_64-pc-linux-gnu | tee build.configure.apache2.min.log
- make -j$(nproc) 2>&1 | tee build.make.apache2.min.log
- make install
- libtool --finish /usr/src/php-5.3.29/libs
- make clean
- #apparently need --disable-mysqlnd-compression-support if building --with-zlib=shared,/usr so we remove shared
- ./configure --prefix=/usr/lib/php/5.3 --with-pear=/usr/lib/php/5.3/pear --with-config-file-path=/etc/php/5.3/cgi --with-config-file-scan-dir=/etc/php/5.3/cgi/conf.d \
- --disable-embed --disable-fpm --enable-cgi --disable-cli \
- --with-libdir=lib/x86_64-linux-gnu --disable-gcov \
- --enable-inline-optimization --enable-maintainer-zts --enable-short-tags --enable-zend-multibyte --enable-libgcc \
- --with-openssl=shared,/usr/local --with-zlib=/usr \
- --enable-pdo --with-pgsql=shared,/usr/bin --with-pdo-pgsql=shared,/usr/bin \
- --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-mysql-sock=/var/run/mysqld/mysqld.sock --with-pdo-mysql=mysqlnd \
- --with-sqlite3=shared,/usr --with-pdo-sqlite=sqlite3 --with-unixODBC=shared,/usr --with-pdo-odbc=unixODBC,/usr \
- --disable-ctype --disable-dom --disable-fileinfo --disable-filter --disable-hash --disable-json \
- --disable-posix --disable-simplexml --disable-tokenizer --disable-xmlreader --disable-xmlwriter \
- --build=x86_64-pc-linux-gnu | tee build.configure.cgi.min.log
- make -j$(nproc) 2>&1 | tee build.make.cgi.min.log
- make install
- make clean
- #need to remove --disable-xml or add --without-pear here, so probably best to not use --disable-xml in any SAPIs
- ./configure --prefix=/usr/lib/php/5.3 --with-pear=/usr/lib/php/5.3/pear --with-config-file-path=/etc/php/5.3/cli --with-config-file-scan-dir=/etc/php/5.3/cli/conf.d \
- --disable-embed --disable-fpm --disable-cgi --enable-cli \
- --with-libdir=lib/x86_64-linux-gnu --disable-gcov \
- --enable-inline-optimization --enable-maintainer-zts --enable-short-tags --enable-zend-multibyte --enable-libgcc \
- --with-openssl=shared,/usr/local --with-zlib=/usr \
- --enable-pdo --with-pgsql=shared,/usr/bin --with-pdo-pgsql=shared,/usr/bin \
- --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-mysql-sock=/var/run/mysqld/mysqld.sock --with-pdo-mysql=mysqlnd \
- --with-sqlite3=shared,/usr --with-pdo-sqlite=sqlite3 --with-unixODBC=shared,/usr --with-pdo-odbc=unixODBC,/usr \
- --disable-ctype --disable-dom --disable-fileinfo --disable-filter --disable-hash --disable-json \
- --disable-posix --disable-simplexml --disable-tokenizer --disable-xmlreader --disable-xmlwriter \
- --build=x86_64-pc-linux-gnu | tee build.configure.cli.min.log
- make -j$(nproc) 2>&1 | tee build.make.cli.min.log
- #skip all subsequent calls to make test from asking if you want to send a failure report to the PHP team
- export NO_INTERACTION=true
- make test | tee build.maketest.cli.min.log
- make install
- make clean
- #note: If you end up going back and recompiling PHP for any of the above SAPIs,
- #apparently you need to do CLI again so that it is the last one done, as it seems to affect phpize environment variables
- #and then you start getting this error any time you try to use the make test command when building a module:
- #ERROR: Cannot run tests without CLI sapi.
- update-alternatives --install /usr/bin/php php /usr/lib/php/5.3/bin/php 53
- update-alternatives --install /usr/bin/php-cgi php-cgi /usr/lib/php/5.3/bin/php-cgi 53
- update-alternatives --install /usr/bin/php-config php-config /usr/lib/php/5.3/bin/php-config 53
- update-alternatives --install /usr/bin/phar phar /usr/lib/php/5.3/bin/phar 53
- update-alternatives --install /usr/bin/phar.phar phar.phar /usr/lib/php/5.3/bin/phar.phar 53
- update-alternatives --install /usr/bin/phpize phpize /usr/lib/php/5.3/bin/phpize 53
- update-alternatives --set php /usr/lib/php/5.3/bin/php
- update-alternatives --set php-cgi /usr/lib/php/5.3/bin/php-cgi
- update-alternatives --set php-config /usr/lib/php/5.3/bin/php-config
- update-alternatives --set phar /usr/lib/php/5.3/bin/phar
- update-alternatives --set phar.phar /usr/lib/php/5.3/bin/phar.phar
- update-alternatives --set phpize /usr/lib/php/5.3/bin/phpize
- mkdir /usr/lib/php/5.3/sapi
- touch /usr/lib/php/5.3/sapi/apache2 /usr/lib/php/5.3/sapi/cgi /usr/lib/php/5.3/sapi/cli
- ln -s /usr/lib/php/5.3/bin/phpize /usr/bin/phpize5.3
- #ln -s /usr/lib/php/5.3/bin/phpconfig /usr/bin/phpconfig5.3
- ln -s /usr/lib/php/5.3/bin/php-config /usr/bin/php-config5.3
- ln -s /usr/lib/php/5.3/bin/php-cgi /usr/bin/php-cgi5.3
- mkdir -p /etc/php/5.3/mods-available /etc/php/5.3/cli/conf.d /etc/php/5.3/cgi/conf.d /etc/php/5.3/apache2/conf.d
- echo extension=openssl.so > /etc/php/5.3/mods-available/openssl.ini
- phpenmod -v 5.3 -s ALL openssl
- #first fix /usr/share/php/PEAR/Installer.php and Downloader.php for php 5.3 by finding "...()[...]"
- #and manually editing to replace with $bob = ...(); and $bob[...]
- #example: error_get_last()["message"] becomes $bob["message"] with $bob=error_get_last(); added a line above
- #or scp from another server with native php 5.3
- #scp /usr/share/php/PEAR/Installer.php web18git1.aplus:/usr/share/php/PEAR/Installer.php
- #scp /usr/share/php/PEAR/Downloader.php web18git1.aplus:/usr/share/php/PEAR/
- pear update-channels
- pecl update-channels
- pear upgrade --force
- #pecl upgrade --force
- #install PHP_Archive and APC from PECL, we will enable them later:
- printf "\n" | pear install PHP_Archive-alpha
- printf "\n" | pecl install apc
- #modules which can be built without any configuration customizations
- #create temporary functions to make compiling/testing the simpler modules easy
- function makephpmod(){
- cd /usr/src/php-5.3.29/ext/$1
- phpize
- ./configure
- make -j$(nproc) 2>&1 | tee build.make.$1.log
- make test | tee build.maketest.$1.log
- make install
- make clean
- }
- function maketestphpmod(){
- cd /usr/src/php-5.3.29/ext/$1
- phpize
- ./configure
- make -j$(nproc) 2>&1 | tee build.make.$1.log
- make test | tee build.maketest.$1.log
- make clean
- }
- #link the GMP header file so that GMP can compile as expected in Ubuntu
- ln -s /usr/include/x86_64-linux-gnu/gmp.h /usr/include/gmp.h
- #compile all the simple PHP modules
- for i in bcmath bz2 calendar ctype dba dom exif fileinfo filter gettext gmp hash json mbstring mcrypt pcntl posix pspell readline ; do makephpmod $i; done
- for i in recode shmop simplexml snmp soap sockets sysvmsg sysvsem sysvshm tidy tokenizer xmlreader xmlrpc xmlwriter xsl wddx zip ; do makephpmod $i; done
- # for i in ftp ; do maketestphpmod $i; done
- #commands which sometimes fix errors with old packages, more relevant if compiling with gcc > 5.5.0:
- #unneeded in our case
- #phpize
- #aclocal
- #libtoolize --force
- #autoheader
- #autoconf
- #autoreconf --force --install
- #modules which must be built with configuration customizations or which fail no tests
- cd /usr/src/php-5.3.29/ext/curl
- phpize
- ./configure --with-curl=shared,/usr/include/x86_64-linux-gnu/curl | tee build.configure.curl.log
- make -j$(nproc) 2>&1 | tee build.make.curl.log
- make test | tee build.maketest.curl.log
- make install
- make clean
- cd /usr/src/php-5.3.29/ext/ftp
- phpize
- ./configure --enable-ftp --with-libdir=lib/x86_64-linux-gnu --with-openssl-dir=/usr
- make -j$(nproc) 2>&1 | tee build.make.ftp.log
- make test | tee build.maketest.ftp.log
- make install
- make clean
- apt-get install -y quilt
- cd /tmp
- wget http://archive.ubuntu.com/ubuntu/pool/main/libj/libjpeg6b/libjpeg6b_6b2.orig.tar.gz
- tar -xf libjpeg6b_6b2.orig.tar.gz
- wget http://archive.ubuntu.com/ubuntu/pool/main/libj/libjpeg6b/libjpeg6b_6b2-2.debian.tar.xz
- tar -xf libjpeg6b_6b2-2.debian.tar.xz
- mv debian jpeg-6b2/
- cp -r jpeg-6b2 /usr/src/
- cd /usr/src/jpeg-6b2
- export QUILT_PATCHES=debian/patches
- quilt push -a
- ./configure --prefix=/usr/local
- make -j$(nproc)
- make test
- make install
- cd /tmp
- wget http://archive.ubuntu.com/ubuntu/pool/main/libp/libpng/libpng_1.2.54.orig.tar.xz
- #wget http://archive.ubuntu.com/ubuntu/pool/main/libp/libpng/libpng_1.2.54-1ubuntu1.debian.tar.xz
- wget http://archive.ubuntu.com/ubuntu/pool/main/libp/libpng/libpng_1.2.54-1ubuntu1.1.debian.tar.xz
- tar -xf libpng_1.2.54.orig.tar.xz
- tar -xf libpng_1.2.54-1ubuntu1.1.debian.tar.xz
- mv debian libpng-1.2.54/
- cp -r libpng-1.2.54 /usr/src/
- cd /usr/src/libpng-1.2.54/
- export QUILT_PATCHES=debian/patches
- quilt push -a
- ./configure --prefix=/usr/local/include
- #if using gss > 5.5.0
- autoreconf -fi
- make -j$(nproc)
- #make test
- make install
- make clean
- cd /tmp
- apt-get source libxpm-dev libx11-dev
- cp -r /tmp/libxpm-3.5.12 /usr/src/
- cp -r /tmp/libx11-1.6.4 /usr/src/
- cd /usr/src/libxpm-3.5.12
- ./configure --prefix=/usr/local
- make -j$(nproc)
- #make test
- make install
- make clean
- cd /usr/src/libx11-1.6.4
- ./configure --prefix=/usr/local
- make -j$(nproc)
- #make test
- make install
- make clean
- cd /tmp
- #wget https://launchpad.net/ubuntu/+archive/primary/+sourcefiles/libgd2/2.0.36~rc1~dfsg-6ubuntu2.1/libgd2_2.0.36~rc1~dfsg.orig.tar.gz
- wget http://archive.ubuntu.com/ubuntu/pool/main/libg/libgd2/libgd2_2.0.36~rc1~dfsg.orig.tar.gz
- #wget http://archive.ubuntu.com/ubuntu/pool/main/libg/libgd2/libgd2_2.0.36~rc1~dfsg-6ubuntu2.debian.tar.gz
- wget http://archive.ubuntu.com/ubuntu/pool/main/libg/libgd2/libgd2_2.0.36~rc1~dfsg-6ubuntu2.4.debian.tar.gz
- tar -xf libgd2_2.0.36~rc1~dfsg.orig.tar.gz
- #tar -xf libgd2_2.0.36~rc1~dfsg-6ubuntu2.debian.tar.gz
- tar -xf libgd2_2.0.36~rc1~dfsg-6ubuntu2.4.debian.tar.gz
- mv debian libgd2_2.0.36~rc1~dfsg.orig
- cp -r libgd2_2.0.36~rc1~dfsg.orig /usr/src/
- cd /usr/src/libgd2_2.0.36~rc1~dfsg.orig
- export QUILT_PATCHES=debian/patches
- quilt push -a
- #if using gcc 5.5.0
- autoreconf -fi
- ./configure --prefix=/usr/local/lib/libgd --with-jpeg=/usr/local --with-png=/usr/local --with-xpm=/usr/local --libdir=local/lib | tee build.configure.log
- make -j$(nproc)
- #make test
- make install
- make clean
- rm -r /usr/local/lib/libgd/php
- mkdir -p /usr/local/lib/libgd/php
- cp /usr/local/lib/libgd/include/* /usr/local/lib/libgd/php
- cp /usr/local/lib/libgd/lib/* /usr/local/lib/libgd/php
- #ln -s /usr/lib/x86_64-linux-gnu/libXpm.so /usr/local/lib/
- #ln -s /usr/include/X11/xpm.h /usr/local/include/
- cd /usr/src/php-5.3.29/ext/gd
- phpize
- #--with-xpm-dir=/usr/local
- #./configure --with-gd=shared,/usr/local/lib/libgd/php --with-jpeg-dir=/usr/local --with-png-dir=/usr/local --with-xpm-dir=/usr \
- #--with-zlib-dir=/usr --with-freetype-dir=/usr --enable-gd-native-ttf --with-libdir=lib/x86_64-linux-gnu \
- #--build=x86_64-pc-linux-gnu | tee build.configure.log
- #manually merge this fix from https://github.com/php/php-src/pull/1507/files to resolve
- #GD issue with apache2 SAPI causing phpinfo() crashes with "undefined symbol: gdJpegGetVersionString"
- #more info: https://github.com/php/php-src/pull/1507 and https://github.com/oerdnj/deb.sury.org/issues/111
- #first back up file just in case
- cp libgd/gd_compat.c gd_compat.c.backup
- sed -i 's/#include "php_config.h"/#ifdef HAVE_CONFIG_H\n#include "config.h"\n#endif/' libgd/gd_compat.c
- #may need to run these as well, as configure apparently ignored --with-libdir on one of my tests with gcc 5.5.0:
- ln -s /usr/local/lib/libjpeg.so.62.0.0 /usr/lib/x86_64-linux-gnu/libjpeg.so.62.0.0
- ln -s /usr/local/lib/libjpeg.so.62 /usr/lib/x86_64-linux-gnu/libjpeg.so.62
- #you will know if this is the case if you proceed and make test result skips every test and says the following:
- #Warning: PHP Startup: Unable to load dynamic library '/usr/src/php-5.3.29/ext/gd/modules/gd.so' - libjpeg.so.62: cannot open shared object file: No such file or directory in Unknown on line 0
- ./configure --with-gd=shared,/usr/local/lib/libgd/php --with-jpeg-dir=/usr/local --with-png-dir=/usr/local --with-xpm-dir=/usr/local \
- --with-zlib-dir=/usr --with-freetype-dir=/usr --enable-gd-native-ttf --with-libdir=local/lib | tee build.configure.log
- make -j$(nproc) 2>&1 | tee build.make.gd.log
- make test | tee build.maketest.gd.log
- make install
- make clean
- #comes built into main php compile, should probably skip
- #cd /usr/src/php-5.3.29/ext/iconv
- #phpize
- #./configure
- #make -j$(nproc) 2>&1 | tee build.make.iconv.log
- #make test | tee build.maketest.iconv.log
- #make install
- #make clean
- cd /usr/src/php-5.3.29/ext/imap
- phpize
- ./configure --with-kerberos --with-imap-ssl
- make -j$(nproc) 2>&1 | tee build.make.imap.log
- make test | tee build.maketest.imap.log
- make install
- make clean
- #builds with many test errors, but we can install from pecl instead, possibly requiring a big downgrade to libicu55 first
- #cd /usr/src/php-5.3.29/ext/intl
- #phpize
- #./configure
- #make -j$(nproc) 2>&1 | tee build.make.intl.log
- #make test | tee build.maketest.intl.log
- #make install
- #make clean
- cd /usr/src/php-5.3.29/ext/ldap
- phpize
- ./configure --with-ldap=/usr --with-ldap-sasl --with-libdir=lib/x86_64-linux-gnu
- make -j$(nproc) 2>&1 | tee build.make.ldap.log
- make test | tee build.maketest.ldap.log
- make install
- make clean
- cd /usr/src/php-5.3.29/ext/mssql
- apt-get install -y freetds-common freetds-dev libct4 libsybdb5
- phpize
- ./configure --with-libdir=lib/x86_64-linux-gnu
- make -j$(nproc) 2>&1 | tee build.make.mssql.log
- make test | tee build.maketest.mssql.log
- make install
- make clean
- #make test says "warning: #warning Readline module will *NEVER* be thread-safe"
- cd /usr/src/php-5.3.29/ext/readline
- phpize
- ./configure
- make -j$(nproc) 2>&1 | tee build.make.readline.log
- make test | tee build.maketest.readline.log
- make clean
- #cd /usr/src/php-5.3.29/ext/xmlrpc
- #if using gcc > 5.5.0, you probably have to compile this with these flags set first, otherwise process is normal (then unset them)
- #export CC="gcc"
- #export CFLAGS="-O2 -fno-delete-null-pointer-checks -finline-functions -fomit-frame-pointer"
- #phpize
- #./configure
- #make -j$(nproc) 2>&1 | tee build.make.xmlrpc.log
- #make test | tee build.maketest.xmlrpc.log
- #make install
- #make clean
- #unset CC
- #unset CFLAGS
- #old version of imagick can be used if manually downloaded from pecl
- #pecl command will think none are available
- cd /tmp
- wget wget https://pecl.php.net/get/imagick-3.4.0RC1.tgz
- tar -xf imagick-3.4.0RC1.tgz
- cp -r imagick-3.4.0RC1 /usr/src/
- cd /usr/src/imagick-3.4.0RC1
- phpize
- ./configure
- make -j$(nproc) 2>&1 | tee build.make.imagick.log
- make test | tee build.maketest.imagick.log
- make install
- make clean
- #echo "extension=imagick.so" > /etc/php/5.3/mods-available/imagick.ini
- #phpenmod -v 5.3 -s ALL imagick
- cd /tmp
- wget https://xdebug.org/files/xdebug-2.2.7.tgz
- tar -xf xdebug-2.2.7.tgz
- cp -r xdebug-2.2.7 /usr/src/
- cd /usr/src/xdebug-2.2.7
- phpize
- ./configure --with-php-config=/usr/lib/php/5.3/bin/php-config
- make -j$(nproc) 2>&1 | tee build.make.xdebug.log
- make test | tee build.maketest.xdebug.log
- make install
- #getting pecl install intl to work:
- #if you get compile errors like this:
- #error: ‘UChar’ does not name a type
- #then you may need to remove libicu and all dependencies, forcibly download libicu55 and icu-devtools version 55
- #compile intl, then update back to 60.2 and reinstall all removed dependencies later
- #general process:
- apt-get remove -y icu-devtools libharfbuzz-dev libicu-dev libicu-le-hb-dev libmagickcore-6.q16-dev libmagickwand-6.q16-dev libmagickwand-dev libxml2-dev libxslt1-dev
- cd /tmp
- wget http://archive.ubuntu.com/ubuntu/pool/main/i/icu/libicu55_55.1-7ubuntu0.4_amd64.deb
- dpkg -i libicu55_55.1-7ubuntu0.4_amd64.deb
- wget http://archive.ubuntu.com/ubuntu/pool/main/i/icu/icu-devtools_55.1-7ubuntu0.4_amd64.deb
- dpkg -i icu-devtools_55.1-7ubuntu0.4_amd64.deb
- wget http://archive.ubuntu.com/ubuntu/pool/main/i/icu/libicu-dev_55.1-7ubuntu0.4_amd64.deb
- dpkg -i libicu-dev_55.1-7ubuntu0.4_amd64.deb
- pecl install intl
- #re-upgrade packages afterward
- apt-get install -y --allow-downgrades icu-devtools=60.2* libharfbuzz-dev libicu-dev=60.2* libicu-le-hb-dev libmagickcore-6.q16-dev libmagickwand-6.q16-dev libmagickwand-dev libxml2-dev libxslt1-dev
- #module compilation complete, proceed to installing modules and next steps:
- cd /usr/lib/php/5.3/20090626
- for i in $(ls -1 *.so) ; do echo "extension=${i}" > /etc/php/5.3/mods-available/$(echo ${i} | sed 's/.so//g ').ini ; phpenmod -v 5.3 -s ALL $(echo ${i} | sed 's/.so//g '); done
- #comes with main php
- #phpdismod -v 5.3 -s ALL iconv
- phpdismod -v 5.3 -s ALL apc
- #probably only makes sense in apache2
- phpenmod -v 5.3 -s apache2 apc
- #fix xdebug:
- echo "zend_extension=/usr/lib/php/5.3/20090626/xdebug.so" > /etc/php/5.3/mods-available/xdebug.ini
- echo "xdebug.overload_var_dump = 0" >> /etc/php/5.3/mods-available/xdebug.ini
- #optional params for APC:
- echo "apc.stat = On" >> /etc/php/5.3/mods-available/apc.ini
- echo "apc.shm_size = 32M" >> /etc/php/5.3/mods-available/apc.ini
- echo "apc.apc.gc_ttl = 900" >> /etc/php/5.3/mods-available/apc.ini
- chmod 644 /etc/php/5.3/mods-available/*
- cd /tmp
- wget --no-check-certificate https://download.suhosin.org/suhosin-0.9.37.1.tar.gz
- tar -xzf suhosin-0.9.37.1.tar.gz
- cp -r suhosin-0.9.37.1 /usr/src/
- cd /usr/src/suhosin-0.9.37.1
- phpize
- ./configure
- make -j$(nproc) 2>&1 | tee build.make.suhosin.log
- make test | tee build.maketest.suhosin.log
- make install
- #loosen some of the default restrictions which are a bit tight, esp for bad/old code
- echo "extension=suhosin.so" > /etc/php/5.3/mods-available/suhosin.ini
- echo "suhosin.post.max_value_length = 1048560" >> /etc/php/5.3/mods-available/suhosin.ini
- echo "suhosin.simulation = Off" >> /etc/php/5.3/mods-available/suhosin.ini
- echo "suhosin.post.max_array_depth = 500" >> /etc/php/5.3/mods-available/suhosin.ini
- echo "suhosin.post.max_array_index_length = 500" >> /etc/php/5.3/mods-available/suhosin.ini
- echo "suhosin.post.max_name_length = 500" >> /etc/php/5.3/mods-available/suhosin.ini
- echo "suhosin.post.max_totalname_length = 500" >> /etc/php/5.3/mods-available/suhosin.ini
- echo "suhosin.post.max_value_length = 65000" >> /etc/php/5.3/mods-available/suhosin.ini
- echo "suhosin.post.disallow_nul = On" >> /etc/php/5.3/mods-available/suhosin.ini
- echo "suhosin.upload.max_uploads = 128" >> /etc/php/5.3/mods-available/suhosin.ini
- echo "suhosin.request.max_varname_length = 500" >> /etc/php/5.3/mods-available/suhosin.ini
- echo "suhosin.get.max_value_length = 1024" >> /etc/php/5.3/mods-available/suhosin.ini
- phpenmod -v 5.3 -s apache2 suhosin
- #check which modules have failed tests or where all tests were skipped - may indicates serious problems such as a wrong version or missing library:
- fgrep 'Tests failed' /usr/src/php-5.3.29/ext/*/build.maketest.*.log | fgrep -v 'Tests failed : 0'
- fgrep '100.0%' /usr/src/php-5.3.29/ext/*/build.maketest.*.log | grep skipped
- #a2enmod php5 has already been run after compiling apache2 SAPI module
- a2dismod php5.6
- cp /etc/apache2/mods-available/php5.6.conf /etc/apache2/mods-available/php5.conf
- service apache2 stop
- service apache2 start
- tail /var/log/apache2/error.log
- #done!
- #compare vs. ubuntu 12.04 php5-* pkg list:
- # adodb
- # curl
- # exactimage
- # ffmpeg
- # gd
- # geoip
- # gmp
- # imagick
- # imap
- # ldap
- # intl
- # mapscript
- # mcrypt
- # odbc
- # pgsql
- # ps
- # pspell
- # sasl
- # snmp
- # sqlite
- # svn
- # sybase
- # tidy
- # xdebug
- # xmlrpc
- # xsl
- #
- # auth-pam
- # idn
- # json
- # librdf
- # uuid
- # mhash
- # ming
- # mssql
- # recode
- # remctl
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement