Jump to content

Archived

This topic is now archived and is closed to further replies.

yapyapayap

Downloading PHP files instead of processing them .. why?

Recommended Posts

Hey,

I have a site in PHP and for some reasons instead of processing the files its making the browser Firefox and IE downlaod the php files as you would any file. This appears to be an intermittent problem some times its works most of the time it does not. Does anyone know why this occurs?

Many Thanks,
Richard  ???

Share this post


Link to post
Share on other sites
This happens because the extension that you used isn't recognized as an extension to be parsed by php.  It could be that php isn't installed on your server at all, or that you need to use a different extension.  Who is your host?  I would verify that php is installed and what extensions are parsed by php.

Share this post


Link to post
Share on other sites
you say download... do you mean like a zip file? if it's downloaded like a zip file, is the content the full PHP source, or is it the correct html that you would see if you were to visit the page with browser?

do you have a link we can test?

Share this post


Link to post
Share on other sites
Most likely the extension inst registered with Apache. Assuming you running your own server in windows with apache, add the following:

Find the file: http.conf

ScriptAlias /php/ "c:/php/"
AddType application/x-httpd-php .php .php3 .php5
Action application/x-httpd-php "/php/php-cgi.exe"

Share this post


Link to post
Share on other sites
http.conf = intermittent = no!

Can you provide a link so we can verify?

Share this post


Link to post
Share on other sites
Hi,

Thanks for your responses. The problem is Intermetent as sometimes it logs in normally with no problems. My host is wiredhub.net. The pages come down as  login_code.php but are Empty (there is no code in the file) so they are being processed but instead of outputing or linking to the next page they are offering to be downloaded.

I will be happy to provide you with a login to the site to see for yourself but don't want to post my email and password on here so if you can send me a message i will send it that way.

Richard

Share this post


Link to post
Share on other sites
generally PHP files are accessable from outside of your login. If your domain isn't registered yet, there should at least be a preview feature.

Share this post


Link to post
Share on other sites
One thing that i have a suspicion on is a cron job i am running that uses WGET http://flickr.ifresh.co.uk/automaticupdate.php.
I seem to get a lot of retries on this usually about 20. Is it possable that this is causing the PHP processing to go skewy.. and hence the intermetent problems ? Anyone have anything similar ?

--13:17:54--  http://flickr.ifresh.co.uk/automaticupdate.php
  (try:20) => `automaticupdate.php.6'
Connecting to flickr.ifresh.co.uk|209.59.164.74|:80... connected.
HTTP request sent, awaiting response... No data received.
Giving up.

Share this post


Link to post
Share on other sites
automaticupdate.php,

runs though a database of users and depending on their settings deletes all the users photos and pulls fresh ones down of off flickr.com site and stored them locally. This should not effect the site though.

Share this post


Link to post
Share on other sites
humm .. just a quick though is it possable because it takes sooo much time to pull down delete and rewrite all the images to the filesystem (when running the cron job on the autoupdate.php file) that WGET times-out and then retries up to 20 times and it is this that is causing it to mess up the php processing ?

Share this post


Link to post
Share on other sites
the server does seem to be a bit slow... but I was able to curl the pages in question and got an interesting location header "Location: ../user/index.php"

I'm not entirely sure how some browsers would use that header. Try removing the ".." from the beginning at the very least.

PS: I was able to login multiple times without a problem in safari, camino, and firefox.

Share this post


Link to post
Share on other sites
Hi michaellunsford,

Thanks for you help. I have done as you suggested and instead of using the relative link i put in the full thing though i doubt it was that. I have reset the CrOn job to its origional 15 min intervals. If you have the time please keep randomly logging in and out when you have a fre minute and im sure that the Weirdness will occur again soon.  :-\

If you have an instent messenger i can msg on that when it occurs.
Thanks again
Richard

Share this post


Link to post
Share on other sites

×

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.