Author Topic: Issues with PHP version swither (php_switch_v2)  (Read 163 times)

0 Members and 1 Guest are viewing this topic.

Offline
*
Issues with PHP version swither (php_switch_v2)
« on: October 25, 2025, 01:11:03 PM »
Hello!
1. First problem - there is a very PAINFUL process of updating PHP with this "version swither". I lost 4 hours of trying to update PHP from 7.4.33 to at least 3, or 4 versions of PHP - and I still can't update to PHP 8.1.33. I barely updated to php v 8.1.3. It simply doesn't want to update to 8.1.33. No errors. You can check the logs in the bottom of this post.
2. There is an issue with the uploadprogress module after compiling to 8.1.3. Check the errors in the bottom of this post.
3. FIX YOUR FORUM WEBSITE! You have SSL errors in browsers and broken links that have PHPSESSID and cookies in them!
LOGS:
1.
Code: [Select]
Last metadata expiration check: 0:03:19 ago on Sat Oct 25 15:46:39 2025.
Package ImageMagick-6.9.13.25-1.el8.x86_64 is already installed.
Package ImageMagick-devel-6.9.13.25-1.el8.x86_64 is already installed.
Package ImageMagick-perl-6.9.13.25-1.el8.x86_64 is already installed.
Dependencies resolved.
Nothing to do.
Complete!
Configuring for:
PHP Api Version:         20210902
Zend Module Api No:      20210902
Zend Extension Api No:   420210902
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for a sed that does not truncate output... /usr/bin/sed
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for cc... cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking how to run the C preprocessor... cc -E
checking for icc... no
checking for suncc... no
checking for system library directory... lib
checking if compiler supports -Wl,-rpath,... yes
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-pc-linux-gnu
checking for PHP prefix... /usr/local
checking for PHP includes... -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib
checking for PHP extension directory... /usr/local/lib/php/extensions/no-debug-non-zts-20210902
checking for PHP installed headers prefix... /usr/local/include/php
checking if debug is enabled... no
checking if zts is enabled... no
checking for gawk... gawk
checking whether to enable the imagick extension... yes, shared
checking for pkg-config... /usr/bin/pkg-config
checking ImageMagick MagickWand API configuration program... checking Testing /usr/local/bin/MagickWand-config... Doesn't exist
checking Testing /usr/bin/MagickWand-config... It exists
found in /usr/bin/MagickWand-config
checking if ImageMagick version is at least 6.5.3... found version 6.9.13-25 Q16
checking for MagickWand.h or magick-wand.h header... user location /usr/include/ImageMagick-6/wand/MagickWand.h
checking PHP version is at least 5.6.0... yes. found 8.1.3
libs
-lMagickWand-6.Q16 -lMagickCore-6.Q16


checking for MagickGetVersion... yes
checking omp_pause_resource_all usability... no
checking for a sed that does not truncate output... /usr/bin/sed
checking for ld used by cc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for /usr/bin/ld option to reload object files... -r
checking for BSD-compatible nm... /usr/bin/nm -B
checking whether ln -s works... yes
checking how to recognize dependent libraries... pass_all
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking the maximum length of command line arguments... 1572864
checking command to parse /usr/bin/nm -B output from cc object... ok
checking for objdir... .libs
checking for ar... ar
checking for ranlib... ranlib
checking for strip... strip
checking if cc supports -fno-rtti -fno-exceptions... no
checking for cc option to produce PIC... -fPIC
checking if cc PIC flag -fPIC works... yes
checking if cc static flag -static works... no
checking if cc supports -c -o file.o... yes
checking whether the cc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no

