Can't change the value of allow_url_include in PHP

I am using PHP 5.5.9

with Apache 2.4.7

on my PC Ubuntu 14.04

. I am trying to include a PHP script located on another web server for some testing purposes only. But I can't seem to turn it on allow_url_include

. I've tried this:

<?php
    echo(ini_get("allow_url_include") . "<br />");

    ini_set("allow_url_include", "On");

    echo(ini_get("allow_url_include"));
?>

      

And it gives me this output:

0
0

      

I even tried this by editing the actual file /etc/php5/apache2/php.ini

and installing allow_url_include = Off

, but still, it's the same.

How should I do it?

+3


source to share


2 answers


YES! It worked: D That's right, this warning line caused it! I changed it to error_reporting = E_ALL in the original php.ini file and now I can change allow_url_fopen to 1. Post it as an answer and I mark it as accepted. Thanks to all. - lonekingc4


I saw your pastebin file with the codes you used:

error_reporting(E_ALL)
;   Default Value: E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED
;   Development Value: E_ALL
;   Production Value: E_ALL & ~E_DEPRECATED & ~E_STRICT

      

Using:

error_reporting = E_ALL

and not error_reporting(E_ALL)

- thus warning



Warning: syntax error, unexpected '('...

error_reporting(E_ALL)

used when you put it in a .php file.

Ie:

<?php 
error_reporting(E_ALL); 
ini_set('display_errors', 1);

// rest of code

      

  • Do that, restart Apache and you should be good to go.

Sidenote: Bug reporting should only be done at staging stage and never produced.

+2


source


Try the following:



ini_set('display_errors', true);
ini_set('safe_mode', false);
ini_set('allow_url_fopen', true);
ini_set('allow_url_include', true);
print_r(ini_get_all());


ini_set('allow_url_include', 'on');

      

0


source







All Articles