Internal server error

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!

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.

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:

(...)
           [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:

(...)
[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.

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?

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):

[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.

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?

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

Hello,

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

Thanks again for your help.

Regards.