LucasOliveira Posted February 9, 2012 Share Posted February 9, 2012 Olá amigos, estive navegando por ai e comecei a participar da comunidade webhostingtalk, Por lá vi esse tópico explcando a instalação do php 5.2 e 5.3 no mesmo servidor cPanel, deixo a dica para vocês. Vamos ao tutorial traduzido: Passos: 1) compile seu apache com php 5.2.17 (normalmente) use easyapache para facilitar. 2) faça download desse script http://www.prajith.in/cpanel/install.sh 3)rode o instalador com ./install.sh (talvez precise rodar um chmod 777 antes) 4) selecione a versão do php nova a ser instalado Selecione[5.3.6 ou 5.3.8] : Você vai ter de esperar de 20 a 30 minutos para o processo terminar 5) Pronto! Agora vamos no cPanel escolher a versão a ser utilizada para cada cliente individua! vai no cpanel >> software >> PHP Version É isso!!!! OBS: Eu não testei a solução acim mas parece que funciona, se alguem quizer testar fique a vontade. Créditos: mattmackman e eu (lucasoliveira) por postar Link to comment Share on other sites More sharing options...
Jaime Silva Posted February 9, 2012 Share Posted February 9, 2012 Obrigado camarada. Assim a gente pode testar algumas coisas antes de passar de vez pra 5.3. Link to comment Share on other sites More sharing options...
Alexandre Duran Posted February 10, 2012 Share Posted February 10, 2012 Opa, já iniciando os testes. Link to comment Share on other sites More sharing options...
LucasOliveira Posted February 10, 2012 Author Share Posted February 10, 2012 De nada galera, achei muito interessante a ideia mas infelizmente não estou com servidor cPanel disponivel para testes. Alexandre quando poder, poste os resultados. Abraço Link to comment Share on other sites More sharing options...
Alexandre Duran Posted February 10, 2012 Share Posted February 10, 2012 Eu abri um ticket no CPANEL (temos contrato de suporte direto com eles) assim como postei tb no forum oficial pedindo informações: http://forums.cpanel.net/f189/php5-2-php5-3-same-server-257771.html#post1073341 Vi um código criptografado no final do script e estou analisando. Este script é Prajith (um indiano) do http://www.prajith.in/category/php-5-3-and-php-5-2/ Link to comment Share on other sites More sharing options...
Guest Posted February 10, 2012 Share Posted February 10, 2012 Duran, me envia o código por PM. Eu tiro a criptografia e te mando de volta. (se for ioncube). Link to comment Share on other sites More sharing options...
Jordan Miguel Posted February 11, 2012 Share Posted February 11, 2012 Eu abri um ticket no CPANEL (temos contrato de suporte direto com eles) assim como postei tb no forum oficial pedindo informações: http://forums.cpanel...tml#post1073341 Vi um código criptografado no final do script e estou analisando. Este script é Prajith (um indiano) do http://www.prajith.i...-3-and-php-5-2/ Quando tiver os resultados poste aqui! Também quero saber se o script é seguro.. Tendo algo criptografado, já acho estranho. Link to comment Share on other sites More sharing options...
Alexandre Duran Posted February 13, 2012 Share Posted February 13, 2012 <p>Alarme falso, o código não contém elementos criptografados:</p> <p> </p> <p> </p> <div><span> </span> <div><span>#!/bin/bash</span></div> <div><span>set -u</span></div> <div><span>set -e</span></div> <div><span>trap ctrl_c INT</span></div> <div> </div> <div><span>function ctrl_c() {</span></div> <div><span>clear</span></div> <div><span> echo "Installation interrupt by user, aborting Installation"</span></div> <div><span>exit 0</span></div> <div><span>}</span></div> <div> </div> <div><span>wget -q -O /root/installlogo prajith.in/cpanel/installlogo</span></div> <div> </div> <div><span>cat /root/installlogo</span></div> <div><span>sleep 1</span></div> <div> </div> <div><span>message() {</span></div> <div><span>/bin/cat << EOF</span></div> <div><span>$1</span></div> <div><span>EOF</span></div> <div><span>}</span></div> <div><span>if [ -d /usr/local/php52 ]; then</span></div> <div><span>message "Custom php already installed.."</span></div> <div><span>fi </span></div> <div><span>if [ -d /usr/local/php52 ]; then</span></div> <div><span>read -p "Do you want to recompile it[y/n] : " -e re</span></div> <div><span>if [ $re = n ]; then</span></div> <div><span>echo "Bye..."</span></div> <div><span>exit 1</span></div> <div><span>fi</span></div> <div><span>fi</span></div> <div><span>unset version</span></div> <div><span>#VERSION=5.3.8</span></div> <div><span>cd /usr/src </span></div> <div><span>#wget -q -O php-${VERSION}.tar.gz "http://us2.php.net/get/php-${VERSION}.tar.gz/from/this/mirror"</span></div> <div><span>#tar -zxvf php-${VERSION}.tar.gz</span></div> <div><span>#rm -f php-${VERSION}.tar.gz</span></div> <div><span>read -p "Enter the PHP version[5.3.6 or 5.3.8] : " -e version</span></div> <div><span>if [ "$version" = "5.3.6" ]; then</span></div> <div><span>VERSION=3_6.pm</span></div> <div><span>cd /usr/src</span></div> <div> </div> <div><span>message "Downloading php-$version from cpanel repo"</span></div> <div> </div> <div><span>wget -q httpupdate.cpanel.net/cpanelsync/easy/targz/Cpanel/Easy/PHP5/3_6.pm.tar.gz</span></div> <div><span>message "Extracting php tar file....."</span></div> <div><span>tar -zxf $VERSION.tar.gz</span></div> <div><span>rm -f $VERSION.tar.gz</span></div> <div><span>cd php-$version</span></div> <div><span>elif [ "$version" = "5.3.8" ]; then</span></div> <div><span>VERSION=3_8.pm</span></div> <div><span>cd /usr/src</span></div> <div> </div> <div><span>message "Downloading php-$version from cpanel repo"</span></div> <div><span>wget -q httpupdate.cpanel.net/cpanelsync/easy/targz/Cpanel/Easy/PHP5/3_8.pm.tar.gz</span></div> <div><span>message "Extracting php tar file....."</span></div> <div><span>tar -zxf $VERSION.tar.gz</span></div> <div><span>rm -f $VERSION.tar.gz</span></div> <div><span>cd php-$version</span></div> <div><span>else</span></div> <div><span>message "exiting...!!!!!!!"</span></div> <div><span>fi</span></div> <div> </div> <div> </div> <div><span>PHP=`which php` </span></div> <div><span> </span></div> <div><span>CFG=`$PHP -i |grep configure|sed 's/Configure Command => //g'|sed "s/'//g" > /tmp/config.ac`</span></div> <div> </div> <div><span>CFGLINE=`cat /tmp/config.ac|sed 's/prefix=\/usr\/local/prefix=\/usr\/local\/php52 --enable-cgi/g' |sed 's/--disable-cgi/--enable-cgi/g'|sed 's/.\/configure//g'|sed 's/--with-apxs2=\/usr\/local\/apache\/bin\/apxs//g'`</span></div> <div><span>SUPHPCONF='/opt/suphp/etc/suphp.conf'</span></div> <div><span>if [ ! -f $SUPHPCONF ]; then</span></div> <div><span>echo "could not find the suphp conf file!!."</span></div> <div><span>exit 0</span></div> <div><span>fi</span></div> <div> </div> <div><span>./configure $CFGLINE && make && make install</span></div> <div> </div> <div><span>if [ ! -f /usr/local/php5/lib/php.ini ]</span></div> <div><span>then</span></div> <div><span> cp -f php.ini-production /usr/local/php52/lib/php.ini </span></div> <div><span>echo "extension=pdo.so" >> /usr/local/php52/lib/php.ini</span></div> <div><span>echo "extension=pdo_mysql.so" >> /usr/local/php52/lib/php.ini</span></div> <div><span>echo "extension=pdo_sqlite.so" >> /usr/local/php52/lib/php.ini</span></div> <div><span>fi </span></div> <div><span> </span></div> <div><span>CONFADD=`grep -n ";Handler for php-scripts" /opt/suphp/etc/suphp.conf -A 3|tail -1|cut -d- -f1` </span></div> <div><span>if [ -n $CONFADD ]; then </span></div> <div><span> L=$(expr $CONFADD + 1);</span></div> <div><span>cp -prf $SUPHPCONF $SUPHPCONF-bkp</span></div> <div><span>sed -i 's/application\/x-httpd-php52='\''php:\/usr\/local\/php52\/bin\/php-cgi'\''//g' $SUPHPCONF</span></div> <div><span>#sed -i "${L}i\application\/x-httpd-php52='php:\/usr\/local\/php52\/bin\/php-cgi'" $SUPHPCONF</span></div> <div><span>sed -i "${L}i\application\/x-httpd-php52="\""php:\/usr\/local\/php52\/bin\/php-cgi"\""" $SUPHPCONF</span></div> <div><span>if [ -f /usr/local/apache/conf/php52.conf ]; then</span></div> <div><span>rm -rf /usr/local/apache/conf/php52.conf</span></div> <div><span>fi</span></div> <div><span>echo "AddType application/x-httpd-php52 .php52" >> /usr/local/apache/conf/php52.conf</span></div> <div><span>echo "<Directory />" >> /usr/local/apache/conf/php52.conf</span></div> <div><span>echo " suPHP_AddHandler application/x-httpd-php52" >> /usr/local/apache/conf/php52.conf</span></div> <div><span>echo "</Directory>" >> /usr/local/apache/conf/php52.conf</span></div> <div><span>sed -i 's/Include \/usr\/local\/apache\/conf\/php52.conf//g' /usr/local/apache/conf/includes/pre_main_global.conf</span></div> <div><span> echo "Include /usr/local/apache/conf/php52.conf" >> /usr/local/apache/conf/includes/pre_main_global.conf</span></div> <div><span>fi</span></div> <div><span>uninstall() {</span></div> <div><span>if [ -f /usr/local/cpanel/base/frontend/x3/phpv ] || [ -f /usr/local/cpanel/base/frontend/x/phpv ]; then</span></div> <div> </div> <div><span>/usr/local/cpanel/bin/unregister_cpanelplugin /usr/local/cpanel/base/frontend/versionmanager.cpanelplugin</span></div> <div><span>rm -rf /usr/local/cpanel/base/frontend/x3/phpv</span></div> <div><span>rm -rf /usr/local/cpanel/base/frontend/x/phpv</span></div> <div><span>sed -i 's/application\/x-httpd-php52='\''php:\/usr\/local\/php52\/bin\/php-cgi'\''//g' /opt/suphp/etc/suphp.conf</span></div> <div><span>rm -rf /usr/local/apache/conf/php52.conf</span></div> <div><span>sed -i 's/Include \/usr\/local\/apache\/conf\/php52.conf//g' /usr/local/apache/conf/includes/pre_main_global.conf</span></div> <div><span>fi</span></div> <div><span>}</span></div> <div><span>uninstall</span></div> <div> </div> <div><span>if eval "ping -c 1 prajith.in 1>/dev/null 2>/dev/null"; then</span></div> <div><span>message "Fetching Plugin files from repo"</span></div> <div><span>else</span></div> <div><span>message "Unable to download Plugin files from repo.."</span></div> <div><span>message "EXITING.....!!!!!!!!!"</span></div> <div><span>fi</span></div> <div> </div> <div><span>clear</span></div> <div><span>echo "Installing cpanel version manager... Please wait..."</span></div> <div><span>sleep 1</span></div> <div><span>read -p "Enter your current Cpanel theme name[enter x and x3] : " -e the</span></div> <div><span>if [ "$the" = "x" ]; then</span></div> <div><span>DIR='/usr/local/cpanel/base/frontend/x'</span></div> <div><span>mkdir $DIR/phpv</span></div> <div><span>WDIR='$DIR/phpv'</span></div> <div><span>wget -q -O $DIR/phpv/index.html http://prajith.in/cpanel/index</span></div> <div><span>wget -q -O $DIR/phpv/validate.php http://prajith.in/cpanel/validate</span></div> <div><span>elif [ "$the" = "x3" ]; then</span></div> <div><span>DIR='/usr/local/cpanel/base/frontend/x3'</span></div> <div><span>mkdir $DIR/phpv</span></div> <div><span>WDIR='$DIR/phpv'</span></div> <div><span>wget -q -O $DIR/phpv/index.html http://prajith.in/cpanel/index</span></div> <div><span>wget -q -O $DIR/phpv/validate.php http://prajith.in/cpanel/validate</span></div> <div><span>fi</span></div> <div><span>wget -q -O /usr/local/cpanel/base/frontend/versionmanager.cpanelplugin http://prajith.in/cpanel/versionmanager.cpanelplugin</span></div> <div><span>/usr/local/cpanel/bin/register_cpanelplugin /usr/local/cpanel/base/frontend/versionmanager.cpanelplugin </span></div> <div><span>wget -q -O /scripts/installmodules prajith.in/cpanel/instalmodules.sh</span></div> <div><span>chmod 755 /scripts/installmodules</span></div> <div><span>clear</span></div> <div><span>/etc/init.d/httpd restart</span></div> <div><span>clear</span></div> <div><span>echo "installation complete......"</span></div> <span> </span></div> <div> </div> Link to comment Share on other sites More sharing options...
Jordan Miguel Posted February 13, 2012 Share Posted February 13, 2012 Mas testou em algum servidor Duran? E o resultado? Link to comment Share on other sites More sharing options...
Alexandre Duran Posted February 13, 2012 Share Posted February 13, 2012 Vou testar esta noite e volto a postar aqui. Link to comment Share on other sites More sharing options...
Recommended Posts