Bug 72275

Summary: [PATCH] php4 openssl building static
Product: Ports & Packages Reporter: Dmitry A Grigorovich <odip>
Component: Individual Port(s)Assignee: Alex Dupre <ale>
Status: Closed FIXED    
Severity: Affects Only Me CC: ale
Priority: Normal    
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
php4-openssl-static.patch
none
newphp4.patch none

Description Dmitry A Grigorovich 2004-10-03 08:50:26 UTC
php4 extension openssl when building shared does not work as necessary
1) http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/71754
2) http://bugs.php.net/bug.php?id=29934

This can't be fixed because PHP4 BUG !

Fix: We need fix many things:

1) Never using php4-openssl
2) Don't break ports in which USE_PHP=openssl
3) Fix mod_php4 to building openssl static

To fix problem:

1) Remove ports php4-extensions, php4-<EXTNAME>, mod_php4
2) Patch ports with follow patch
3) Install mod_php4, php4-extensions
   Don't try install php4-openssl - it's not needed !
How-To-Repeat: 
File test.php

<?php
$fp = fsockopen( "ssl://example.com", 443, $errno, $errstr, $timeout = 30);
if (!$fp) {
    echo "$errstr ($errno)<br />\n";
} else {
    $out = "GET / HTTP/1.1\r\n";
    $out .= "Host: example.com\r\n";
    $out .= "Connection: Close\r\n\r\n";

    fwrite($fp, $out);
    while (!feof($fp)) {
        echo fgets($fp, 4096);
    }
    fclose($fp);
}
?>

Place test.php on web
Show test.php via browser
You are get error 0 !

Remove 'ssl://' and change 443 into 80 - all is ok
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2004-10-03 08:57:07 UTC
Responsible Changed
From-To: freebsd-ports-bugs->ale

Over to maintainer(s)
Comment 2 ryan.holmes 2004-11-10 20:24:01 UTC
Thanks for the patch!

Hey maintainer, can you please commit this or some
other kind of fix? It would be fantastic if I could
once again use the ports system to maintain PHP
installs without having to manually apply patches.
Besides this openssl issue the base/extension split is
great, but this is a serious regression. What can I do
to help?
Comment 3 stijn 2005-01-19 07:32:19 UTC
Hi,

I just ran into this exact same problem again while upgrading PHP; it
seems to me that this PR solves the problem pretty nicely.

I'm going to patch my ports now, and will let you know if it works.
Is there any way that something like this will be committed?

--Stijn

-- 
I have great faith in fools -- self confidence my friends call it.
		-- Edgar Allan Poe
Comment 4 stijn 2005-01-19 07:45:44 UTC
On Wed, Jan 19, 2005 at 08:32:19AM +0100, Stijn Hoop wrote:
> I just ran into this exact same problem again while upgrading PHP; it
> seems to me that this PR solves the problem pretty nicely.
> 
> I'm going to patch my ports now, and will let you know if it works.
> Is there any way that something like this will be committed?

FWIW, the patch failed to apply to my ports sources (lang/php4/Makefile
at least), attached is a new patch. I can confirm that e.g. squirrelmail
works with a reinstall of php4 with this patch.

--Stijn

-- 
The right half of the brain controls the left half of the body.  This means
that only left handed people are in their right mind.
Comment 5 Alex Dupre freebsd_committer freebsd_triage 2005-03-14 14:41:56 UTC
State Changed
From-To: open->closed

Problem fixed, thanks for submission.