7

Can we set "allow_url_fopen" "ON" by using ini_set() function in php

Salketer
  • 14,263
  • 2
  • 30
  • 58
jsduniya
  • 2,464
  • 7
  • 30
  • 45
  • 1
    Have you checked with that settings documentation that it is possible at all to use `ini_set()` function to set it? http://php.net/filesystem.configuration#ini.allow-url-fopen – hakre Jul 10 '13 at 14:37
  • This is usually disabled by hosts as a security precaution. It wouldn't be a very useful precaution if you could override it yourself. – ceejayoz Jul 10 '13 at 14:39

4 Answers4

15

you can't, "allow_url_fopen" has the changable mode PHP_INI_SYSTEM

Entry can be set in php.ini or httpd.conf

and not by ini_set()

http://www.php.net/manual/en/configuration.changes.modes.php

Alex Stallen
  • 2,223
  • 15
  • 17
3

You can't

allow_url_fopen can only be modified from an ini file or httpd.conf.

Community
  • 1
  • 1
AD7six
  • 63,116
  • 12
  • 91
  • 123
3

The allow_url_fopen directive belongs to PHP_INI_SYSTEM and cannot be set via ini_set()

Salketer
  • 14,263
  • 2
  • 30
  • 58
1

You can only set it in php.ini, not with ini_set.

Pieter
  • 1,823
  • 1
  • 12
  • 16