Doc #52952 [NEW]: fsockopen() has more dependencies than listed

From: Date: Wed, 29 Sep 2010 14:22:22 +0000
Subject: Doc #52952 [NEW]: fsockopen() has more dependencies than listed
Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-5145@lists.php.net to get a copy of this message
From: Operating system: Linux PHP version: Irrelevant Package: Sockets related Bug Type: Documentation Problem Bug description:fsockopen() has more dependencies than listed Description: ------------ The manual entry for fsockopen() claims this overly simple dependency: "If you have compiled in OpenSSL support, you may prefix the hostname with either ssl:// or tls:// to use an SSL or TLS client connection over TCP/IP to connect to the remote host." However, it will be worth adding a note to point out that "/dev/urandom" is also required, especially setting up chroot'd environments. From what I've dug up briefly, any "/dev/*random" is also acceptable. The error messages given by fsockopen() could also be improved. We experienced a 2 hour development blockage trying to assert that "OpenSSL support" was in fact compiled in... when the root of our problems was simply needing to provide a "/dev/urandom" within the chroot environment. Test script: --------------- // As demonstrated in https://cms.paypal.com/cms_content/US/en_US/files/developer/IPN_PHP_41.txt (retrieved 2010-09-29) $fp = fsockopen ('ssl://www.paypal.com', 443, $errno, $errstr, 30); Expected result: ---------------- While a "/dev/urandom" was our missing link, I'd hope that the documentation will be more thorough and clarify any other potential dependencies that are getting chained along by virtue of OpenSSL. Maybe something along the lines of "In addition to compiled-in support of OpenSSL, your operating environment also needs to support OpenSSL (for example: on *nix systems, ensuring that '/dev/*random' is available for producing random numbers)." The error/warning/notice message that fsockopen() prints out should try to be more clear about why the "ssl://" protocol was not available, mostly to cover this case: - Was there a failure to leverage OpenSSL, even if compiled support is available? The message should then clarify "OpenSSL support has been compiled-in, but cannot be invoked...[because?]" If possible, give even more information: "/dev/*random is unavailable" Actual result: -------------- Without /dev/urandom functioning in our chroot'd environment, fsockopen() prints out some less-than-helpful message about the transport protocol not being available, even though "compiled-in" support was there. -- Edit bug report at http://bugs.php.net/bug.php?id=52952&edit=1 -- Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=52952&r=trysnapshot52 Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=52952&r=trysnapshot53 Try a snapshot (trunk): http://bugs.php.net/fix.php?id=52952&r=trysnapshottrunk Fixed in SVN: http://bugs.php.net/fix.php?id=52952&r=fixed Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=52952&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=52952&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=52952&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=52952&r=needscript Try newer version: http://bugs.php.net/fix.php?id=52952&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=52952&r=support Expected behavior: http://bugs.php.net/fix.php?id=52952&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=52952&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=52952&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=52952&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=52952&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=52952&r=dst IIS Stability: http://bugs.php.net/fix.php?id=52952&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=52952&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=52952&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=52952&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=52952&r=mysqlcfg

« previous php.doc.bugs (#5145) next »