Posted by Jason Barnett on 06/29/05 20:05
Jay Wright wrote:
....
>
> My page uses a header.php5 include file to call
> session_start(). Next a
> require_once("classloader.php5") performs the
> autoload.
>
Here is the problem... you need to switch the order. Load the classes /
autoloader first, then session_start(). PHP was able to serialize the
object because it was properly saved in the session store, but it didn't
have the class definition.
> I'm using php5 on windows xp (also linux).
>
> The error is here:
>
> [client 127.0.0.1] PHP Fatal error: main() [<a
> href='function.main'>function.main</a>]: The script
> tried to execute a method or access a property of an
Read the next part carefully.
> incomplete object. Please ensure that the class
> definition "Gallery" of the object you are trying to
> operate on was loaded _before_ unserialize() gets
> called or provide a __autoload() function to load the
> class definition in
> C:\\code\\jaysphotos\\local-apache-webapp\\web\\thumbnails.php5
> on line 127, referer:
> http://localhost/jaysphotos/thumbnails.php5?page=p2
--
NEW? | http://www.catb.org/~esr/faqs/smart-questions.html
STFA | http://marc.theaimsgroup.com/?l=php-general&w=2
STFM | http://php.net/manual/en/index.php
STFW | http://www.google.com/search?q=php
[Back to original message]
|