php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #64097 Missing streams http and ftp
Submitted: 2013-01-29 14:58 UTC Modified: 2013-01-29 23:54 UTC
From: david at davidsteinsland dot net Assigned:
Status: Not a bug Package: Streams related
PHP Version: 5.4.11 OS: CentOS 6.2
Private report: No CVE-ID: None
 [2013-01-29 14:58 UTC] david at davidsteinsland dot net
Description:
------------
I have compiled PHP 5.4.6. with the following config:

./configure --with-libdir=lib64 --with-config-file-path=/etc  --with-config-file-scan-dir=/etc/php.d  --prefix=/usr --enable-calendar --enable-dom=shared --enable-xmlreader=shared --enable-xmlwriter=shared --enable-bcmath=shared --enable-pcntl --enable-sysvshm=shared --enable-sysvmsg=shared --enable-shmop --enable-exif --enable-zip=shared --enable-ftp --enable-mbstring=shared --enable-sockets --enable-soap=shared --enable-gd-native-ttf --enable-intl=shared --enable-xml --enable-libxml --with-layout=PHP --without-pear --with-apxs2 --with-gmp --with-pcre-regex=/usr  --with-mcrypt=shared --with-mhash --with-zlib --with-bz2 --with-iconv --with-icu-dir=/usr --with-gettext --with-pspell=shared --enable-posix=shared --with-openssl=shared --with-curl=shared --with-curlwrappers --with-gd=shared --with-jpeg-dir=/usr --with-png-dir=/usr --with-zlib-dir=/usr --with-xpm-dir=/usr --with-vpx-dir=/usr --with-freetype-dir=/usr --with-t1lib=/usr --with-libxml-dir=/usr --with-mysql=mysqlnd --with-mysqli=shared,mysqlnd --with-pdo-mysql=shared,mysqlnd --with-xmlrpc=shared --with-xsl=shared --with-tidy=shared,/usr --with-readline=shared

But I haven't got the HTTP and FTP streams registered.
cURL is enabled. Allow_url_fopen is ON.

Registered PHP Streams:
compress.zlib, compress.bzip2, php, file, glob, data, https, ftps, phar, zip

Registered Stream Socket Transports:
tcp, udp, unix, udg, ssl, sslv3, sslv2, tls

Registered Stream Filters:
zlib.*, bzip2.*, convert.iconv.*, string.rot13, string.toupper, string.tolower, string.strip_tags, convert.*, consumed, dechunk, mcrypt.*, mdecrypt.*, http.*

Test script:
---------------
file_get_contents ("http://google.com/");

Expected result:
----------------
The HTML of the URL.

Actual result:
--------------
Warning: file_get_contents(): Unable to find the wrapper "http" - did you forget to enable it when you configured PHP? 

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-01-29 23:43 UTC] cataphract@php.net
-Status: Open +Status: Feedback
 [2013-01-29 23:43 UTC] cataphract@php.net
Please try using this snapshot:

  http://snaps.php.net/php5.4-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/

I can reproduce this in 5.4.6 -- if curl is NOT loaded.

Not with the 5.4 head, though. So this is probably already fixed. Try with a snapshot.
 [2013-01-29 23:49 UTC] cataphract@php.net
Sorry, I must have gotten erroneous results due to not having run make clean. The result in 5.4 HEAD is the same. The behavior is expected though. If you activate curl-wrappers in the configure line the default handler for http streams is not registered.

So the problem is that you're not loading curl.
 [2013-01-29 23:49 UTC] cataphract@php.net
-Status: Feedback +Status: Not a bug
 [2013-01-29 23:54 UTC] rasmus@php.net
Note that it is a bit odd to combine --with-curl=shared --with-curlwrappers in 
the same build. Making the curl extension optional while asking PHP to use it for 
wrapping streams can only lead to heartache like this.
 [2013-01-30 10:12 UTC] david at davidsteinsland dot net
@Rasmus: Yes, when you point it out.. I have compiled PHP several times, but I'm a bit newbie of what config options to use.. :-)

And a big sorry to you two for checking this out.
It was a gigantic fault on my end. When I compiled, I did not notice that the extensions were put in the dir /usr/lib/php/extensions-zend-nonts (or something).
I loaded my extensions from /usr/lib64/php/modules/, which at that point, contained modules compiled for PHP 5.4.11.. I moved the extensions to the proper directory, and then it worked like normal.

Again, sorry!

Isn't there an option to specify the ext folder at compile-time?
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Thu Oct 17 03:01:27 2019 UTC