I've enabled 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.

In MultiPHP INI Editor > editor mode it's on "On"

commented: Still need to check the php.ini directly to see what's what. +12

If I view the php.ini file in cPanel's File Manager" it's also on "On"

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 phpinfo() function.

I rebooted the VPS, cleared the browser cache, but still on "Off" in phpinfo()

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.

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"

commented: Keep digging. +0

Read the source Luke (!)

From http://php.net/distributions/php-7.0.21.tar.gz

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.

commented: Yes, the production ini file is the one rhat I edit within WHM +0

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 :)

commented: Read it. Shared my suspicion there. +0

Aaaaahhhh.....

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.