Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Needed exports
- export PHPPATH=`php-latest -i | grep "Configure Command" | perl -pe "s/.*'.\/configure'\s*?'--prefix\=(.*?)'.*/\1/"`;
- export LIBDIR=$HOME/data/lib; export SRCDIR=$LIBDIR/src;
- # Create the data/lib and data/lib/php directory if it does not exist already
- if [ ! -d "$LIBDIR" ]; then
- mkdir $HOME/data/lib;
- fi
- if [ ! -d "$LIBDIR/php" ]; then
- mkdir $HOME/data/lib/php;
- fi
- # Create a source directory for ICU and PHP (for ext/intl)
- cd $LIBDIR && mkdir src && mkdir ICU-49.1.2 && cd src;
- # Download and extract the required archives
- wget http://download.icu-project.org/files/icu4c/49.1.2/icu4c-49_1_2-src.tgz && tar xzvf icu4c-49_1_2-src.tgz;
- wget http://us3.php.net/get/php-5.3.13.tar.gz/from/this/mirror && tar xzvf mirror;
- rm icu4c-49_1_2-src.tgz mirror;
- # Build ICU
- cd icu/source;
- # configure without prefix to allow make to run correctly
- ./runConfigureICU Linux && make;
- # reconfigure with prefix for make install
- ./configure --prefix=$SRCDIR/ICU-49.1.2;
- # Magic
- make install;
- cd $SRCDIR/php-5.3.13/ext/intl;
- # More Magic
- $PHPPATH/bin/phpize;
- # Run configure
- ./configure --with-php-config=$PHPPATH/bin/php-config --with-icu-dir=$SRCDIR/ICU-49.1.2 && make;
- # Install extension
- cp modules/intl.so $LIBDIR/php/
- # cleanup
- cd $LIBDIR && rm -R src;
- echo "----------------------------------------------------------------"; echo "You WILL need to add the line:"; echo " extension=$LIBDIR/php/intl.so"; echo "to your php.ini for the Intl to be available"'!'; echo "----------------------------------------------------------------";
Advertisement
Add Comment
Please, Sign In to add comment