creating libtool
appending configuration tag "CXX" to libtool
configure: patching config.h.in
configure: creating ./config.status
config.status: creating config.h
find . -name \*.gcno -o -name \*.gcda | xargs rm -f
find . -name \*.lo -o -name \*.o -o -name \*.dep | xargs rm -f
find . -name \*.la -o -name \*.a | xargs rm -f
find . -name \*.so | xargs rm -f
find . -name .libs -a -type d|xargs rm -rf
rm -f libphp.la      modules/* libs/*
rm -f ext/opcache/jit/zend_jit_x86.c
rm -f ext/opcache/jit/zend_jit_arm64.c
/bin/sh /usr/local/src/imagick/libtool --mode=compile cc -I. -I/usr/local/src/imagick -I/usr/local/src/imagick/include -I/usr/local/src/imagick/main -I/usr/local/src/imagick -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -I/usr/include/ImageMagick-6  -DHAVE_CONFIG_H  -g -O2   -I/usr/include/ImageMagick-6 -fopenmp -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16  -DZEND_COMPILE_DL_EXT=1 -c /usr/local/src/imagick/imagick_file.c -o imagick_file.lo  -MMD -MF imagick_file.dep -MT imagick_file.lo
mkdir .libs
 cc -I. -I/usr/local/src/imagick -I/usr/local/src/imagick/include -I/usr/local/src/imagick/main -I/usr/local/src/imagick -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -I/usr/include/ImageMagick-6 -DHAVE_CONFIG_H -g -O2 -I/usr/include/ImageMagick-6 -fopenmp -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16 -DZEND_COMPILE_DL_EXT=1 -c /usr/local/src/imagick/imagick_file.c -MMD -MF imagick_file.dep -MT imagick_file.lo  -fPIC -DPIC -o .libs/imagick_file.o
/bin/sh /usr/local/src/imagick/libtool --mode=compile cc -I. -I/usr/local/src/imagick -I/usr/local/src/imagick/include -I/usr/local/src/imagick/main -I/usr/local/src/imagick -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -I/usr/include/ImageMagick-6  -DHAVE_CONFIG_H  -g -O2   -I/usr/include/ImageMagick-6 -fopenmp -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16  -DZEND_COMPILE_DL_EXT=1 -c /usr/local/src/imagick/imagick_class.c -o imagick_class.lo  -MMD -MF imagick_class.dep -MT imagick_class.lo
 cc -I. -I/usr/local/src/imagick -I/usr/local/src/imagick/include -I/usr/local/src/imagick/main -I/usr/local/src/imagick -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -I/usr/include/ImageMagick-6 -DHAVE_CONFIG_H -g -O2 -I/usr/include/ImageMagick-6 -fopenmp -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16 -DZEND_COMPILE_DL_EXT=1 -c /usr/local/src/imagick/imagick_class.c -MMD -MF imagick_class.dep -MT imagick_class.lo  -fPIC -DPIC -o .libs/imagick_class.o
/bin/sh /usr/local/src/imagick/libtool --mode=compile cc -I. -I/usr/local/src/imagick -I/usr/local/src/imagick/include -I/usr/local/src/imagick/main -I/usr/local/src/imagick -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -I/usr/include/ImageMagick-6  -DHAVE_CONFIG_H  -g -O2   -I/usr/include/ImageMagick-6 -fopenmp -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16  -DZEND_COMPILE_DL_EXT=1 -c /usr/local/src/imagick/imagickdraw_class.c -o imagickdraw_class.lo  -MMD -MF imagickdraw_class.dep -MT imagickdraw_class.lo
TEXT TRIMMED HERE. Max 20k characters.

2.
Code: [Select]
PHP Warning:  PHP Startup: uploadprogress: Unable to initialize module Module compiled with module API=20190902 PHP    compiled with module API=20210902 These options need to match in Unknown on line 0

Offline
*****
Re: Issues with PHP version swither (php_switch_v2)
« Reply #1 on: October 25, 2025, 02:17:03 PM »
This seems to be a bug in the PHP switcher. You can work around it by clearing /usr/local/src and initiate the build in the CWP Admin GUI. Then you capture the PHP build script that is downloaded as the failed build process takes place (cp it to another file so it doesn't get cleaned up). Then you run that script in the CLI and it should build successfully. A very odd problem & solution, to be sure.

An end-run around the bug is to just use php-fpm instead, which doesn't seem to have these problems and all php versions build successfully. Plus, it's more performant and you have the ability to use different versions of php with different vhosts.

Offline
*
Re: Issues with PHP version swither (php_switch_v2)
« Reply #2 on: October 25, 2025, 02:30:13 PM »
I don't have cwp pro. For php-fpm you need to have cwp pro.

It's a dodgy solution and I don't want to make experiments on a big server and loose again a few hours.
Hope cwp developers see this post. Start making things easier for your cwp users, not harder. No offence intended.

Offline
*****
Re: Issues with PHP version swither (php_switch_v2)
« Reply #3 on: October 25, 2025, 11:07:17 PM »
What OS are you installing CWP onto?

Are you able to switch to PHP 8.2 or 8.3?

Offline
*****
Re: Issues with PHP version swither (php_switch_v2)
« Reply #4 on: October 25, 2025, 11:41:47 PM »
CWP Pro is well worth the few $$ to support the development and gain useful features.

Offline
*
Re: Issues with PHP version swither (php_switch_v2)
« Reply #5 on: October 26, 2025, 05:20:24 PM »
What OS are you installing CWP onto?

Are you able to switch to PHP 8.2 or 8.3?
Cwp is installed on Almalinux 8.10
There are 2 versions of PHP that don't have vulnerabilities: 8.1.33 and 8.2.29. No, it did not work switching to php 8.2. I'm not interested in making experiments with my time.

Offline
*
Re: Issues with PHP version swither (php_switch_v2)
« Reply #6 on: October 26, 2025, 05:23:26 PM »
CWP Pro is well worth the few $$ to support the development and gain useful features.
Yeah right, I can see that very well with the "development" part. Buy and use pro, then surprize - your server is hacked. Is cwp going to pay any damages to hundreds of websites for not securing their panel? No.

Offline
*****
Re: Issues with PHP version swither (php_switch_v2)
« Reply #7 on: October 26, 2025, 06:35:37 PM »
I don't follow your logic. No company offers indemnity against CVE or 0-day exploits. Not Red Hat, not Oracle, not cPanel. None will reimburse you for lost time or recovery efforts (and even a product refund is very unlikely). Many are setting up bug bounty programs to prevent such public damage to their products (and therefore their reputation) and the open source world expects their code to be reviewed by knowledgeable coders. You can purchase insurance against exploits if you want, though...

But really, this is a value proposition to provide you with an inexpensive web panel to make administration easier for you and end users. It's up to you to secure your core system and reduce your attack surface. A secure (and backed up) system won't have as much of a problem with a 0-day or CVE without an immediate patch.

Offline
*
Re: Issues with PHP version swither (php_switch_v2)
« Reply #8 on: October 27, 2025, 11:05:57 PM »
I don't follow your logic. No company offers indemnity against CVE or 0-day exploits. Not Red Hat, not Oracle, not cPanel. None will reimburse you for lost time or recovery efforts (and even a product refund is very unlikely). Many are setting up bug bounty programs to prevent such public damage to their products (and therefore their reputation) and the open source world expects their code to be reviewed by knowledgeable coders. You can purchase insurance against exploits if you want, though...

But really, this is a value proposition to provide you with an inexpensive web panel to make administration easier for you and end users. It's up to you to secure your core system and reduce your attack surface. A secure (and backed up) system won't have as much of a problem with a 0-day or CVE without an immediate patch.
Sorry to disappoint you but you are wrong - "It's up to you to secure your core system and reduce your attack surface.". Stop making excuses for the devs.
Still no fix for php_switch_v2.

Offline
*****
Re: Issues with PHP version swither (php_switch_v2)
« Reply #9 on: Today at 12:06:50 AM »
This is capitalism:
Pay yourself for your time.
Pay a sysadmin to secure and maintain your system for you.
Pay the CWP devs for CWP Pro with the elegant php-fpm solution.

Offline
**
Re: Issues with PHP version swither (php_switch_v2)
« Reply #10 on: Today at 04:46:43 AM »
My experience is CWP does require some server admin knowledge in order to maintain or at least the want to learn. This is however something that I personally enjoy.  Updates & fixes can take time but they do come (they are pretty much on to the critical ones), not bad for a small outfit.

I can understand that it’s not for everyone but if you want a glossy server OS with the support of a corporate organisation behind it (we all know who that is) your going to have to pay for it.
Web Design, Development & Web Hosting
https://6sense.com.au

Offline
*****
Re: Issues with PHP version swither (php_switch_v2)
« Reply #11 on: Today at 01:18:43 PM »
Wasn't going to comment on this thread, because I think everyone knows my position.

To run ANY server you NEED to be a Sys Admin with the knowledge of such.
This includes knowing how to HARDEN a servers security.

If not, then you should just look at a webhosting or Managed VPS plan somewhere, that has the backend support that knows what they are doing.

Funny enough, I'm typing this as I am updating our servers.

Offline
*
Re: Issues with PHP version swither (php_switch_v2)
« Reply #12 on: Today at 06:30:08 PM »
Well, you guys talk like you're the experts and instead of offering solutions for the issues, you talk bla bla's about paying "devs" and "sysadmins". Don't talk like that if you don't know who you're talking to. You have no idea who am I and what I do. Maybe I run a datacenter, who knows?
Still no fix for php_switch_v2. I'm talking about BUGS, you are talking about "harden a server security". Is this a joke?  ???
P.S. in the past I paid for CWP PRO. I stopped doing that when I saw that the devs didn't fix things when they supposed to.
« Last Edit: Today at 06:34:02 PM by Linux »

Offline
*****
Re: Issues with PHP version swither (php_switch_v2)
« Reply #13 on: Today at 09:38:16 PM »
I lost 4 hours of trying to update PHP from 7.4.33 to at least 3, or 4 versions of PHP - and I still can't update to PHP 8.1.33.
Your time must not be worth very much if you would rather spend 4 hours than $1/month for CWP Pro. (Time = Money)

Online
***
Re: Issues with PHP version swither (php_switch_v2)
« Reply #14 on: Today at 10:09:39 PM »
1. There are no errors. Please show us the whole log of the php compilation process.

2. To fix uploadprogress try to do following:
Code: [Select]
cd /usr/local/src/
rm -rf uploadprogress*
wget https://pecl.php.net/get/uploadprogress
tar -xvzf uploadpogress-2*
cd uploadpogress*
phpize
configure
make
make install