Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Fatal error


Reply


7 Posts   1220 Views

Avatar
anthias

Community Member, 14 Posts

25 May 2010 at 7:42pm

Suddenly I have this warning on my online site:

"Fatal error: Call to undefined method HttpRequest::addHeader() in /www/htdocs/w00abc52/sapphire/core/control/Director.php on line 115"

I have not changed anything since weeks nor did I update anything.....
Surely it is a minor mistake. Does somebody have a clue?

Thanks in advance!

Avatar
Willr

Forum Moderator, 5513 Posts

25 May 2010 at 11:02pm

If your using 2.4 then that should be SS_HTTPRequest::addHeader() I believe.

Avatar
anthias

Community Member, 14 Posts

27 May 2010 at 1:38am

Hi Willr!

Thanks for the comment - but unfortunately I still do not know how to solve this.
In this line (115) it reads:

if(isset($_SERVER['HTTP_ACCEPT'])) $req->addHeader("Accept", $_SERVER['HTTP_ACCEPT']);

What do I have to change?

Many thanks in advance!

Avatar
anthias

Community Member, 14 Posts

6 June 2010 at 2:59am

I still got this problem -fatal error message.

As I am a total beginner concerning SS, I really need some advice.

My webhost is all-inkl.com.
My SS_version is 2.3 or 2.4

I am really lost here. Has somebody an idea where to start looking for teh cause of this message?
THANK YOU!!!

Avatar
Willr

Forum Moderator, 5513 Posts

6 June 2010 at 11:25am

anthias - some more information about your environment might help? Judging by your error your on 2.4. Have you got any modules installed (what versions) or lots of custom code?. Also post the full error message / backtrace.

Avatar
Webbower

Community Member, 10 Posts

25 February 2011 at 9:26am

This same problem just hit 3 of my client sites running SS 2.3.x on PHP 5.2.17 (in my case). I did a phpinfo() check and found a module called "http" that supplies a number of built-in classes, one of which is called HttpRequest which matches the server error. I think the change to SS_HTTPRequest (and SS_HTTPResponse) needs to be backported to SS 2.3.x or else I imagine this problem is going to crop up all over the place.

The "http" module lists the following under its "Registered Classes":

HttpUtil
HttpMessage
HttpRequest
HttpRequestPool
HttpRequestDataShare
HttpDeflateStream
HttpInflateStream
HttpResponse
HttpQueryString

Avatar
Webbower

Community Member, 10 Posts

25 February 2011 at 3:53pm

Confirmed with the host. They installed the PECL HTTP extension which is what is causing this problem. Since PHP classes are case-insensitive, the HTTPRequest class that is being instantiated in Director::direct() is the PECL version (called HttpRequest) since that class is pre-loaded into the PHP environment rather than using SilverStripe's __autoload() handler to load the SS version. Waiting to hear from the host for a solution. Hopefully won't have to do an emergency SS upgrade to 2.4.x.