Jump to content

php remote server include


Joesavage

Recommended Posts

Hello... I have 2 websites. I am trying to include a php file from one website on the other site. They are on different hosts. The included file will manipulate a database on the first site, so it has to be a php file, it cannot be txt or html. I have tried using simple

 

include("http://Mainsite/BlogInclude.php");

 

When I try that statement I get these error messages when trying to load the page where the BlogInclude is included.

 

    * warning: include() [function.include]: URL file-access is disabled in the server configuration in /home/.izzat/foremski/SecondSite.com/themes/chameleon/chameleon.theme on line 3.

    * warning: include(http://FirstSite.com/BlogInclude.php) [function.include]: failed to open stream: no suitable wrapper could be found in /home/.izzat/foremski/SecondSite.com/themes/chameleon/chameleon.theme on line 3.

    * warning: include() [function.include]: Failed opening 'http://FirstSite.com/BlogInclude.php' for inclusion (include_path='.:/usr/local/php5/lib/php:/usr/local/lib/php') in /home/.izzat/foremski/SecondSite.com/themes/chameleon/chameleon.theme on line 3.

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/91382-php-remote-server-include/
Share on other sites

Your host has disabled url file access maybe as a result of safe_mode being enabled, Which will mean you wont be able to access remote files using include/require  or file_get_contents/fopen

 

Also note that if your include a file using the http:// protocol you are not actually including the PHP source code but the output of the script itself which will be text/html.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.