Alanaktion / phproject

A high performance full-featured project management system
https://www.phproject.org
GNU General Public License v3.0
384 stars 106 forks source link

Error: wrapper is disabled in the server configuration by allow_url_fopen=0 #387

Closed Backpackstudio closed 3 years ago

Backpackstudio commented 4 years ago

I get strange error:

file_get_contents(): https:// wrapper is disabled in the server configuration by allow_url_fopen=0
[app/controller/admin.php:108] file_get_contents()
[index.php:147] Base->run()

Why system is trying to load external files?

        $context = stream_context_create($options);
        try {
            $result = file_get_contents($endpoint, false, $context);
        } catch (\Exception $e) {
            $this->_printJson(['error' => 1]);
            return;
        }
Alanaktion commented 4 years ago

You didn't give much of a context for this error, but it is most likely the update checker, that also includes some basic anonymous statistics. It likely makes sense to add a configuration option to disable this, but right now it is hard-coded to make this request from the admin panel, though it shouldn't affect any normal functionality when it breaks like this.

Alanaktion commented 4 years ago

The included statistics are very basic and not uniquely identifiable, they're just helpful for me to know the general size of the companies using it, and whether people actually install updates.

It reports these values:

If the connection for this fails, as it does with allow_url_fopen=0, the application still fully functions, it just doesn't notify you in the admin panel when an update is available.

Alanaktion commented 4 years ago

You can disable the statistics reporting by setting the site.disable_stats configuration option to 1 in your config table, though the update check will still be attempted, so you will still see the error.