Apply patch to PHP 5.6 for running with OpenSSL 0.11#1041
Apply patch to PHP 5.6 for running with OpenSSL 0.11#1041morozov merged 1 commit intophpbrew:masterfrom jasny:5.6-openssl-0.11
Conversation
|
@jasny it didn't work for me: Are you sure it should be an after-configure task? I'm trying to apply a similar patch in #1044, but it's part of the pre-configure task and requires |
|
@morozov It's tested it, but "works on my machine" 🙁 What do you see when you run the following? Autoconf should be using pkg-config and not even try to find the lib manually. |
|
@jasny please look at the log I posted above. The build fails before your patch gets applied. How can it work? Here's the output:
|
|
@morozov I can, but I don't think it will make any difference. The patch doesn't touch the autooconf files and only modifies the c files of the openssl PHP ext. I can't reproduce the issue you're having by any means. Can you please do some debugging. In In that function you see the section where pkg-config is used to find the openssl libs. It's commented with This should just work. The part where alternative methods are tried should not be executed. Please check why |
|
@jasny thank you for the clarification. Looks like we're experiencing different issues, and I was under the impression the one you're trying to fix is also related to the configuration, not the code. I'll follow the steps you suggested above and will provide you the additional information as soon as I can. |
|
@jasny, the problem was that when I tried using your build, |
The API of OpenSSL has changed from 0.10 to 0.11. This makes it difficult to run PHP 5 on an updated system. The patch is from php/php-src#2667.
|
does not work on mac os with brew installed openssl 1.1 php -v runs: phpbrew ext install openssl stable -- --with-openssl="$(brew --prefix openssl)" openssl.c:3560:9: error: incomplete definition of type 'struct dsa_st' |
|
Weird, this PR seems not working, I have to apply the openssl 1.1 patch manually. Here comes the patch output message: You can see the last message, it seems patch nothing. I build php-5.6.40 with phpbrew 1.23.1 with this PR |
|
@danywheeler The patch is not applied when using Typically @markwu Make sure you have the openssl variant ( public function match(Buildable $build, Logger $logger)
{
return version_compare($build->getVersion(), '5.6') === 0
&& version_compare($build->getVersion(), '5.6.31') >= 0 // patch only works for 5.6.31 and up
&& $build->isEnabledVariant('openssl');
} |
|
Ah ... Okay, I suppose it apply to default. I'll make a test and let you know. |
|
I tried again, the rules triggered, but patches nothing. I have to download the patch and apply it by myself. phpbrew commandphpbrew --debug install --jobs "$(nproc)" 5.6.40 +default +openssl +dbs +dba +apxs2 +bz2="$(brew --prefix bzip2)" +zlib="$(brew --prefix zlib)" +curl="$(brew --prefix curl)"manually patch commandwget https://patch-diff.githubusercontent.com/raw/php/php-src/pull/2667.patch
patch -p 1 < 2667.patchdebug log |
|
I have problem with phpbrew 1.24.1 to build php-5.6.40, that's why I revert to phpbrew 1.23.1 and apply this PR only, to see if I can figure out the problem. And I found I get the same result. |
|
Can I get more detail log when do the patch job? |
|
@jasny Even with the command you typed, it's still not working, don't know what's the problem, but be sure related to openssl. same error as before. |
|
Okay, I think I found the problem. the public function match(Buildable $build, Logger $logger)
{
return version_compare($build->getVersion(), '6.0.0') === -1
&& version_compare($build->getVersion(), '5.6.31') >= 0 // patch only works for 5.6.31 and up
&& $build->isEnabledVariant('openssl');
}@morozov Should I create a new issue for this? |
|
@markwu please do. Although, I don't think we should express the requirement for PHP 5.6 using 6.0.0 as a boundary. |
|
If so, the only way I can think about is using explode() to find PHP_MAJOR_VERSION.PHP_MINOR_VERSION only, then use the version string to compare. |
|
@markwu indeed. Please go ahead and use your original approach. Given how non-obvious this code is, you can try adding a test that covers the |
The API of OpenSSL has changed from 0.10 to 0.11. This makes it difficult to run PHP 5 on an updated system. The patch is from php/php-src#2667.
Note that the patch only works for PHP 5.6.31 or higher. While not ideal, being able to install the last (released) PHP5 version will be sufficient for most.