Jump to:

22976 Posts in 11702 Topics by 2826 members

General Questions

SilverStripe Forums » General Questions » Fatal error

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

Page: 1
Go to End
Author Topic: 1079 Views
  • anthias
    Avatar
    Community Member
    14 Posts

    Fatal error Link to this post

    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!

  • Willr
    Avatar
    Forum Moderator
    5462 Posts

    Re: Fatal error Link to this post

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

  • anthias
    Avatar
    Community Member
    14 Posts

    Re: Fatal error Link to this post

    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!

  • anthias
    Avatar
    Community Member
    14 Posts

    Re: Fatal error Link to this post

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

  • Willr
    Avatar
    Forum Moderator
    5462 Posts

    Re: Fatal error Link to this post

    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.

  • Webbower
    Avatar
    Community Member
    10 Posts

    Re: Fatal error Link to this post

    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

  • Webbower
    Avatar
    Community Member
    10 Posts

    Re: Fatal error Link to this post

    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.

    1079 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.