Browse Source

Install PHP and extensions in prefix folder

Install all extensions with php
Hamilton Turner 11 years ago
parent
commit
a3c96872b1

+ 0 - 11
toolset/setup/linux/languages/phalcon.sh

@@ -1,11 +0,0 @@
-#!/bin/bash
-
-RETCODE=$(fw_exists /usr/local/lib/php/extensions/no-debug-non-zts-20100525/phalcon.so)
-[ ! "$RETCODE" == 0 ] || { return 0; }
-
-fw_depends php
-
-test -d cphalcon || git clone git://github.com/phalcon/cphalcon.git
-cd cphalcon
-git checkout bf9da26e6e20ea05dd69881b9cd0c2536ec53bcb
-cd build && sudo ./install

+ 42 - 11
toolset/setup/linux/languages/php.sh

@@ -4,26 +4,57 @@
 # Two path checks would both always run in php. In this code the check 
 # for apc.so only happens if the check for php fails. Is that ok? 
 
-RETCODE=$(fw_exists /usr/local/bin/php)
+RETCODE=$(fw_exists php.installed)
 [ ! "$RETCODE" == 0 ] || { \
   echo "Moving PHP config files into place"; 
   sudo cp $FWROOT/config/php.ini /usr/local/lib/php.ini
   sudo cp $FWROOT/config/php-fpm.conf /usr/local/lib/php-fpm.conf
   return 0; }
 
-fw_get http://museum.php.net/php5/php-5.4.13.tar.gz
+fw_get http://museum.php.net/php5/php-5.4.13.tar.gz -O php-5.4.13.tar.gz
 fw_untar php-5.4.13.tar.gz
-cd php-5.4.13
-./configure --with-pdo-mysql --with-mysql --with-mcrypt --enable-intl --enable-mbstring --enable-fpm --with-fpm-user=www-data --with-fpm-group=www-data --with-openssl
+ls
+mv php-5.4.13 php
+ls
+cd php
+
+./configure --prefix=$IROOT/php-5.4.13 --with-pdo-mysql --with-mysql --with-mcrypt --enable-intl --enable-mbstring --enable-fpm --with-fpm-user=www-data --with-fpm-group=www-data --with-openssl
 make
-sudo make install
+make install
 cd ..
 
-sudo cp $FWROOT/config/php.ini /usr/local/lib/php.ini
-sudo cp $FWROOT/config/php-fpm.conf /usr/local/lib/php-fpm.conf
+cp $FWROOT/config/php.ini $IROOT/php-5.4.13/lib/php.ini
+cp $FWROOT/config/php-fpm.conf $IROOT/php-5.4.13/lib/php-fpm.conf
+
+# =======================
+#
+# Install the PHP extensions that our tests need
+#    Install all of them here becuase our config file references 
+#    all of these *.so
+# ========================
+echo PHP compilation finished, building modules
+
+# Apc.so
+$IROOT/php-5.4.13/bin/pecl config-set php_ini $IROOT/php-5.4.13/lib/php.ini
+printf "\n" | $IROOT/php-5.4.13/bin/pecl install -f apc-beta
+
+# yaf.so
+printf "\n" | $IROOT/php-5.4.13/bin/pecl install -f yaf
+
+# phalcon.so
+#   The configure seems broken, does not respect prefix. If you 
+#   update the value of PATH then it finds the prefix from `which php`
+export PATH=$IROOT/php-5.4.13/bin:$IROOT/php-5.4.13/sbin:$PATH
+git clone git://github.com/phalcon/cphalcon.git
+cd cphalcon
+git checkout phalcon-v1.3.2
+cd build/64bits 
+$IROOT/php-5.4.13/bin/phpize
+./configure --prefix=$IROOT/php-5.4.13 --enable-phalcon
+make
+make install
 
-RETCODE=$(fw_exists /usr/local/lib/php/extensions/no-debug-non-zts-20100525/apc.so)
-[ ! "$RETCODE" == 0 ] || { return 0; }
+# Clean up a bit
+rm -rf $IROOT/php
 
-cd php-5.4.13
-printf "\n" | sudo pecl install apc-beta
+touch $IROOT/php.installed

+ 0 - 14
toolset/setup/linux/languages/yaf.sh

@@ -1,14 +0,0 @@
-#!/bin/bash
-
-RETCODE=$(fw_exists /usr/local/lib/php/extensions/no-debug-non-zts-20100525/yaf.so)
-[ ! "$RETCODE" == 0 ] || { \
-  echo "Enabling yaf in PHP configuration...";
-  sudo cp $FWROOT/config/php.ini /usr/local/lib/php.ini
-  sudo cp $FWROOT/config/php-fpm.conf /usr/local/lib/php-fpm.conf
-  return 0; }
-
-fw_depends php
-sudo pecl install -f yaf
-sudo cp $FWROOT/config/php.ini /usr/local/lib/php.ini
-sudo cp $FWROOT/config/php-fpm.conf /usr/local/lib/php-fpm.conf
-