denverdataman

Active Member
Jun 21, 2016
35
2
58
Denver
cPanel Access Level
Root Administrator
Hi,

I have a site running on PHP 7.0.30 with EasyAache 4. I am trying to change the PHP value of allow_url_fopen to ON and cannot. I have tried using php.ini, .user.ini, .htaccess, and with ini_set () in my setting file for Drupal. None of it works. I have tried the same code in another server and it works fine. Does anyone have a "trick" for getting allow_url_fopen to work on a cPanel server?

Thanks,
Steve
 
  • Like
Reactions: Gino Viroli

cPanelLauren

Product Owner II
Staff member
Nov 14, 2017
13,266
1,300
363
Houston
  • Like
Reactions: Erdem Karabay

denverdataman

Active Member
Jun 21, 2016
35
2
58
Denver
cPanel Access Level
Root Administrator
Hl Lauren,

I am sorry if I am missing something. I added that line to the .user.ini and ran the rebuild command but no change. Is there another place I should be putting the code?

Thanks,
Steve
 

cPanelLauren

Product Owner II
Staff member
Nov 14, 2017
13,266
1,300
363
Houston
Hi @denverdataman

I apologize if I didn't explain properly, changes made in the .user.ini for this are overridden by the php-fpm configuration if the setting exists, since this one does, you'd need to make the changes to the yaml file for php-fpm based on the instructions in the documentation I provided.

Thanks!
 

denverdataman

Active Member
Jun 21, 2016
35
2
58
Denver
cPanel Access Level
Root Administrator
Hi,

If anyone is reading this in the future I am not sure this is how it should be but I found my fix. If you look at the documentation for PHP-FPM (Configurations Values of PHP-FPM - Version 68 Documentation - cPanel Documentation) allow_url_fopen should be on by default. I turned it on using the instructions provided for cPanel. This made no change. It was OFF in the php.ini file at /opt/cpanel/ea-php70/root/etc. Turning it on in the php.ini did the trick.

This does nothing for explaining why trying to turn it on in any other place at the domain level did nothing.

-Steve
 

cPanelLauren

Product Owner II
Staff member
Nov 14, 2017
13,266
1,300
363
Houston
Hi @denverdataman

User level modifications will have no effect if it is disabled globally. So you can enable allow_url_fopen in
/opt/cpanel/ea-php70/root/etc then disable it for specific domains but not the other way around.

Thanks!
 

Erdem Karabay

Registered
Aug 6, 2018
1
0
1
Istanbul, Turkey
cPanel Access Level
Website Owner
Hi Steve,

The change isn't taking place because it needs to be changed in the fpm configuration. The php_admin_flag for allow_url_fopen needs to be changed:

Code:
php_admin_flag[allow_url_fopen] = on
Information on modifying the configuration can be found in the documentation here:
The php_fpm_config Script - Version 68 Documentation - cPanel Documentation
PHP-FPM User Pools - Version 68 Documentation - cPanel Documentation
Hi,

Thank you so much for solved my big problem. I just signed up to say that..

Grateful to you
 

SamL

Member
Jul 30, 2018
8
1
1
United Kingdom
cPanel Access Level
Root Administrator
Hi Lauren. I have the same problem as above but can't see where I should put
php_admin_flag[allow_url_fopen] = on
I do not know if I have fpm enabled.
I have WHM, tried PHP ini editors for php 5.6 and 7.0, I have set allow_url_fopen to enabled, and restarted. Nothing happened.
tried the same in cPanel nothing happened.
Then searched my server for php.ini the highest level was at root level, when edting I have file generatored by
cPanel MultiPHP INI Editor it doesn't have either allow url fopen on or off, its just not included even though I had set enabled in the MultiPHP Editor.
I added
php_admin_flag[allow_url_fopen] = on
allow_url_fopen = on
Nothing has changed.
Whats the point in having it in the Multi PHP INI Editor if it doesn't do anything? How do I enable?

Thanks
 
  • Like
Reactions: Gino Viroli

cPanelLauren

Product Owner II
Staff member
Nov 14, 2017
13,266
1,300
363
Houston
HI @SamL

You can see if you have php-fpm enabled in MultiPHP Manager through WHM it should be displayed to the right of the domain name list at WHM>>Software>>MultiPHP Manager. If you're changing the setting for PHP versions and nothing is changing I would lean toward you having FPM enabled.

Thanks!
 

eugenevdm.host

Well-Known Member
Oct 21, 2019
80
11
8
Cape Town
cPanel Access Level
DataCenter Provider
Hi Steve,

The change isn't taking place because it needs to be changed in the fpm configuration. The php_admin_flag for allow_url_fopen needs to be changed:

Code:
php_admin_flag[allow_url_fopen] = on
Information on modifying the configuration can be found in the documentation here:
The php_fpm_config Script - Version 68 Documentation - cPanel Documentation
PHP-FPM User Pools - Version 68 Documentation - cPanel Documentation
Hi @cPanelLauren,

Would you mind telling me how to do this for one domain, instead of referring to two sets of documentation?
 

sandeepgh2010

Registered
Aug 20, 2020
1
0
0
India
cPanel Access Level
Root Administrator
Hello,
Quite late but a simple solution is, if you have WHM access then search "MultiPHP INI Editor" then select your PHP version and enable "allow_url_fopen" Done.
Now go to your domain Cpanel and from "MultiPHP INI Editor" select your domain and enable "allow_url_fopen"

That's it.
Hope this help
Thanks :)