Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

dezgo's avatar

mailgun failing because allow_url_fopen off, but can't turn it on!

I'm having some trouble getting mailgun to work. It seems guzzle is failing, and it's because allow_url_fopen is not enabled. But the odd thing is that it is enabled in php.ini

I'm using PHP Version 5.6.17-3+deb.sury.org~trusty+1 (I just upgraded it from 5.5 hoping to fix the problem, but it didn't help).

The first line in phpinfo clearly says what php.ini I'm using - Loaded Configuration File /etc/php5/fpm/php.ini, here are the relevant lines

; Whether to allow the treatment of URLs (like http:// or ftp://) as files.
; http://php.net/allow-url-fopen
allow_url_fopen = On

I've restarted nginx just in case it needed a restart. But after all that, when I run phpinfo, I still see it's off

Directive           Local Value     Master Value
allow_url_fopen     Off             Off

What am I doing wrong?

0 likes
3 replies
dezgo's avatar

Thanks billy. I did a ps -ef | grep "fpm" just to see what was running,

root       943     1  0 Feb05 ?        00:00:04 php-fpm: master process (/etc/php5/fpm/php-fpm.conf)
www-cw     972   943  0 Feb05 ?        00:00:04 php-fpm: pool computerwhiz
www-cw     973   943  0 Feb05 ?        00:00:05 php-fpm: pool computerwhiz
www-data   974   943  0 Feb05 ?        00:00:00 php-fpm: pool www
www-data   975   943  0 Feb05 ?        00:00:00 php-fpm: pool www
derek    13838 13787  0 06:44 pts/0    00:00:00 grep --color=auto fpm

And it seemed to show it was OK. But I restarted the server anyway just to check. No luck, still have the same issue. It's really odd. It's fine on my local homestead dev box, but not on the prod box. I'm running it on a digitalocean vps

dezgo's avatar

This is the config file loaded info from phpinfo. Would any of those additional ini files override the setting?

Configuration File (php.ini) Path   /etc/php5/fpm
Loaded Configuration File   /etc/php5/fpm/php.ini
Scan this dir for additional .ini files /etc/php5/fpm/conf.d
Additional .ini files parsed    /etc/php5/fpm/conf.d/05-opcache.ini, /etc/php5/fpm/conf.d/10-pdo.ini, /etc/php5/fpm/conf.d/20-json.ini, /etc/php5/fpm/conf.d/20-mysql.ini, /etc/php5/fpm/conf.d/20-mysqli.ini, /etc/php5/fpm/conf.d/20-pdo_mysql.ini, /etc/php5/fpm/conf.d/20-readline.ini

No scratch that. Just looked through them and nothing seems relevant...

Please or to participate in this conversation.