Little addition :
The error so, which is the patch is not applying... well, normal (see below)
- Applying patch 0029-php-5.4.9-fixheader.patch
- patching file configure.ac
- Hunk #1 FAILED at 1303.
- 1 out of 1 hunk FAILED -- rejects in file configure.ac
- Patch 0029-php-5.4.9-fixheader.patch does not apply (enforce with -f)
- /var/www/imscp/gui/plugins/PhpSwitcher/PhpCompiler/Makefile:230: recipe for target 'patch-stamp' failed
- make: Leaving directory '/usr/local/src/phpswitcher/php-7.4.8'
- I: Copying back the cached apt archive contents
- I: unmounting /var/www/imscp/gui/plugins/PhpSwitcher/PhpCompiler filesystem
- I: unmounting /usr/local/src/phpswitcher/php-7.4.8 filesystem
- I: unmounting /opt/phpswitcher/20200719 filesystem
- I: unmounting dev/ptmx filesystem
- I: unmounting dev/pts filesystem
- I: unmounting dev/shm filesystem
- I: unmounting proc filesystem
- I: unmounting sys filesystem
- I: Cleaning COW directory
- I: forking: rm -rf /var/cache/pbuilder/build/cow.11164
- [ERROR] main: An error occurred while executing MAKE(1) target(s) for PHP 7.4.8: Starting pkgProblemResolver with broken count: 0
- Starting 2 pkgProblemResolver with broken count: 0
- Done
- Starting pkgProblemResolver with broken count: 0
- Starting 2 pkgProblemResolver with broken count: 0
- Done
- Extracting templates from packages: 100%
- make: [unprepared] Error 1 (ignored)
- No patch removed
- make: *** [patch-stamp] Error 1
Display More
For this attempt, I set the DebHelper level to 9 (max is 12, but I didn't tested with)...
Then, as this is working with PHP7.4.7 and no 7.4.8, I checked the changes in the "configure.ac" file, and... see by yourself:
PHP 7.4.7:
- PHP_UNAME=`uname -a | xargs`
- AC_DEFINE_UNQUOTED(PHP_UNAME,"$PHP_UNAME",[uname -a output])
- PHP_OS=`uname | xargs`
PHP 7.4.8:
- UNAME=`uname -a | xargs`
- PHP_UNAME=${PHP_UNAME:-$UNAME}
- AC_DEFINE_UNQUOTED(PHP_UNAME,"$PHP_UNAME",[uname -a output])
- PHP_OS=`uname | xargs`
The patch file now :
- -PHP_UNAME=`uname -a | xargs`
- +PHP_UNAME=`uname | xargs`
Well... they changed just this little line... why ? I don't know.
So for me, two/tree solutions :
1- We revert the change in the configure.ac file
2- We remove or "correct" the patch from the list
3- We manually edit the configure.ac file to reflect the "patch"
Edit :
Little info : We can simply "remove" the patch from the applicable list of patches too (comment in file : /var/www/imscp/gui/plugins/PhpSwitcher/PhpCompiler/patches/7.4/series)
Whichever solution you apply, the build should be fine after that.
pasted-from-clipboard.png
Quick edit, two of the solutions you can use to build PHP 7.4.8 :
Solution 1 - Edit the patch file
By using your prefered editor, open the files : /var/www/imscp/gui/plugins/PhpSwitcher/PhpCompiler/patches/7.4/0029-php-5.4.9-fixheader.patch*
(Yes, there is "two" files, one with a "~" at the end, don't know why, but it's there)
This file should look like this :
- From: Debian PHP Maintainers <pkg-php-maint@lists.alioth.debian.org>
- Date: Sat, 2 May 2015 10:26:56 +0200
- Subject: php-5.4.9-fixheader
- Make generated php_config.h constant across rebuilds.
- configure.ac | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
- --- a/configure.ac
- +++ b/configure.ac
- fi
- AC_DEFINE_UNQUOTED(PHP_BUILD_DATE,"$PHP_BUILD_DATE",[PHP build date])
- -UNAME=`uname -a | xargs`
- +UNAME=`uname | xargs`
- PHP_UNAME=${PHP_UNAME:-$UNAME}
- AC_DEFINE_UNQUOTED(PHP_UNAME,"$PHP_UNAME",[uname -a output])
- PHP_OS=`uname | xargs`
- AC_DEFINE_UNQUOTED(PHP_OS,"$PHP_OS",[uname output])
Display More
Save, then re-run the build process from PHP Switcher.
/!\ I'm not an expert, and maybe this patch is not needed anymore.
In fact, I don't know what will be the output of the "php_uname()" with this command passed in the config : PHP_UNAME=${PHP_UNAME:-$UNAME}
This patch, if I'm not wrong, is to obfuscate the output of some PHP variables, here, to prevent the leak of the system information through this function "php_uname()" (so that it display only "Linux" and not the whole "uname -a" result).
After I did compile with this modification, the "PHP_OS()" is empty, and "PHP_UNAME()" give the "full" details, so I don't know at the end...
We may revert this configure.ac file as the version 7.4.7 to check if the result is different or not on the webserver after compilation, but no more time for today (idea would be to remove "UNAME" and "PHP_UNAME" lines, and then, add back the "old modified" "PHP_UNAME" line.
Solution 2 - Disable this patch to apply
Simply open this file : /var/www/imscp/gui/plugins/PhpSwitcher/PhpCompiler/patches/7.4/series
Then, found the line where the patch is noted : "0029-php-5.4.9-fixheader.patch"
Add a "#" at the start of the line, so that this patch will NOT be applied.
Save the file then re-run the build process from PHP Switcher.
For both solutions, if you get the error posted in the previous message, just set the system variable :
To set this variable :
export DH_COMPAT=9
and to remove it, simply :
unset DH_COMPAT