php.sh 1.0 KB

1234567891011121314151617181920212223242526272829
  1. . ../toolset/setup/linux/bash_functions.sh
  2. # TODO double check this, it's logically different from original python code.
  3. # Two path checks would both always run in python. In this code the check
  4. # for apc.so only happens if the check for php fails. Is that ok?
  5. fw_exists /usr/local/bin/php
  6. [ $? -ne 0 ] || { \
  7. echo "PHP is installed!";
  8. sudo cp ../config/php.ini /usr/local/lib/php.ini
  9. sudo cp ../config/php-fpm.conf /usr/local/lib/php-fpm.conf
  10. return 0; }
  11. fw_get http://museum.php.net/php5/php-5.4.13.tar.gz
  12. fw_untar php-5.4.13.tar.gz
  13. cd php-5.4.13
  14. ./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
  15. make
  16. sudo make install
  17. cd ..
  18. fw_exists /usr/local/lib/php/extensions/no-debug-non-zts-20100525/apc.so
  19. [ $? -ne 0 ] || { echo "PHP is installed!"; return 0; }
  20. cd php-5.4.13
  21. printf "\n" | sudo pecl install apc-beta
  22. sudo cp ../config/php.ini /usr/local/lib/php.ini
  23. sudo cp ../config/php-fpm.conf /usr/local/lib/php-fpm.conf