Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

343
Views
allow_url_fopen is on but phpinfo says off

Since either when I updated the server to PHP7 or when I enabled AutoSSL for my server I has not been able upload files. My error is as follows

fopen(): https:// wrapper is disabled in the server configuration by allow_url_fopen=0

I have no idea where allow_url_fopen=0 is coming from because in both the global php.ini and the php.ini inside of the sub domain are using stating

allow_url_fopen=On
allow_url_include = On

In phpinfo() I see where my php.ini file is...

Configuration File (php.ini) Path   /opt/cpanel/ea-php70/root/etc
Loaded Configuration File   /opt/cpanel/ea-php70/root/etc/php.ini

When I open this php.ini file I see that allow_file_fopen is "On"

; 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 fil$
; http://php.net/allow-url-include
allow_url_include = On

But in the same phpinfo() file I see allow_file_fopen is off

Directive   Local Value Master Value
allow_url_fopen Off Off
allow_url_include   Off Off

From another stack exchange thread I was told to try the following code which turns out it is OFF

if (ini_get("allow_url_fopen") == 'On') {
echo "allow_url_fopen is ON";
} else {
echo "allow_url_fopen is OFF";
}   

Previously I did get this working by using the following code in my controller, but this no longer works for a reason I do not know

ini_set('allow_url_fopen',1);

I am using Laravel 5.2 and Image intervention package to deal with the images that get uploaded. As i said this was all working before PHP7 and AutoSSL

What am I missing?

over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

I was able to find where allow_url_fopen was switched off inside of WHM by editing the "MultiPHP INI Editor" section. From there I selected PHP7. The first option it gave me to to enable allow_url_fopen. This fixed my error.

I couldn't find where allow_url_fopen was disabled at all through SSH. I guess it is because I didn't understand the upgrade procedure from PHP5 to PHP7 and that I had PHP7 enabled only per account through cPanel though Root apeared to be still using PHP5 for php.ini.

over 4 years ago · Santiago Trujillo Report

0

I had the same problem. The configuration of pool was disabled the option:

A) First I tried to found which file is modifying the setting:

    # cd /etc/php
    # grep -r allow_url_fopen

7.3/fpm/pool.d/worpresspool1.conf:php_admin_flag[allow_url_fopen] = off
7.3/fpm/php.ini:allow_url_fopen = On
7.3/cli/php.ini:allow_url_fopen = On

B) Then I edited the file

    # vi /etc/php/7.3/fpm/pool.d/worpresspool1.conf 

and commenting the above line with ;:

    ;php_admin_flag[allow_url_fopen] = off

C) In my case I've restarted php-fpm service because I'm using Fast-cgi

    # systemctl restart php7.3-fpm
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!