From 03db7c8738e1499661981cac5632d23ebe18c14b Mon Sep 17 00:00:00 2001 From: Shoghi Cervantes Pueyo Date: Wed, 9 Jan 2013 20:29:42 +0100 Subject: [PATCH] Compile script without Root access --- compile_php.sh | 57 +++++++++++++++++++++----------------------------- 1 file changed, 24 insertions(+), 33 deletions(-) diff --git a/compile_php.sh b/compile_php.sh index de490e347..c67e34dd7 100644 --- a/compile_php.sh +++ b/compile_php.sh @@ -1,9 +1,5 @@ #!/bin/bash echo "[PocketMine] PHP installer and compiler for Linux - by @shoghicp v0.3" -#if [ "$(whoami)" != 'root' ]; then -#echo "[ERROR] You must be root to run this script" -#exit 1; -#fi DIR=`pwd` date > $DIR/install.log uname -a >> $DIR/install.log @@ -13,16 +9,11 @@ type autoconf >> $DIR/install.log 2>&1 || { echo >&2 "[ERROR] Please install \"a type automake >> $DIR/install.log 2>&1 || { echo >&2 "[ERROR] Please install \"automake\""; exit 1; } type gcc >> $DIR/install.log 2>&1 || { echo >&2 "[ERROR] Please install \"gcc\""; exit 1; } type m4 >> $DIR/install.log 2>&1 || { echo >&2 "[ERROR] Please install \"m4\""; exit 1; } +rm -r -f install_data/ >> $DIR/install.log 2>&1 +rm -r -f php5/ >> $DIR/install.log 2>&1 mkdir -m 0777 install_data >> $DIR/install.log 2>&1 mkdir -m 0777 php5 >> $DIR/install.log 2>&1 cd install_data -#apt-get -f -y install >> $DIR/install.log 2>&1 -#apt-get -y install \ -build-essentials \ -automake \ -autoconf \ -make \ -gcc >> $DIR/install.log 2>&1 #PHP 5 echo -n "[PHP5] downloading..." @@ -52,22 +43,22 @@ rm -r -f ./zlib echo " done!" #OpenSSL -echo -n "[OpenSSL] downloading..." -wget ftp://ftp.openssl.org/source/openssl-1.0.1c.tar.gz -O openssl-1.0.1c.tar.gz >> $DIR/install.log 2>&1 -echo -n " extracting..." -tar -zxvf openssl-1.0.1c.tar.gz >> $DIR/install.log 2>&1 -rm -f openssl-1.0.1c.tar.gz >> $DIR/install.log 2>&1 -mv openssl-1.0.1c openssl -echo -n " compiling..." -cd openssl -./config --prefix=$DIR/install_data/php/ext/openssl >> $DIR/install.log 2>&1 -make >> $DIR/install.log 2>&1 -echo -n " installing..." -make install >> $DIR/install.log 2>&1 -echo -n " cleaning..." -cd .. -rm -r -f ./openssl -echo " done!" +#echo -n "[OpenSSL] downloading..." +#wget ftp://ftp.openssl.org/source/openssl-1.0.1c.tar.gz -O openssl-1.0.1c.tar.gz >> $DIR/install.log 2>&1 +#echo -n " extracting..." +#tar -zxvf openssl-1.0.1c.tar.gz >> $DIR/install.log 2>&1 +#rm -f openssl-1.0.1c.tar.gz >> $DIR/install.log 2>&1 +#mv openssl-1.0.1c openssl +#echo -n " compiling..." +#cd openssl +#./config --prefix=$DIR/install_data/php/ext/openssl >> $DIR/install.log 2>&1 +#make >> $DIR/install.log 2>&1 +#echo -n " installing..." +#make install >> $DIR/install.log 2>&1 +#echo -n " cleaning..." +#cd .. +#rm -r -f ./openssl +#echo " done!" #GMP echo -n "[GMP] downloading..." @@ -88,7 +79,7 @@ rm -r -f ./gmp echo " done!" echo -n "[cURL] downloading..." -wget https://github.com/bagder/curl/archive/master.tar.gz -O curl-master.tar.gz >> $DIR/install.log 2>&1 +wget https://github.com/bagder/curl/archive/master.tar.gz --no-check-certificate -O curl-master.tar.gz >> $DIR/install.log 2>&1 echo -n " extracting..." tar -zxvf curl-master.tar.gz >> $DIR/install.log 2>&1 rm -f curl-master.tar.gz >> $DIR/install.log 2>&1 @@ -106,22 +97,21 @@ rm -r -f ./curl echo " done!" #pthreads -echo "[PHP pthreads] downloading..." -wget https://github.com/krakjoe/pthreads/archive/master.tar.gz -O pthreads-master.tar.gz >> $DIR/install.log 2>&1 +echo -n "[PHP pthreads] downloading..." +wget https://github.com/krakjoe/pthreads/archive/master.tar.gz --no-check-certificate -O pthreads-master.tar.gz >> $DIR/install.log 2>&1 echo -n " extracting..." tar -zxvf pthreads-master.tar.gz >> $DIR/install.log 2>&1 rm -f pthreads-master.tar.gz >> $DIR/install.log 2>&1 mv pthreads-master $DIR/install_data/php/ext/pthreads echo " done!" - +#--with-openssl=$DIR/install_data/php/ext/openssl echo -n "[PHP5] compiling..." cd php ./buildconf --force >> $DIR/install.log 2>&1 ./configure --prefix=$DIR/php5 \ --exec-prefix=$DIR/php5 \ --enable-embedded-mysqli \ ---with-openssl=$DIR/install_data/php/ext/openssl \ --enable-bcmath \ --with-gmp=$DIR/install_data/php/ext/gmp \ --with-curl=$DIR/install_data/php/ext/curl \ @@ -139,4 +129,5 @@ echo -n "[INFO] Cleaning up..." rm -r -f install_data/ >> $DIR/install.log 2>&1 rmdir install_data/ >> $DIR/install.log 2>&1 echo " done!" -echo "[PocketMine] You should start the server now using \"./start.sh\"" \ No newline at end of file +echo "[PocketMine] You should start the server now using \"./start.sh\"" +echo "[PocketMine] If it doesn't works, please send the \"install.log\" file to the Bug Tracker" \ No newline at end of file