1 (edited by Mats Wall 2006-04-27 13:42)

Topic: [solved] Syndication with extern.php fails

Hi there,

I've set up a simple test page to run the extern.php syndication script (for later inclusion with my CMS powered site) but the page comes up with nothing. The file extern.php is there, but the parameters kill it. Please help me see where do I go wrong.

Here's the call:

<?php
include("http://modx.credoakademin.nu/forum/extern.php?action=new&show=3");
?>

And here's the test page.

Any help would be greatly appreciated.

Mats

Re: [solved] Syndication with extern.php fails

That's an HTML file, not a PHP file
You need to save it as .php or tell your server to parse HTML as PHP
But in general, you can only call with parameters in $_GET via URL (as you're doing) if you have allow_url_fopen. If you don't, you can't include the extern.php vars that way (the server would look for a file called extern.php?action=new&show=3)

Re: [solved] Syndication with extern.php fails

Okay, I saved it as a php file (saved it as editor default first time, sorry). But it still doesn't parse the code. I checked the phpinfo(), and allow_url_open is on. The only difference now is I recieve a timeout instead of a blank page.

Actually I tried the call from within my CMS. I put it in the snippet repository which only allows php code and tried to run it, but I got the same timeout there too.

So what should the call look like exactly to work? That's my basic question, because obviously you can't just copy what's in the documentation.

Mats

Re: [solved] Syndication with extern.php fails

Nope, the documentation is right (assuming you have allow_url_fopen)
Give me the page where you're including it now and getting an error?

Re: [solved] Syndication with extern.php fails

Thanks, I'll give you the page next you're online (just send me a message!) since I have to disable the include to get ANY work done on the site because of the timeout(s).

Mats

Re: [solved] Syndication with extern.php fails

Hi again,

I'm proud to report the problem is now solved (partly because of Smartys, who identified the problem as lying with my server host).

The problem was pinpointed to the server firewall. The IP number of the website is one on the outside of the firewall and another on the inside. So when php tried to do an 'include' of the website's URL, the address pointed outside the firewall wheras the file was actually *inside* of the firewall. So extern.php simply couldn't find ./config.sys.

The solution was to tell the server the actual location of the website by editing the 'hosts' file.

(Thanks, Smarty! And to Ruben at Crossnet websupport who pinpointed the problem!)

Cheers!

Mats W.