[BlueOnyx:26651] Re: URL_fopen setting not taking effect on 5210R?
Michael Stauber
mstauber at blueonyx.it
Mon Dec 11 11:35:42 -05 2023
Hi Chris,
> PHP Warning: file_get_contents(): https:// wrapper is disabled in the
> server configuration by allow_url_fopen=0 in
> /home/.sites/site6/wwwroot/web/contact.php on line 16, referer:
> https://www.site.tld/contact.php
>
> I have checked in both the VSITE and the server configuration and Allow
> URL fopen is switched on. We've used su_PHP and PHP-FPM and achieve
> the same result.
In general the "Allow URL fopen" and "Allow URL include" switches in the
GUI work well. Both on the Server and Vsite level. But depending on the
used PHP implementation it goes into various places in the actual
configuration.
suPHP (of course) has its own php.ini for each Vsite.
PHP-FPM uses the php.ini of the used PHP version, plus in the PHP-FPM
pool file for the respective Vsite (and PHP-version!) it has these defaults:
php_admin_flag[allow_url_fopen] = Off
php_admin_flag[allow_url_include] = Off
And DSO and DSO+mod_ruid2 use the php.ini of the used PHP version, plus
"php admin_flags" in the <Vsite> configuration of Apache.
When you save the changes in the GUI, it also takes 60-90 seconds now
until all required services are restarted after a configuration change,
so directly after saving in the GUI the services might still be running
with the prior configuration, because the services restarts haven't
happened yet.
To make it *really* easy to chase down:
Change the Vsite to use suPHP.
Find the php.ini in the Vsite directory /home/sites/<SITE>/wwwroot/php.ini
Confirm that the settings in it match whatever you have configured in
the GUI. In this example I specifically configured the (unsafe) "On" value:
[root at 5210r wwwroot]# cat php.ini |grep allow_url
allow_url_fopen = On
allow_url_include = On
Make sure Apache has had time to restart or restart it manually (if
you're in a hurry) and then check with a phpinfo() page in the /web
directory what PHP reports about the actual state of both flags.
--
With best regards
Michael Stauber
More information about the Blueonyx
mailing list