ports/72275: [PATCH] php4 openssl building static
Dmitry A Grigorovich
odip at bionet.nsc.ru
Sun Oct 3 07:50:27 UTC 2004
>Number: 72275
>Category: ports
>Synopsis: [PATCH] php4 openssl building static
>Confidential: no
>Severity: serious
>Priority: high
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: update
>Submitter-Id: current-users
>Arrival-Date: Sun Oct 03 07:50:26 GMT 2004
>Closed-Date:
>Last-Modified:
>Originator: Dmitry A Grigorovich
>Release: FreeBSD 4.8-RELEASE i386
>Organization:
ICiG SB RAS
>Environment:
System: FreeBSD pierino.bionet.nsc.ru 4.8-RELEASE FreeBSD 4.8-RELEASE #5: Sat Oct 4 02:28:14 NOVST 2003 root at pierino.bionet.nsc.ru:/usr/obj/usr/src/sys/ODIP i386
>Description:
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 !
>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
>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 !
--- php4-openssl-static.patch begins here ---
--- Mk/bsd.php.mk.orig Sun Oct 3 12:05:54 2004
+++ Mk/bsd.php.mk Sun Oct 3 12:54:17 2004
@@ -259,6 +259,12 @@
sockets sqlite sybase_ct sysvmsg sysvsem sysvshm \
tidy tokenizer wddx xml xmlrpc xsl xslt yaz yp zip zlib
+.if ${PHP_VER} == 4
+_USE_PHP_DUMMY= openssl
+.else
+_USE_PHP_DUMMY=
+.endif
+
bcmath_DEPENDS= math/php${PHP_VER}-bcmath
bz2_DEPENDS= archivers/php${PHP_VER}-bz2
calendar_DEPENDS= misc/php${PHP_VER}-calendar
@@ -333,12 +339,14 @@
. for extension in ${USE_PHP}
. if ${_USE_PHP_ALL:M${extension}} != "" && exists(${PORTSDIR}/${${extension}_DEPENDS})
-. if defined(USE_PHP_BUILD)
+. if ${_USE_PHP_DUMMY:M${extension}} == ""
+. if defined(USE_PHP_BUILD)
BUILD_DEPENDS+= ${LOCALBASE}/lib/php/${PHP_EXT_DIR}/${extension}.so:${PORTSDIR}/${${extension}_DEPENDS}
-. endif
+. endif
RUN_DEPENDS+= ${LOCALBASE}/lib/php/${PHP_EXT_DIR}/${extension}.so:${PORTSDIR}/${${extension}_DEPENDS}
+. endif
. else
-isyes= ${extension}
+isyes= ${extension}
. if ${isyes:L} != "yes"
check-makevars::
@${ECHO_CMD} "Unknown extension ${extension}."
diff -ur lang/php4.old/Makefile lang/php4/Makefile
--- lang/php4.old/Makefile Sun Aug 8 21:55:19 2004
+++ lang/php4/Makefile Sun Oct 3 13:07:57 2004
@@ -33,6 +33,15 @@
--with-config-file-scan-dir=${PREFIX}/etc/php \
--disable-all
+# Need to compile openssl statically
+.if !defined(WITHOUT_OPENSSL)
+CONFIGURE_ARGS+=--with-openssl=${OPENSSLBASE} \
+ --with-openssl-dir=${OPENSSLBASE}
+
+LDFLAGS+= -lcrypto -lssl
+USE_OPENSSL= yes
+.endif
+
.if !defined(WITH_REGEX_TYPE) || ${WITH_REGEX_TYPE} == "php"
CONFIGURE_ARGS+=--with-regex=php
.else
diff -ur lang/php4.old/Makefile.ext lang/php4/Makefile.ext
--- lang/php4.old/Makefile.ext Mon Aug 30 15:22:38 2004
+++ lang/php4/Makefile.ext Sun Oct 3 13:04:30 2004
@@ -228,6 +228,7 @@
.endif
.if ${PHP_MODNAME} == "openssl"
+BROKEN= "Does not work with php4"
CONFIGURE_ARGS+=--with-openssl=${OPENSSLBASE} \
--with-openssl-dir=${OPENSSLBASE}
--- php4-openssl-static.patch ends here ---
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list