PHP function suddenly stops working...?
I have a question for the PHP gurus here:
I have two websites, both hosted by eDataRack, on two different servers.
I have been tracking traffic on both sites with BBClone, a PHP based web counter.
On both sites, I followed the BBClone set-up directions for Apache servers, which includes directions for having the server append the PHP tracking code to every .htm and .html file, and also causes the server to parse all .htm and .html files for PHP code.
I set these two sites up, one in June/July and one in August, and everything worked perfectly, exactly as the BBClone instructions said it would. I was a perfectly happy camper.
Then, on or about November 28th, the second website became unavailable. Any attempt to load it, regardless of computer or browser, resulted in a message that went (I'll give you the NS7 version) roughly... the file "" is of type application-html-php and NS doesn't know what to do with it... and offered me the option to d/l, save to disk, etc. At the same time, BBClone quit counting any page hits.
I'll save the long, ugly and vituperative exchange that followed over the next two days with what eDataRack calls customer service reps. They pointed the finger at the modifications to my .htaccess file, mumbled something about the data "appears to be messed up" and then begged off 'cause BBClone is just something they throw in for me to use and they don't support it.
That, at least, gave my rookie self something to chase down, and I started checking on the PHP code. Using BBClone's basic installation procedure, which means adding the PHP code manually into the index.html file and renaming it index.php got BBClone back up and running, counting the main page. If I want to follow this method, though, it means modifying EVERY page and renaming EVERY page to a .php file. It was so much easier when the Apache server handled all this.
So I tried putting the code into the .htaccess file again, one step at a time. The website choked on the first step, the command to tell the server to parse the .htm and .html files for PHP code. Taken from my previously working set-up, that line is: AddType application/x-httpd-php .htm .html
As soon as I re-introduced that line into the .htaccess file, the page loading error happened again.
The original set-up, using commands in the .htaccess file to append the PHP code to each page on the site is still running, with no problems or hiccups whatsoever, on my other site!
The last change that I can recall making to the problem site was two weeks before it choked, and all I did was correct a grammatical error that a friend had pointed out.
The tech support cretins at eDataRack ignored the facts of the situation, despite being beat over the head with them (and mostly in all CAPS) and simply repeated the blind mantra that they don't support BBClone, and that PHP was working fine on all 500 quadzillion sites that share my same server.
So, my desperate plea to you is this - someone please point me toward an explanation of how the AddType command can suddenly stop working, and what I can do (if anything) to get this site back to working like it was, and as my other site continues to do????
(My apologies for the in-depth and probably over-long post, but I wanted to answer as many questions as I could with the statement of the problem.)
My heart-felt thanks, in advance, for ANY help,
Paul Gibbons
congostowing.com
Busy posted this at 07:18 — 12th December 2005.
He has: 6,151 posts
Joined: May 2001
Have you asked your host if they have upgraded/updated anything around this time?
RangerLord posted this at 14:10 — 12th December 2005.
They have: 33 posts
Joined: Aug 2005
Yeah, I asked. In fact, I told them the same things that are in my first post - that the site suddenly stopped loading on the 28th, and that I hadn't done anything to cause it.
All they seem to be able to do is blame BBClone (which isn't at fault) or the .htaccess file set-up (which worked perfectly before, and still works right on my other site on one of their other servers).
After two days of opening trouble tickets, it has become clear to me that I've already gotten as much help from Larry, Moe & Curly at eDataRack as I'm going to get, and that is NONE.
chrishirst posted this at 08:07 — 12th December 2005.
He has: 379 posts
Joined: Apr 2005
are .php files being handled correctly ?
RangerLord posted this at 14:13 — 12th December 2005.
They have: 33 posts
Joined: Aug 2005
Yeah, and that's what's got me puzzled. If I switch to the "add activation code to each individual file" method, and rename the pages to .php files, they are handled correctly.
timjpriebe posted this at 15:28 — 12th December 2005.
He has: 2,667 posts
Joined: Dec 2004
It's possible that their Apache configuration changed a bit due to some upgrade or something. It sounds like a case of their tech support not really knowing every little thing that is going on with the server.
Personally, in dealing with them, I wouldn't even mention that it suddenly stopped working, I would just tell them how you want it to work. Then they stop trying to play the blame game and move more towards a solution. That's the theory, anyway...
Tim
http://www.tandswebdesign.com
RangerLord posted this at 06:15 — 14th December 2005.
They have: 33 posts
Joined: Aug 2005
Update -- I found the following on Digital Point:
"I traced it to the .htaccess file. When I was bringing up my site, the ads wouldn't show and the .php wouldn't execute. And sometimes my Browser would try to download the webpage instead of just view it. So I went back and forth on tech support with my ISP LunarPages.
Seems they run something called suPHP and the contents of .htacess must be:
AddType x-httpd-php .php .htm .htm
(notice it doesn't have the 'application/' in it.)
I guess suPHP doesn't like the 'application/' ."
Just to see, I modified my .htaccess like this, removing the 'application/', and suddenly the message about not knowing how to handle file "" is gone and the site loads correctly.
However, although I added the code to append BBClone's activation code back into the .htaccess file, this function is still not working as it once did.
Can anyone shed any light on this?
RangerLord posted this at 23:59 — 19th December 2005.
They have: 33 posts
Joined: Aug 2005
OK, I found a fix - all by my lonesome.
I still don't know WHY this fixed it, or WHY it isn't needed on the other site. All I know is I found references on a couple of sites to using this code to get Apache to parse .html for .php code:
RemoveHandler .html .htm
AddType application/x-httpd-php .htm .html
So I added the RemoveHandler line and now everything is back to normal. Which is great, of course, but my other site is still running on the old set-up with no problems.
Go figure.
Oh, and when I told the support techs that I got my problem fixed, they said:
I have no idea as we are techs and do not know design or programming skills. The only thing that could explain it is that you are using too different versions of Plesk.
The only thing right about that comment is that they have no idea, as I have been using two different versions of Plesk (which eDataRack provided) since I started each of these sites.
At least it's fixed. Hope someone else can benefit from my pain.
R/L
CptAwesome posted this at 00:39 — 20th December 2005.
He has: 370 posts
Joined: Dec 2004
I probably would have tried adding a header() function to the PHP to update the type.
JeevesBond posted this at 12:29 — 20th December 2005.
He has: 3,956 posts
Joined: Jun 2002
Wow, what a nightmare! I started reading this post earlier, but am supposed to be working
Thanks for posting the solution Ranger, indeed someone else might be helped by your problem.
Thanks for being in-depth about it too, hopefully posting at least relieved some anger, even if we didn't fix the problem!
a Padded Cell our articles site!
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.