Joesavage Posted February 16, 2008 Share Posted February 16, 2008 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. Quote Link to comment https://forums.phpfreaks.com/topic/91382-php-remote-server-include/ Share on other sites More sharing options...
wildteen88 Posted February 16, 2008 Share Posted February 16, 2008 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. Quote Link to comment https://forums.phpfreaks.com/topic/91382-php-remote-server-include/#findComment-468280 Share on other sites More sharing options...
Joesavage Posted February 16, 2008 Author Share Posted February 16, 2008 what protocol should I use if I want to include the actual script and not just the output? And is there anything else I could try to include the php? Maybe a 1by1 iframe or something...? Quote Link to comment https://forums.phpfreaks.com/topic/91382-php-remote-server-include/#findComment-468381 Share on other sites More sharing options...
maexus Posted February 16, 2008 Share Posted February 16, 2008 As far as I know, this isn't possible. You can only include local PHP files, other wise it's just the output from the php file. Quote Link to comment https://forums.phpfreaks.com/topic/91382-php-remote-server-include/#findComment-468390 Share on other sites More sharing options...
timmy0320 Posted February 16, 2008 Share Posted February 16, 2008 Why don't you just upload it on that server also? Quote Link to comment https://forums.phpfreaks.com/topic/91382-php-remote-server-include/#findComment-468394 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.