Jump to content

strange error in index.php


helmut2509
 Share

Recommended Posts

Some time ago I started a new processwire project.
Today I got a strange error message in the browser:

Notice: Undefined property: stdClass::$sessionName in .../index.php on line 158

Notice: Undefined property: stdClass::$sessionExpireSeconds in .../index.php on line 162

Notice: Undefined property: stdClass::$paths in .../index.php on line 163

Notice: Trying to get property of non-object in .../index.php on line 163

Catchable fatal error: Argument 1 passed to ProcessWire::__construct() must be an instance of Config, instance of stdClass given, called in /.../index.php on line 211 and defined in .../wire/core/ProcessWire.php on line 54
Unable to complete this request due to an error.
--
I have no idea where this comes from, since I only worked on some templates and
didn't change anything in the core.
The Config class has been correctly instantiated in index.php.

any help would be appreciated.

thanx, Helmut
 

Link to comment
Share on other sites

The errors you're seeing definitely sound like the $config variable would be somehow faulty -- either not initialised properly to start with, or perhaps something overwrites it later on. So far it doesn't sound familiar, so I would probably start by testing what exactly "$config" is, at various points in your index.php. Probably the easiest way would be using echo() or die():

echo "Config \"" . $config . "\" is: " . get_class($config) . "<br />";

.. and then all the regular questions:

  • Is this a shared hosting account or private server (or perhaps local installation), and are you sure that nothing has changed server-side lately? Have you moved the site to new host, new directory on the same host, or anything like that?
  • Have you made *any* changes to /site/config.php or /wire/config.php?
  • Have you updated ProcessWire or update/added/installed/uninstalled/removed any modules?
  • Is there anything else in the error log, PW or Apache?
  • Do you see anything else if you enable debug mode in your /site/config.php?
  • What version of ProcessWire are you using?
Link to comment
Share on other sites

The errors you're seeing definitely sound like the $config variable would be somehow faulty -- either not initialised properly to start with, or perhaps something overwrites it later on. So far it doesn't sound familiar, so I would probably start by testing what exactly "$config" is, at various points in your index.php. Probably the easiest way would be using echo() or die():

echo "Config \"" . $config . "\" is: " . get_class($config) . "<br />";

.. and then all the regular questions:

  • Is this a shared hosting account or private server (or perhaps local installation), and are you sure that nothing has changed server-side lately? Have you moved the site to new host, new directory on the same host, or anything like that?
  • Have you made *any* changes to /site/config.php or /wire/config.php?
  • Have you updated ProcessWire or update/added/installed/uninstalled/removed any modules?
  • Is there anything else in the error log, PW or Apache?
  • Do you see anything else if you enable debug mode in your /site/config.php?
  • What version of ProcessWire are you using?

The application is on a root server and I have not made any changes there.

Nor did I change anything in the processwire core.

Apache log file has exactly the same messages as displayed in the browser.

Debug mode in config.php has always been enabled.

Processwire version 2.5, downloaded 2 weeks ago.

Link to comment
Share on other sites

I think I've discovered the cause of the error:

in a custom script I commented out this:

$config = wire('config');

...and the the error did not occur any more.

But I am sure it worked also fine with this command enabled.....

But obviously this command is not necessary if $config is declared as 'global' in the functions?!?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...