Control Web Panel

WebPanel => PHP => Topic started by: Administrator on May 24, 2014, 09:38:32 PM

Title: PHP Version Switcher
Post by: Administrator on May 24, 2014, 09:38:32 PM
Now CWP has PHP Switch option in which you can very easily switch to other PHP version and recompile it with desired modules.

How to use it?
- Click on PHP Version Switcher (here you will get server PHP version and compiled modules which your server has now compiled).
- Select PHP Version you wish to compile in drop-down menu and click next.
- In PHP compiler you can add or remove modules you want (please use only: one per line).
- Click on Start compiler and compiler will start to work in background.

Compiler needs from 5 to 20 minutes to finish depending on modules you are installing and your CPU power.
You can return in eg. 15 minutes and in CWP - PHP Version Switch check which version of PHP and modules you now have.

Your websites and CWP will work during compiler process and PHP will be update when compiler is completed and only if its successful.

You can check PHP compile logs in file:
Code: [Select]
/var/log/php-rebuild.log
If you wish to monitor compiler then use this command from shell:
Code: [Select]
tail -f /var/log/php-rebuild.log



Title: Re: PHP Version Switcher
Post by: thundersword on May 25, 2014, 12:28:00 PM
glad to see this messages!
but I still concern some details.
if I switch to another php version, will CWP remove the installed version, or just compile the selected version in another path?
and is the web server still working during the process of compiling?
Title: Re: PHP Version Switcher
Post by: Administrator on May 25, 2014, 02:04:46 PM
post is updated, it will use same location no changes.
Title: Re: PHP Version Switcher
Post by: BenYamin on August 06, 2014, 10:44:45 PM
PHP Version Switcher for me not Working !!
in ssh
tail -f /var/log/php-rebuild.log
Error was
Code: [Select]
tail: cannot open `/var/log/php-rebuild.log' for reading: No such file or directory
Title: Re: PHP Version Switcher
Post by: Administrator on August 07, 2014, 01:05:32 AM
you can contact support for more detailed check of this issue and debugging.
http://centos-webpanel.com/contact
Title: Re: PHP Version Switcher
Post by: baboo on November 22, 2014, 07:47:08 AM
PHP Version Switcher for me not Working !!
The same issue! I can't change PHP from 5.4/5.3 to 5.2 but it works from 5.4 to 5.3.

Any suggestion?
Title: Re: PHP Version Switcher
Post by: signix on May 21, 2015, 01:45:10 PM
I would like to add tidy support on php.
I add
Code: [Select]
--with-tidy in php switcher but it does not change tidy support.
The log file ended with
Code: [Select]
checking for TIDY support... yes
PHP Rebuild Completed
I try to change the php version (from 5.4 to 5.5) but it is the same thing (version does not change and log file end with php rebuild completed).
I am doing something wrong ?
Thank you
Title: Re: PHP Version Switcher
Post by: dophlin on July 07, 2015, 09:39:40 AM
Changing the php version from 4.4.9 to 5.2.17 or other upper versions doesn't work. In PHP Info page it mentions "You are running PHP version: 5.2.17". But in the table of the same page it points "PHP Version 4.4.9". What is wrong? Please help me.

Update:
# php -v
php version -> 5.2.17

On the other side, one of my websites on this host tells the current version is 4.4.9.
Title: Re: PHP Version Switcher
Post by: Administrator on July 07, 2015, 06:44:28 PM
you will need to check php selector and if you have set custom path for account php version somewhere in htaccess
Title: Re: PHP Version Switcher
Post by: infinitech07 on October 18, 2015, 02:42:21 PM
I guess the latest CWP version still having the same issue where I did the php recompilation from 5.4 to 5.3 and from 5.3 back to 5.4 again. On php -v it showed 5.4 but the php info page still showing 5.3.
Title: Re: PHP Version Switcher
Post by: Administrator on October 18, 2015, 05:03:15 PM
you should contact support so this could be checked on your server
http://centos-webpanel.com/contact
Title: Re: PHP Version Switcher
Post by: infinitech07 on October 22, 2015, 07:07:32 AM
Is okay. I had updated to the version 5.5.11 anyway. Thanks.
Title: Re: PHP Version Switcher
Post by: dannyodj on November 07, 2015, 09:26:15 PM
Hello , thank you for this feature in CWP,
i like it and looks very nice idea :D
i have a question:

1. Does this feature can used by user?  or only root privilege!?

because i create an user account for my customer , i gave to him the credentials , and if he like to change php version he can do it by himself , with php version switcher!! ? so !
i know one method is to edit .httacess file but should be better to be this feature for users to!

thank you!
Title: Re: PHP Version Switcher
Post by: Administrator on November 21, 2015, 11:21:17 PM
you can only change per user by using htaccess and php selector, as php-switcher is a global server version.
Title: Re: PHP Version Switcher
Post by: rothkj1022 on May 03, 2017, 09:56:21 PM
How can I use flags during compile, like in the selector?  Specifically, I want to compile my base PHP version with --with-apxs2=/usr/local/apache/bin/apxs.  Thanks!
Title: Re: PHP Version Switcher
Post by: xinophe on May 26, 2017, 11:47:40 AM
Install of php 5.3 OK, but always errors for 5.2
IE :
In file included from /tmp/php-build/php-5.2.17/ext/dom/document.c:28:0:
/tmp/php-build/php-5.2.17/ext/dom/php_dom.h:98:10: note: expected 'char *' but argument is of type 'const xmlChar *'
 xmlNsPtr dom_get_ns(xmlNodePtr node, char *uri, int *errorcode, char *prefix);
or/and :
In file included from /tmp/php-build/php-5.2.17/main/php.h:38:0,
                 from /tmp/php-build/php-5.2.17/ext/dom/node.c:26:
/tmp/php-build/php-5.2.17/ext/dom/node.c:1955:40: error: dereferencing pointer to incomplete type
     RETVAL_STRINGL((char *) buf->buffer->content, ret, 1);
Title: Re: PHP Version Switcher
Post by: lfrojasp on June 21, 2017, 03:46:17 PM
Hello,

I have a problem with mi PHP Versión Switcher, i'm trying to install a php-ldap module, I foundthis option http://forum.centos-webpanel.com/php/enable-php-ldap-extesion-in-php-5-6-(centos-6)/ (http://forum.centos-webpanel.com/php/enable-php-ldap-extesion-in-php-5-6-(centos-6)/) , but i can't add new flags to the PHP Version Switcher compiler, can you help me to find a solution?

My CWP Versión is: 0.9.8.333 and the PHP Version is 5.6.30
Title: Re: PHP Version Switcher
Post by: gkiss88 on August 02, 2017, 08:44:38 AM
The version switcher works fine for me but I have a few concerns with it:

1. What's the point of providing such feature while there's a packaged version available (cwp-php) installed by default? I believe it would be more logical to package and maintain one particular version used as the PHP interpreter for the CWP web interface and several other system functions and use PHP Selector for providing PHP usage feature for users. Now that I compiled version 5.6.31 using the Version Switcher, I have two separate instances of the same PHP version (one in /usr/local and one in /opt/alt/php56) which looks pointless to me.

2. Both the packaged and the manually compiled version install files to /usr/local directory. I believe this is not very wise as it might cause file conflicts between the compiled and the packaged version and also, overwriting files provided by packages is never a good idea (except for configuration files, of course).

3. As it was pointed out by other users, it would be nice to provide some interface to customize configure options (or at least extend them so that features/modules required for CWP to work may not be disabled).

Anyway, CWP is a great piece of software, I started testing it a few days ago and has been loving it, so far. Keep up the good work, guys!
Title: Re: PHP Version Switcher
Post by: studio4host on August 03, 2017, 01:14:53 PM
Hello,

I have a problem with mi PHP Versión Switcher, i'm trying to install a php-ldap module, I foundthis option http://forum.centos-webpanel.com/php/enable-php-ldap-extesion-in-php-5-6-(centos-6)/ (http://forum.centos-webpanel.com/php/enable-php-ldap-extesion-in-php-5-6-(centos-6)/) , but i can't add new flags to the PHP Version Switcher compiler, can you help me to find a solution?

My CWP Versión is: 0.9.8.333 and the PHP Version is 5.6.30


this is simple
Just edit configuration file for version you want to change and the open php switcher

Configuration files location: /usr/local/cwpsrv/htdocs/resources/conf/php_switcher/
Edit file for php version you need, example for php 5.6 and add this at end of the file

nano /usr/local/cwpsrv/htdocs/resources/conf/php_switcher/5.6.ini

Code: [Select]
[myconf1]
default=1
option="--with-pcre-regex"

Detailed
http://wiki.centos-webpanel.com/php-version-switcher


The version switcher works fine for me but I have a few concerns with it:

1. What's the point of providing such feature while there's a packaged version available (cwp-php) installed by default? I believe it would be more logical to package and maintain one particular version used as the PHP interpreter for the CWP web interface and several other system functions and use PHP Selector for providing PHP usage feature for users. Now that I compiled version 5.6.31 using the Version Switcher, I have two separate instances of the same PHP version (one in /usr/local and one in /opt/alt/php56) which looks pointless to me.

This is not related /usr/local version is default version (from php switcher) while /opt/alt is installed by php selector.



Title: Re: PHP Version Switcher
Post by: tiagondelgado on March 20, 2018, 06:03:28 PM
When trying change to version 7 i get that error:

configure: error: PDO_MYSQL configure failed, MySQL 4.1 needed. Please check config.log for more information.
Configure DONE!

Title: Re: PHP Version Switcher
Post by: jamb on November 12, 2018, 03:04:52 PM
Hello
In the PHP Selector section when I click Install Dependencies, then in the log file:
Code: [Select]
Finished Dependency Resolution
Error:  Multilib version problems found. This often means that the root
       cause is something else and multilib version checking is just
       pointing out that there is a problem. Eg.:

         1. You have an upgrade for libc-client which is missing some
            dependency that another package requires. Yum is trying to
            solve this by installing an older version of libc-client of the
            different architecture. If you exclude the bad architecture
            yum will tell you what the root cause is (which package
            requires what). You can try redoing the upgrade with
            --exclude libc-client.otherarch ... this should give you an error
            message showing the root cause of the problem.

         2. You have multiple architectures of libc-client installed, but
            yum can only see an upgrade for one of those arcitectures.
            If you don't want/need both architectures anymore then you
            can remove the one with the missing update and everything
            will work.

         3. You have duplicate versions of libc-client installed already.
            You can use "yum check" to get yum show these errors.

       ...you can also use --setopt=protected_multilib=false to remove
       this checking, however this is almost never the correct thing to
       do as something else is very likely to go wrong (often causing
       much more problems).

       Protected multilib versions: libc-client-2007e-11.el6.i686 != libc-client-2007e-11.el6.art.x86_64
Error: Protected multilib versions: libcom_err-1.41.12-24.el6.i686 != libcom_err-1.42.5-2.el6.x86_64
mkdir: cannot create directory `/usr/kerberos': File exists
ln: creating symbolic link `/usr/kerberos/lib/lib64': File exists
ln: creating symbolic link `/usr/lib/libjpeg.so': File exists
ln: creating symbolic link `/usr/lib/libpng.so': File exists
ln: creating symbolic link `/usr/lib/libmysqlclient.so.16': File exists
ln: creating symbolic link `/usr/lib/libmysqlclient.so': File exists
ln: creating symbolic link `/usr/lib/libexpat.so': File exists

