allow_url_fopen via MultiPHP INI Editor in cPanel, but if I check with
phpinfo()it's still on 'Off'. Why's that? I've cleared my cache.
I'll guess PHP or such needs to restart. Look directly into the Sun? (nope, look at the php.ini file to see if the control/ini editor is changing it or not.
In MultiPHP INI Editor > editor mode it's on "On"
If I view the php.ini file in cPanel's File Manager" it's also on "On"
The hosting can matter here. I wanted to be sure the php.ini was good before I noted where the host can control/override this with a custom compile. https://www.a2hosting.com/kb/developer-corner/php/using-php.ini-directives/php-allow-url-fopen-directive and links there tell us this can be host dependant.
That is, "Ray, what did you do?"
The hosting can matter here.
It's a VPS, so as of now I'm the only one in control of this server :)
As you read they compile php with it on/off and don't seem to use a php version that allows changing it in php.ini. Yours?
I'm allowed to change it. It's my server :) No, I see what you mean. A2 hosting allows their users to change PHP settings via php.ini on VPS and dedicated servers after 2014. Before that it could only be done via .htaccess.
Anyway... I guess I have to check with my provider why I can't see the changes with the
I rebooted the VPS, cleared the browser cache, but still on "Off" in phpinfo()
OK, all this but I never broached the "what is it?" question.
What PHP is this?
It's PHP 7.0.21 on Apache
I also checked if there was a .htaccess file that might have PHP directives in it which would override those in the php.ini file, but this is also not the case.
http://php.net/manual/en/filesystem.configuration.php (documentation) says it's enabled since 4.x.
https://stackoverflow.com/questions/43543297/allow-url-fopen-is-on-but-phpinfo-says-off notes same issue but an odd fix at the end. I can't test that.
Okay, I see something strange. According to
phpinfo()the php.ini file is located in a directory
etc which is in the
root (home directory).
Configuration File (php.ini) Path /opt/cpanel/ea-php70/root/etc
Loaded Configuration File /opt/cpanel/ea-php70/root/etc/php.ini
But the php.ini file that I edit is directly in the root (home directory) and the second I edit is in the web root (public_html). It might be better to stick only to the one in the root and delet the one in the web root, but that's for another thread :)
Anyway... if I look in the
etc directory, there's no php.ini file at all. Weird!
EDIT: I made a copy from the php.ini file and putted tit in the etc directory, to see what happend and no nothing
allow_url_fopen still on "Off"
Read the source Luke (!)
Fopen wrappers ; ;;;;;;;;;;;;;;;;;; ; Whether to allow the treatment of URLs (like http:// or ftp://) as files. ; http://php.net/allow-url-fopen allow_url_fopen = On ; Whether to allow include/require to open URLs (like http:// or ftp://) as files. ; http://php.net/allow-url-include allow_url_include = Off
This means with the bona-fide PHP from the source you would have to do nothing to turn it on as it is already on.
Check your source for your PHP? Read the php.ini-production file.
When the VPS was delivered to me with CentOS 7 and WHM/cPanel installed on it. The PHP veson was 5.6. I've upgraded it to version 7.0 via cPanel but
allow_url_fopen was disabled by default.
The CMS that I wil install on the server requires also to enable it so that's why I did it with php.ini
@ rproffitt - I've sent you a PM with some secret information :)
There's also a MultiPHP INI Editor in WHM (Web Hosting Manager) and there I enabled
allow_url_fopen for PHP 7.0 and voila.