Page 1 of 1

Problem With External PHP Application

Posted: Tue Aug 05, 2008 3:06 pm
by Maccsta
Hi!

I'm trying to call this url into the external php application:

http://www.mydomain01.com/lo/site_templ ... e_34_8.php

However I get this error on the front of the page:

Warning: serendipity_plugin_externalphp::include() [function.include]: Failed opening '' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php:/home/maccsta/public_html/mysite01/bundled-libs/:/home/maccsta/public_html/teenfucksuck/bundled-libs/Smarty/libs/:/home/maccsta/public_html/mysite01/:') in /home/maccsta/public_html/mysite01/plugins/serendipity_plugin_externalphp/serendipity_plugin_externalphp.php on line 76


What do I need to sort this? I'm calling a list of links stored on one server to a different server.

Hope you can help.........

Thanks in advance :)

Posted: Tue Aug 05, 2008 4:33 pm
by judebert
In version 1.3 of the plugin, that line is a case statement, so we're obviously looking at different versions. You might want to consider upgrading.

The error message makes it sound like the field marked "file to include" on the plugin configuration page is empty. It's trying to include '', the empty string.

However, in examining the code, I see that we use the realpath() method on your input. I think that'll fail if you're trying to access anything that isn't in the local filesystem.

I recommend writing a quick wrapper. This will work if URL_fopen_wrappers is set in your PHP configuration:

Code: Select all

# foreign.php: PHP wrapper file to read data from a foreign server
@include 'http://foreign-server/path/to/script.php
Then point your plugin at the wrapper. All should work.

Posted: Tue Aug 05, 2008 7:21 pm
by Maccsta
Thanks for the reply judebert

So You are saying I just need to add that include code to the serendipity_plugin_externalphp.php file?

Posted: Tue Aug 05, 2008 7:37 pm
by Maccsta
Actually I have figured it out thanks. Created a .php file and uploaded to the root directory of the domain containing this code:


<?php
include 'http://www.mydomain.com/lo/site_templates/site_33_7.php
?>

Pointed the external php plugin at that file like you said.

Thanks :)

Posted: Tue Aug 05, 2008 10:07 pm
by judebert
Yes, that's exactly what I was looking for. Sorry I forgot the <?php ?> tags.