My CWP Versión is: 0.9.8.333 and the PHP Version is 0.9.8.573
Title: Re: PHP Version Switcher
Post by: calivent on December 12, 2018, 06:22:22 PM
every time I make a new installation of the CWP7, exit error I can not configure the PHP Selector (it does not work)
it stays in php 5.6.

Quote
............ ....
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://bugzilla.redhat.com/bugzilla> for instructions.
make: *** [ext/date/lib/parse_date.lo] Error 1
Make Install DONE!
####################
PHP Rebuild Completed
#########################

Error:Can't add notification!DELETING DSO Handler
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using svr.miserver.com. Set the 'ServerName' directive globally to suppress this message


php_selector not found
Title: Re: PHP Version Switcher
Post by: paulo_crash on February 19, 2019, 10:36:22 PM
It does not work, I'm trying to compile PHP 7.2.x and 7.3.x and none goes, it does the whole process but does not exchange the PHP version.  :'(
Title: Re: PHP Version Switcher
Post by: rex2k1 on February 25, 2019, 08:13:07 AM
Same problem here, compiles without error, but still 5.X version as main (and shell) version
Title: Re: PHP Version Switcher
Post by: mandrivian on August 10, 2019, 05:00:55 PM
Hi,

Is there any way to enable php selector in every user accounts.? So they can switch from one version into another that suites their need.
Some of my hosting clients are former cpanel clients, they have the php selector on their cpanel account. But can't find it in cwp
Title: Re: PHP Version Switcher
Post by: talhas8 on September 05, 2019, 01:29:25 PM
I am also not able to change my php version. I am stuck at 5.6.37.
I have to instances of CWP running, one is pro version, 2nd is free version. Both having same issues.
I am using CentOS 6.10 (Final)

The logs are stuck at this message:

1st Server:
Make Install DONE!
####################
PHP Rebuild Completed
#########################

Error:Can't add notification!


2nd Server:
Make Install DONE!
####################
PHP Rebuild Completed
#########################

DELETING DSO Handler

Is there any work around ?
Title: Re: PHP Version Switcher
Post by: webbrowser on September 19, 2019, 08:33:55 PM
I'm have the exact same problem on a new server install. It simply will not change from PHP version 5.6.37. It stalls at


####################
PHP Rebuild Completed
#########################

DELETING DSO Handler

help from anyone please? I have a project that I need to get completed urgently.
Title: Re: PHP Version Switcher
Post by: Ivansmo on October 28, 2019, 11:17:42 PM
Hi to all. I have just install new php version and after hard reset my server everything I see is working great. However, when I look into log file, I have this error on the end..

Code: [Select]
'LICENSE.txt' -> '/usr/local/ioncube/LICENSE.txt'
'README.txt' -> '/usr/local/ioncube/README.txt'
'USER-GUIDE.pdf' -> '/usr/local/ioncube/USER-GUIDE.pdf'
'USER-GUIDE.txt' -> '/usr/local/ioncube/USER-GUIDE.txt'
'ioncube_loader_lin_4.1.so' -> '/usr/local/ioncube/ioncube_loader_lin_4.1.so'
'ioncube_loader_lin_4.2.so' -> '/usr/local/ioncube/ioncube_loader_lin_4.2.so'
'ioncube_loader_lin_4.3.so' -> '/usr/local/ioncube/ioncube_loader_lin_4.3.so'
'ioncube_loader_lin_4.3_ts.so' -> '/usr/local/ioncube/ioncube_loader_lin_4.3_ts.so'
'ioncube_loader_lin_4.4.so' -> '/usr/local/ioncube/ioncube_loader_lin_4.4.so'
'ioncube_loader_lin_4.4_ts.so' -> '/usr/local/ioncube/ioncube_loader_lin_4.4_ts.so'
'ioncube_loader_lin_5.0.so' -> '/usr/local/ioncube/ioncube_loader_lin_5.0.so'
'ioncube_loader_lin_5.0_ts.so' -> '/usr/local/ioncube/ioncube_loader_lin_5.0_ts.so'
'ioncube_loader_lin_5.1.so' -> '/usr/local/ioncube/ioncube_loader_lin_5.1.so'
'ioncube_loader_lin_5.1_ts.so' -> '/usr/local/ioncube/ioncube_loader_lin_5.1_ts.so'
'ioncube_loader_lin_5.2.so' -> '/usr/local/ioncube/ioncube_loader_lin_5.2.so'
'ioncube_loader_lin_5.2_ts.so' -> '/usr/local/ioncube/ioncube_loader_lin_5.2_ts.so'
'ioncube_loader_lin_5.3.so' -> '/usr/local/ioncube/ioncube_loader_lin_5.3.so'
'ioncube_loader_lin_5.3_ts.so' -> '/usr/local/ioncube/ioncube_loader_lin_5.3_ts.so'
'ioncube_loader_lin_5.4.so' -> '/usr/local/ioncube/ioncube_loader_lin_5.4.so'
'ioncube_loader_lin_5.4_ts.so' -> '/usr/local/ioncube/ioncube_loader_lin_5.4_ts.so'
'ioncube_loader_lin_5.5.so' -> '/usr/local/ioncube/ioncube_loader_lin_5.5.so'
'ioncube_loader_lin_5.5_ts.so' -> '/usr/local/ioncube/ioncube_loader_lin_5.5_ts.so'
'ioncube_loader_lin_5.6.so' -> '/usr/local/ioncube/ioncube_loader_lin_5.6.so'
'ioncube_loader_lin_5.6_ts.so' -> '/usr/local/ioncube/ioncube_loader_lin_5.6_ts.so'
'ioncube_loader_lin_7.0.so' -> '/usr/local/ioncube/ioncube_loader_lin_7.0.so'
'ioncube_loader_lin_7.0_ts.so' -> '/usr/local/ioncube/ioncube_loader_lin_7.0_ts.so'
'ioncube_loader_lin_7.1.so' -> '/usr/local/ioncube/ioncube_loader_lin_7.1.so'
'ioncube_loader_lin_7.1_ts.so' -> '/usr/local/ioncube/ioncube_loader_lin_7.1_ts.so'
'ioncube_loader_lin_7.2.so' -> '/usr/local/ioncube/ioncube_loader_lin_7.2.so'
'ioncube_loader_lin_7.2_ts.so' -> '/usr/local/ioncube/ioncube_loader_lin_7.2_ts.so'
'ioncube_loader_lin_7.3.so' -> '/usr/local/ioncube/ioncube_loader_lin_7.3.so'
'ioncube_loader_lin_7.3_ts.so' -> '/usr/local/ioncube/ioncube_loader_lin_7.3_ts.so'
'loader-wizard.php' -> '/usr/local/ioncube/loader-wizard.php'
yes: standard output: Broken pipe
yes: write error

If someone can explain this error, or give me a clue how to check if my new php version is completely working
Title: Re: PHP Version Switcher
Post by: funnelx on December 01, 2019, 06:44:27 AM
Hello,
How do I install PHP 7.4 with the PHP Switcher?
It doesn't work for that version.
Title: Re: PHP Version Switcher
Post by: kandalf on April 19, 2020, 05:03:20 PM
I also want php 7.4 any tips to install it?
Title: Re: PHP Version Switcher
Post by: studio4host on April 19, 2020, 08:31:03 PM
centos still has some missing packages or has older packages not suitable for php 7.4 so running 7.4 would require customization so it's better to wait for it a little longer than to have other issues.
Title: Re: PHP Version Switcher
Post by: rafpelegri on February 02, 2021, 05:11:00 PM
Hi.
I am trying to switch PHP version to 7.3.19, but got the error "tar: php-7.3.19.tar.gz: Cannot open: No such file or directory". Found the error in script /usr/local/src/php-rebuild.sh:

Code: [Select]

# PHP Sources
PHPDOWNLOADVERCWP=`wget -q -S --spider "http://dl1.centos-webpanel.com/files/php/php-$version.tar.gz" -O - 2>&1 | sed -ne '/Content-Length/{s/.*: //;p}'`
PHPDOWNLOADVERMUSEUM=`wget -q -S --spider "https://museum.php.net/php$majorversion/php-$version.tar.gz" -O - 2>&1 | sed -ne '/Content-Length/{s/.*: //;p}'`

# Check if on CWP source file exist (redirect gives code 200 always)
if [ -z "$PHPDOWNLOADVERCWP" ];then
        PHPDOWNLOADVERCWP=0
fi

# Check if file size is over 8MB
if [ $PHPDOWNLOADVERCWP -ge 8000000 ];then
        phpsource="http://dl1.centos-webpanel.com/files/php/php-$version.tar.gz"
elif [ $PHPDOWNLOADVERMUSEUM -ge 8000000 ];then
        phpsource="https://museum.php.net/php5/php-$version.tar.gz"
else
    echo "Failed to Download PHP version $version!"
        exit 1
fi

The file php-7.3.19.tar.gz is tested for the size of 8MB. Since it is bigger then 8MB, the secondary link is used. But there is a problem: to download file from secondary link, the link is for php5 fixed in the code. Should be a variable $majorversion in there.

The script is ganerated automatic. How can I fix that?
Title: Re: PHP Version Switcher
Post by: studio4host on February 02, 2021, 05:57:51 PM
file is ~18MB so cwp download link must work, here is direct to test download on your server
http://dl1.centos-webpanel.com/files/php/php-7.3.19.tar.gz
Title: Re: PHP Version Switcher
Post by: kaavain on August 24, 2021, 01:45:04 PM
Switched to 5.3.29 (CentOS 7, native 5.6)

Dashboard: PHP version: 5.3.29
PHP Settings/PHP Info: You are running PHP version: 5.3.29 BUT! table below PHP Version 5.6.37
Has one user/website and phpinfo.php shows also 5.6.37

PHP Rebuild log has only two lines with the "error"

DELETING DSO Handler
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1. Set the 'ServerName' directive globally to suppress this message
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
chdir: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory

What's wrong?
Title: Re: PHP Version Switcher
Post by: sappurit on October 25, 2021, 08:15:30 AM
CWP  0.9.8.1095 Free version
CentOS Linux release 8.4.2105
Kernel Version: 4.18.0-305.19.1.el8_4.x86_64
Platform: x86_64 kvm
Apache/2.4.48
MySQL version: 10.4.21-MariaDB

I can upgrade from 5.6.xx to 5.6.37.
But now stuck at 5.6.37 forever. Very headache.
Can't downgrade to 5.3.x / 5.4.x / 5.5.x or upgrade to 5.6.40

Title: Re: PHP Version Switcher
Post by: AcemiPenguen on August 03, 2022, 02:07:40 PM
CWP 0.9.8.1142 free version and i cannot use php switch
how can i pay for pro version? i tried with skrill but cannot pay..
Can anybody help?
Title: Re: PHP Version Switcher
Post by: hdaackda on February 23, 2024, 05:16:16 PM
I am on version 7.4

Tried switching to 8.3.1

Many times. Process gets complete.. but PHP is still on 7.4

This is happening on 2 Web Panels (i have 2 servers.. both have Centos webpanel PRO.. )

Any suggestions pls?
Title: Re: PHP Version Switcher
Post by: overseer on February 23, 2024, 11:39:12 PM
Try 8.2.14 and see if that works for you.
Title: Re: PHP Version Switcher
Post by: hdaackda on February 24, 2024, 12:24:08 AM
Try 8.2.14 and see if that works for you.

yes, 8.2.14 worked, but 8.3 and 8.31 not working! strange

8.3 and 8.31 not even working after 8.2.14
Title: Re: PHP Version Switcher
Post by: overseer on February 24, 2024, 02:42:28 AM
There have been some issues with the 8.3.x tree and Starburst pointed out a workaround in another thread. You could try to build without IonCube and mbstring support and see if that works for you. (As usual, I am waiting on the sidelines because WordPress isn't even fully 8.2 compatible yet...)
Title: Re: PHP Version Switcher
Post by: Starburst on February 24, 2024, 12:53:16 PM
CWP 0.9.8.1142 free version and i cannot use php switch
how can i pay for pro version? i tried with skrill but cannot pay..
Can anybody help?

PHP Switcher2 * PHP-FPM is part of CWPpro, it does not function in the Free version of CWP.
But from your post above, you already know that.

Also for some odd reason, for PHP-CGI to compile correctly, you have to have your DNS in the Admin panel set to valid servers, and have the hostname SSL installed.

Brought up 5 servers earlier in February, and found that little bug.