Error 500 when iframe calls PHP script - Fixable?

 
Post new topic   Reply to topic    Aprelium Forum Index -> PHP
View previous topic :: View next topic  
Author Message
Lawrence
-


Joined: 16 Jan 2003
Posts: 207
Location: Brisbane, AU

PostPosted: Wed May 10, 2006 12:33 pm    Post subject: Error 500 when iframe calls PHP script - Fixable? Reply with quote

I have a blog that doesn't allow PHP in some pages.

In these pages, I want to include the latest image from my gallery. I can work around the PHP limitation by using the blog's INCLUDE function to call another HTML file.

This HTML file contains a single line of text, that creates an IFRAME and uses a PHP file as the source for the iframe.

The code for both is below:

IFRAME.HTM

<iframe name="random" src="/directories/iframe.php" width="170" height="170" scrolling="no" frameborder="0"> </iframe>

IFRAME.PHP

<?php readfile('http://domain.com/url/main.php?g2_view=imageblock.External&g2_blocks=recentImage&g2_show=title'); ?>


All I get is an Error 500. If I open the iframe directly I get an error 500, but if I open the PHP file I get the right result: the latest image from my gallery.

For some reason Abyss chokes when asked to call a PHP file from an iframe. Or am I doing something wrong? Ideas are appreciated.
Back to top View user's profile Send private message Visit poster's website ICQ Number
aprelium
-


Joined: 22 Mar 2002
Posts: 6800

PostPosted: Thu May 11, 2006 9:58 am    Post subject: Re: Error 500 when iframe calls PHP script - Fixable? Reply with quote

Lawrence,

For Abyss Web Server it makes no difference if the file is called from an IFRAME or not. So we suggest to check the exact cause reported for error 500 (see the cgi.log file).
_________________
Support Team
Aprelium - http://www.aprelium.com
Back to top View user's profile Send private message Send e-mail
Lawrence
-


Joined: 16 Jan 2003
Posts: 207
Location: Brisbane, AU

PostPosted: Thu May 11, 2006 10:40 am    Post subject: Reply with quote

That's the kind of authoritative answer I crave, thanks. Here's a paste from the cgi log (which I didn't even know existed, heh):

CGI: [c:\appz\php\php.exe ] URI: /directories/iframe.php Broken pipe

For clarification, here are the more-accurate directories in question:

Both the iframe.php and iframe.htm files are in root/dir1/ and the gallery script is in root/gallery/.

iframe.htm finds the PHP script no problem, but the PHP script is apparently confused.

No amount of tweaking the readfile parameters will cure the problem - I've tried full URLS (http://etc/gallery/) and relative URLS (/gallery/) and filesystem addresses (e:\web\gallery\) to no avail.
Back to top View user's profile Send private message Visit poster's website ICQ Number
aprelium
-


Joined: 22 Mar 2002
Posts: 6800

PostPosted: Fri May 12, 2006 9:44 am    Post subject: Reply with quote

Lawrence,

Could you please turn on the following error displaying parameters in php.ini:

Code:
display_errors = On
display_startup_errors = On


Restart now the server (if you are using PHP/FastCGI) and retry browsing the IFRAME. Is there a more explicit error message? If so, could you please post it here?

Otherwise, is it possible to post your script source code?
_________________
Support Team
Aprelium - http://www.aprelium.com
Back to top View user's profile Send private message Send e-mail
Lawrence
-


Joined: 16 Jan 2003
Posts: 207
Location: Brisbane, AU

PostPosted: Fri May 12, 2006 2:23 pm    Post subject: Reply with quote

Both of those settings were already enabled on my system. I don't use FastCGI. No errors are generated by PHP, unless I change the script so that it cannot locate the file.

I don't know which script source code you mean. If you're referring to the iframe.php, the entire script is listed above (and again below for convenience). If you mean the gallery script, I'm using gallery2.

<?php readfile('http://domain.com/url/main.php?g2_view=imageblock.External&g2_blocks=recentImage&g2_show=title'); ?>

The only thing showing up in cgi.log is the 'broken pipe' error.

I should clarify the first post: Neither iframe.php or iframe.htm will produce the desired results.
Back to top View user's profile Send private message Visit poster's website ICQ Number
aprelium
-


Joined: 22 Mar 2002
Posts: 6800

PostPosted: Sat May 13, 2006 10:42 am    Post subject: Reply with quote

Lawrence,

Could you please send to support@aprelium.com your abyss.conf and php.ini files? Please do not forget to add a reference to this post and to give us the full URL of the PHP script which fails.

By the way, when you browse the IFRAME, how much time is needed to have Error 500 displayed? Is it instantaneous or not?
_________________
Support Team
Aprelium - http://www.aprelium.com
Back to top View user's profile Send private message Send e-mail
Lawrence
-


Joined: 16 Jan 2003
Posts: 207
Location: Brisbane, AU

PostPosted: Sat May 13, 2006 12:16 pm    Post subject: Reply with quote

I've sent the files you've requested.

The iframe.php file fails in what appears to be exactly four seconds.
Back to top View user's profile Send private message Visit poster's website ICQ Number
Lawrence
-


Joined: 16 Jan 2003
Posts: 207
Location: Brisbane, AU

PostPosted: Thu May 25, 2006 3:32 pm    Post subject: Reply with quote

Thanks to the guys at Aprelium, the problem's been solved. Or rather, a new solution was found:

Code:
<?php
header('Location: ../gallery/main.php?g2_view=imageblock.External&g2_blocks=recentImage&g2_show=title'); 
?>


In addition, both the PHP and HTM files had to be located in the same directory as the gallery, or I'd generate 404 errors. Finally, I had to add ../ at the beginning of the Location, or iframe.php became part of the URL: /iframe.php/gallery/etc.

Big thanks to Aprelium for helping sort this out. Finally, gallery pictures in my blog. =)
Back to top View user's profile Send private message Visit poster's website ICQ Number
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> PHP All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group