The Cache: Technology Expert's Forum
 
*
Welcome, Guest. Please login or register. October 16, 2019, 04:49:50 AM

Login with username, password and session length


Pages: [1]
  Print  
Author Topic: Suggestions on how to debug a 406 error?  (Read 2877 times)
DangerMouse
Expert
****
Offline Offline

Posts: 244



View Profile
« on: September 18, 2007, 08:45:46 AM »

Argh  D'oh!

Just uploaded a site to a server running PHP 5 and Apache 1.3.37 and appear to recieve a 406 error (until now I'd never heard of it!) that I don't get when running the script locally. The only difference that is obvious to me is that my local version of Apache (WAMP setup) is 2.2.4, I've no idea if this could be causing it?

As a bit of background, the script is very simple and makes use of the Zend Framework REST server http://framework.zend.com/manual/en/zend.rest.server.html to create an API for a web app I'm building. The REST api has two functions associated with it, one works and one doesnt, which suggests to me that the Zend framework isnt producing any content that should throw up this 406 error, equally both methods(functions) work locally.

Any suggestions on how to debug this problem would be much appreciated? The error seems to provide very little feedback  .

Cheers,

DM
Logged
perkiset
Olde World Hacker
Administrator
Lifer
*****
Offline Offline

Posts: 10096



View Profile
« Reply #1 on: September 18, 2007, 09:50:59 AM »

A 406 is an "ACCEPT" problem

(see here: http://www.checkupdown.com/status/E406.html)

Although I'm having a hard time wrapping my brain around it, it would seem that your local server doesn't serve up something that is OK with your browser and so you don't see the error... or the code is trying to shoot something back that the server is malforming on the way back... something rather weird.

That is one of the more obscure errors...
Logged

It is now believed, that after having lived in one compound with 3 wives and never leaving the house for 5 years, Bin Laden called the U.S. Navy Seals himself.
DangerMouse
Expert
****
Offline Offline

Posts: 244



View Profile
« Reply #2 on: September 18, 2007, 10:18:36 AM »

Thanks for the reply Perk. I read that link earlier, but it was a bit like martian to me! Made limited sense in theory but didnt really help fix the problem, particularly as the content was ok for the browser under one environment, but not under another.

Just discovered what the problem was, on the plus side it wasnt my noob php code - yay(!) - but it was my noob shared hosting lol. The paramater I was passing to the script was a URL, the server has some form of 'hack' protection filter that breaks URLs containing other URLs - undocumented ofcourse  Roll Eyes Quick .htaccess line fixed it, but it was pure fluke that I happened to read about a similar problem in an ancient wordpress forum post.

Starting to think that despite being new to all this VPS may be the way forward, fixing all the little nuances is a pain in the ass.

Cheers,

DM
Logged
perkiset
Olde World Hacker
Administrator
Lifer
*****
Offline Offline

Posts: 10096



View Profile
« Reply #3 on: September 18, 2007, 10:21:02 AM »

Oh yeah... if you're at all serious about things other than Ks of spam sites, a VPS is the least way to go.

Personally I CoLo with my own boxes - then I have my own VPSs on them because I want to have segregation between a variety of entities. Keeps things nice and clean.

Nice work, BTW on catching the discrepancy...

/p
Logged

It is now believed, that after having lived in one compound with 3 wives and never leaving the house for 5 years, Bin Laden called the U.S. Navy Seals himself.
Pages: [1]
  Print  
 
Jump to:  

Perkiset's Place Home   Best of The Cache   phpMyIDE: MySQL Stored Procedures, Functions & Triggers
Politics @ Perkiset's   Pinkhat's Perspective   
cache
mart
coder
programmers
ajax
php
javascript
Powered by MySQL Powered by PHP Powered by SMF 1.1.2 | SMF © 2006-2007, Simple Machines LLC
Seo4Smf v0.2 © Webmaster's Talks


Valid XHTML 1.0! Valid CSS!