Jump to content
View in the app

A better way to browse. Learn more.

Portal do Host

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Php 5.2 E 5.3 No Cpanel (Não Testado)

Featured Replies

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


Obrigado camarada. Assim a gente pode testar algumas coisas antes de passar de vez pra 5.3.

Não há bem nem mal que dure para sempre. Um dia tudo acaba.



  • Author

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


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/


Duran, me envia o código por PM. Eu tiro a criptografia e te mando de volta. (se for ioncube).


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.


<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 &quot;Installation interrupt by user, aborting Installation&quot;</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 &quot;Custom php already installed..&quot;</span></div>

<div><span>fi </span></div>

<div><span>if [ -d /usr/local/php52 ]; then</span></div>

<div><span>read -p &quot;Do you want to recompile it[y/n] : &quot; -e re</span></div>

<div><span>if [ $re = n ]; then</span></div>

<div><span>echo &quot;Bye...&quot;</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 &quot;http://us2.php.net/get/php-${VERSION}.tar.gz/from/this/mirror&quot;</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 &quot;Enter the PHP version[5.3.6 or 5.3.8] : &quot; -e version</span></div>

<div><span>if [ &quot;$version&quot; = &quot;5.3.6&quot; ]; then</span></div>

<div><span>VERSION=3_6.pm</span></div>

<div><span>cd /usr/src</span></div>

<div> </div>

<div><span>message &quot;Downloading php-$version from cpanel repo&quot;</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 &quot;Extracting php tar file.....&quot;</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 [ &quot;$version&quot; = &quot;5.3.8&quot; ]; then</span></div>

<div><span>VERSION=3_8.pm</span></div>

<div><span>cd /usr/src</span></div>

<div> </div>

<div><span>message &quot;Downloading php-$version from cpanel repo&quot;</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 &quot;Extracting php tar file.....&quot;</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 &quot;exiting...!!!!!!!&quot;</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 &#39;s/Configure Command =>  //g&#39;|sed &quot;s/&#39;//g&quot; > /tmp/config.ac`</span></div>

<div> </div>

<div><span>CFGLINE=`cat /tmp/config.ac|sed &#39;s/prefix=\/usr\/local/prefix=\/usr\/local\/php52 --enable-cgi/g&#39; |sed &#39;s/--disable-cgi/--enable-cgi/g&#39;|sed &#39;s/.\/configure//g&#39;|sed &#39;s/--with-apxs2=\/usr\/local\/apache\/bin\/apxs//g&#39;`</span></div>

<div><span>SUPHPCONF=&#39;/opt/suphp/etc/suphp.conf&#39;</span></div>

<div><span>if [ ! -f $SUPHPCONF ]; then</span></div>

<div><span>echo &quot;could not find the suphp conf file!!.&quot;</span></div>

<div><span>exit 0</span></div>

<div><span>fi</span></div>

<div> </div>

<div><span>./configure $CFGLINE   &amp;&amp;  make &amp;&amp; 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 &quot;extension=pdo.so&quot; >> /usr/local/php52/lib/php.ini</span></div>

<div><span>echo &quot;extension=pdo_mysql.so&quot; >> /usr/local/php52/lib/php.ini</span></div>

<div><span>echo &quot;extension=pdo_sqlite.so&quot; >> /usr/local/php52/lib/php.ini</span></div>

<div><span>fi                           </span></div>

<div><span>                                                                                                                                           </span></div>

<div><span>CONFADD=`grep -n &quot;;Handler for php-scripts&quot; /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 &#39;s/application\/x-httpd-php52=&#39;\&#39;&#39;php:\/usr\/local\/php52\/bin\/php-cgi&#39;\&#39;&#39;//g&#39; $SUPHPCONF</span></div>

<div><span>#sed -i &quot;${L}i\application\/x-httpd-php52=&#39;php:\/usr\/local\/php52\/bin\/php-cgi&#39;&quot; $SUPHPCONF</span></div>

<div><span>sed -i &quot;${L}i\application\/x-httpd-php52=&quot;\&quot;&quot;php:\/usr\/local\/php52\/bin\/php-cgi&quot;\&quot;&quot;&quot; $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 &quot;AddType application/x-httpd-php52 .php52&quot; >> /usr/local/apache/conf/php52.conf</span></div>

<div><span>echo &quot;<Directory />&quot;  >> /usr/local/apache/conf/php52.conf</span></div>

<div><span>echo &quot;    suPHP_AddHandler application/x-httpd-php52&quot; >> /usr/local/apache/conf/php52.conf</span></div>

<div><span>echo &quot;</Directory>&quot; >> /usr/local/apache/conf/php52.conf</span></div>

<div><span>sed -i &#39;s/Include \/usr\/local\/apache\/conf\/php52.conf//g&#39; /usr/local/apache/conf/includes/pre_main_global.conf</span></div>

<div><span>        echo &quot;Include /usr/local/apache/conf/php52.conf&quot; >> /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 &#39;s/application\/x-httpd-php52=&#39;\&#39;&#39;php:\/usr\/local\/php52\/bin\/php-cgi&#39;\&#39;&#39;//g&#39; /opt/suphp/etc/suphp.conf</span></div>

<div><span>rm -rf   /usr/local/apache/conf/php52.conf</span></div>

<div><span>sed -i &#39;s/Include \/usr\/local\/apache\/conf\/php52.conf//g&#39; /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 &quot;ping -c 1 prajith.in 1>/dev/null 2>/dev/null&quot;; then</span></div>

<div><span>message &quot;Fetching Plugin files from repo&quot;</span></div>

<div><span>else</span></div>

<div><span>message &quot;Unable to download Plugin files from repo..&quot;</span></div>

<div><span>message &quot;EXITING.....!!!!!!!!!&quot;</span></div>

<div><span>fi</span></div>

<div> </div>

<div><span>clear</span></div>

<div><span>echo &quot;Installing cpanel version manager... Please wait...&quot;</span></div>

<div><span>sleep 1</span></div>

<div><span>read -p &quot;Enter your current Cpanel theme name[enter x and x3] : &quot; -e the</span></div>

<div><span>if [ &quot;$the&quot;  = &quot;x&quot; ]; then</span></div>

<div><span>DIR=&#39;/usr/local/cpanel/base/frontend/x&#39;</span></div>

<div><span>mkdir $DIR/phpv</span></div>

<div><span>WDIR=&#39;$DIR/phpv&#39;</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 [ &quot;$the&quot;  = &quot;x3&quot; ]; then</span></div>

<div><span>DIR=&#39;/usr/local/cpanel/base/frontend/x3&#39;</span></div>

<div><span>mkdir $DIR/phpv</span></div>

<div><span>WDIR=&#39;$DIR/phpv&#39;</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 &quot;installation complete......&quot;</span></div>

<span>

</span></div>

<div> </div>




Guest
This topic is now closed to further replies.

Recently Browsing 0

  • No registered users viewing this page.

Important Information

Do you agree with our terms?

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.