Adding stream protocols/wrappers to PHP

I have apache2/php5 installed on debian. When I look at the output of phpinfo(), I notice that I only have one registered PHP stream: zip. Streams are used with fopen() to open things like http, https ftps etc etc.

I really need to add the http stream/protocol to my server, but I cannot figure out how in the world to do so! Does anyone know how to do this? Google is no help, and the PHP site just describes the different streams, it seems to make no reference to how they are installed or turned on.

Thank you for any help!

1 Reply

Did you install all the PHP5 packages that you need, or did you just install the bare minimum?

To install all the popular packages in one go:

apt-get install php5-common php5-cgi php5-curl php5-dev php5-gd php5-idn php-pear php5-imap php5-mcrypt php5-memcache php5-mhash php5-ming php5-mysql php5-pgsql php5-pspell php5-recode php5-snmp php5-sqlite php5-tidy php5-xmlrpc php5-xsl

And restart apache2 to see if things look better.

If it still doesn't work, check your php.ini (probably located in /etc/php5/apache2)

If you see the line that says:

allow_url_fopen = 'off'

Change it to:

allow_url_fopen = 'on'

And restart apache2 to see if things look better.

But DON'T enable allowurlfopen unless you know what you're doing. Depending on the scripts you use, enabling it could make your site vulnerable to really easy attacks.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct