Jump to content


Photo

Downloading PHP files instead of processing them .. why?


  • Please log in to reply
13 replies to this topic

#1 yapyapayap

yapyapayap
  • New Members
  • Pip
  • Newbie
  • 8 posts

Posted 03 October 2006 - 02:30 AM

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  ???

#2 Hi I Am Timbo

Hi I Am Timbo
  • Members
  • PipPipPip
  • Advanced Member
  • 109 posts

Posted 03 October 2006 - 03:33 AM

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.

#3 michaellunsford

michaellunsford
  • Members
  • PipPipPip
  • Advanced Member
  • 1,023 posts
  • LocationLouisiana, USA

Posted 03 October 2006 - 03:36 AM

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?

#4 JustinK101

JustinK101
  • Members
  • PipPipPip
  • Advanced Member
  • 503 posts
  • LocationSan Diego, California, US

Posted 03 October 2006 - 03:44 AM

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"

#5 michaellunsford

michaellunsford
  • Members
  • PipPipPip
  • Advanced Member
  • 1,023 posts
  • LocationLouisiana, USA

Posted 03 October 2006 - 03:48 AM

Would the httpd.conf file be responsible for an intermittent problem?

#6 Hi I Am Timbo

Hi I Am Timbo
  • Members
  • PipPipPip
  • Advanced Member
  • 109 posts

Posted 03 October 2006 - 03:49 AM

What do you mean by intermittent problem?

#7 JustinK101

JustinK101
  • Members
  • PipPipPip
  • Advanced Member
  • 503 posts
  • LocationSan Diego, California, US

Posted 03 October 2006 - 03:54 AM

http.conf = intermittent = no!

Can you provide a link so we can verify?

#8 yapyapayap

yapyapayap
  • New Members
  • Pip
  • Newbie
  • 8 posts

Posted 03 October 2006 - 03:43 PM

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

#9 michaellunsford

michaellunsford
  • Members
  • PipPipPip
  • Advanced Member
  • 1,023 posts
  • LocationLouisiana, USA

Posted 03 October 2006 - 04:26 PM

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.

#10 yapyapayap

yapyapayap
  • New Members
  • Pip
  • Newbie
  • 8 posts

Posted 03 October 2006 - 04:47 PM

One thing that i have a suspicion on is a cron job i am running that uses WGET http://flickr.ifresh...aticupdate.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...maticupdate.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.

#11 yapyapayap

yapyapayap
  • New Members
  • Pip
  • Newbie
  • 8 posts

Posted 03 October 2006 - 04:50 PM

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.

#12 yapyapayap

yapyapayap
  • New Members
  • Pip
  • Newbie
  • 8 posts

Posted 03 October 2006 - 04:53 PM

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 ?


#13 michaellunsford

michaellunsford
  • Members
  • PipPipPip
  • Advanced Member
  • 1,023 posts
  • LocationLouisiana, USA

Posted 03 October 2006 - 04:56 PM

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.

#14 yapyapayap

yapyapayap
  • New Members
  • Pip
  • Newbie
  • 8 posts

Posted 03 October 2006 - 05:20 PM

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




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users