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
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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.