allow_url_fopen Does Not Change
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
-
Hello, Are you running PHP-FPM or CloudLinux's Alt-PHP on the server? 0 -
Yes, I am running php_fpm. Thanks, Steve 0 -
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: 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 Documentation0 -
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 0 -
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! 0 -
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 0 -
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! 0 -
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:
php_admin_flag[allow_url_fopen] = on
Information on modifying the configuration can be found in the documentation here: 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 you0 -
Hi @Erdem Karabay I'm really glad to hear that it helped and thanks for letting us know! 0 -
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 0 -
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! 0 -
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:
php_admin_flag[allow_url_fopen] = on
Information on modifying the configuration can be found in the documentation here: 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?0 -
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 :) 0
Please sign in to leave a comment.
Comments
13 comments