Skip to content
Grav 2.0 is officially stable. Read the announcement →

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

Archive

Internal server error

Started by Muut Archive 12 years ago · 7 replies · 262 views
12 years ago

Hello there,

I have a "one-page site" customized and working fine on my PC.
I have uploaded it to my webserver and I got the following error message:
Fatal error: Call to a member function get() on a non-object in (...)/system/src/Grav/Common/Debugger.php:31

Any idea of something I did wrong?

Also I'm not sure if I should modify "home: alias: '/home'" in system.yaml. I tried to, but it didn't help.

Thanks for your help!

12 years ago

That call is one to get configuration, which appears to be missing somehow. Are you sure you uploaded all the files to your server? Do you have an option to upload a zip file and extract on your server? That might be a safer way, else you should try reuploading the files again.

12 years ago

Hi,
thanks for your answer.
I tried several times to upload the files again, but the result was the same.

I have just compared the grav object on the local and the distant site.
They are the same (except for the paths) till the [uri] element (between [debugger] and [task] elements:

Locally I get:

JS
(...)
           [debugger] => Grav\Common\Debugger Object
                (
                )
            [grav] => Grav\Common\Grav Object
 *RECURSION*
            [uri] => Closure Object
                (
                    [parameter] => Array
                        (
                            [$c] => <required>
                       )
                )
            [task] => Closure Object 
                (
                    [parameter] => Array
                        (
                            [$c] => <required>
                        )
                )
(...)

On the server, I get:

HTML
(...)
[debugger] => Grav\Common\Debugger Object
                (
                )

            [grav] => Grav\Common\Grav Object
 *RECURSION*
            [uri] => 
            [task] =>
 <!DOCTYPE html><!-- "' --></script></style></noscript></xmp>
<meta charset="utf-8">
<meta name=robots content=noindex>
<meta name=generator content="Tracy">
<title>Server Error</title>

<div id="tracy-error-body">
<style>
    body { color: #333; background: white; width: 500px; margin: 100px auto }
    h1 { font: bold 47px/1.5 sans-serif; margin: .6em 0 }
    p { font: 21px/1.5 Georgia,serif; margin: 1.5em 0 }
    small { font-size: 70%; color: gray }
</style>

<h1>Server Error</h1>

<p>We're sorry! The server encountered an internal error and
was unable to complete your request. Please try again later.</p>

<p><small>error 500</small></p>
<div>
(...)

The first difference is that [uri] is empty for the site on the server.
Then, from [task] item, I get the HTML for the server error.

Does this help you to know what's going wrong?

Thanks.

12 years ago

Hmm.. The fact that it worked on your local, but the same site is having trouble on your hosted server combined with this internal server error message means that something in your .htaccess or PHP configuration is causing it.

Read the Internal Server Error documentation

Please try these tips first, if that doesn't help we'll need to dig further.

Really the only way to tell exactly what's going on is to read the actual error message in your error logs.

Also some information on the hosting provider would be useful. What kind of host is it? what version of PHP is it running?

12 years ago

Hello,

on my PC: PHP 5.4.12 Windows
on my server: PHP 5.4.33 Linux

My server provider is "Webou Pro" (Belgium) using OVH hosting.

The actual error message (in the log folder):

TXT
[2014-10-15 20-44-14] Fatal error: Call to a member function get() on a non-object in /<my path>/system/src/Grav/Common/Debugger.php:31  @  http://<my url>/  @@  exception-2014-10-19-20-42-21-8c437038e0ef1896af1b30346fd91f60.html

The HTML file is empty.

Thanks.

12 years ago

I have no idea what could cause this as task should just have POST or GET variable, uri should be either closure or object and fatal error should be impossible as $grav['config'] should have been set when the error happens.

Have you tried clearing cache or clean installation in your server?

12 years ago

Also by clearing cache, Matias means the CLI command: bin/grav clear-cache as that resets a flag to clear memory-based cache as well as any file caches

12 years ago

Hello,

thanks for your answers.
I have run clear-cache and now it works fine!

Thanks again for your help.

Regards.

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1277 9 years ago
Archive · by Muut Archive, 9 years ago
2 885 9 years ago
Archive · by Muut Archive, 9 years ago
2 4014 9 years ago
Archive · by Muut Archive, 9 years ago
1 2890 9 years ago
Archive · by Muut Archive, 9 years ago
3 1074 9 years ago