Php warning require_once url file access

Hi all

This is the below error which is getting logged in the error log file


PHP Warning:  require_once() [<a href='function.require-once'>function.require-once</a>]: URL file-access is disabled in the server configuration in  on line 10
PHP Warning:  require_once(http://www.domain.com/paypal.inc.php) [<a href='function.require-once'>function.require-once</a>]: failed to open stream: no suitable wrapper could be found in ipn.php on line 10
PHP Fatal error:  require_once() [<a href='function.require'>function.require</a>]: Failed opening required 'http://domain.com/paypal.inc.php' (include_path='.:/php') on line 10

Below code is on line 10 in ipn.php


require_once 'http://www.domain.com/paypal.inc.php';

allow_url_fopen is ON (as seen in the phpinfo file) on server

What can be the problem ?

Vineet

I think that’s a different option, “allow_url_include”.

That being said, this seems dangerous. At the very minimum, you should be using https. Otherwise, someone in the middle could inject their own code.

Hi

If setting “allow_url_include” is dangerous.

Then is it possible to disable ipn.php script

Will the paypal transaction script work without ipn.php ?

I have these types values in paypal.inc.php


$paypal = array();
$paypal['business']      = "email@yahoo.com";
$paypal['site_url']      = "http://domain.com/";
$paypal['image_url']     = "";
$paypal['success_url']   = "ok.php";
$paypal['cancel_url']    = "error.php";
$paypal['notify_url']    = "ipn.php";

Can i remove $paypal[‘notify_url’] code line from this script and make rest of the script work.

Thanks
Vineet

If the file is on your own server, you shouldnt be trying to include/require it using an http:// reference. Including PHP files from external sites means that you include the -output- of the file only, not the source code.