bazaar icon indicating copy to clipboard operation
bazaar copied to clipboard

Url_fopen

Open miyorineko opened this issue 8 years ago • 6 comments

As you know, the allow_url_fopen is usually off due to security risks. Is it better using curl to fetch the file instead of url_fopen?

miyorineko avatar Jul 18 '17 07:07 miyorineko

Thank you good point, I take it you're referencing this line I see no other mention of file_get_contents.

luceos avatar Jul 18 '17 08:07 luceos

@luceos Indeed, I found no "file_get_contents" or "fopen" function associate with the file "packages.json" in the code. But I just can't install any extension in the bazaar, and got some odd errors like this in the log:

[2017-07-18 08:31:17] production.ERROR: The "https://packagist.org/packages.json" file could not be downloaded: allow_url_fopen must be enabled in php.ini (https:// wrapper is disabled in the server configuration by allow_url_fopen=0 failed to open stream: no suitable wrapper could be found)

miyorineko avatar Jul 18 '17 08:07 miyorineko

Behind the scenes Bazaar uses the Composer package which uses file_get_contents for pretty much everything.

I am not sure we can do anything about this without completely dropping the composer dependency. This is a lot of work though. I am going to keep this on our backlog as a reminder though.

luceos avatar Jul 18 '17 09:07 luceos

As of recent, CPanel has removed the allow_url_fopen option from Multi php.ini Editor and the server overrides to allow_url_fopen=0.

RIP on shared hosting.

Link: https://forums.cpanel.net/threads/php-ini-directives-not-working-properly.614379/#post-2494067

Legoman99573 avatar Jan 10 '18 10:01 Legoman99573

@Legoman99573 unless the shared host allows it for all sites. I can't imagine why you'd block it globally anyway..

luceos avatar Jan 10 '18 12:01 luceos

@luceos it is done by default on a clean install. It can be enabled /via WHM, but most shared hosts/resellers kept it blocked for the same reason this issue was opened for.

Legoman99573 avatar Jan 10 '18 12:01 Legoman99573