PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
I have just recently updated my server to PHP 5.1. I am getting a grip of errors in my logs now related to an object i use. This is just one of the error.
[Thu May 11 10:42:13 2006] [error] [client **.***.**.***] PHP Notice: Undefined property: object::$core in /var/www/vhosts/site.com/httpdocs/index.php on line 23, referer: http://www.site.com/
I have hidden the IP and changed site name to site.com
empiresolutions wrote:perfect answer. what do i change in php.ini file?
Everah gave good links. If you just open up your php.ini file and page down a little there is normally a big section that describes error reporting and has a number of pre-defined settings that you just need to uncomment (and comment the current setting).
The above posts are correct. *But* (yeah there's always a but ) you should really adjust the code to remove the notices. Notices appear for a reason. Imagine you suddenly need to move this code to a shared server for a while where you have no control over the values defined in php.ini ? You'd be knackered. Fixing notices like the one above is usally just a case of small amounts of logic like this:
Even though notices are not critical error type things, you still want to fix them. They identify areas in your code in which there is something wrong. I myself am a stickler for writing clean, usable, error-free code as often as possible (which in my opinion is always). Something like the error you are getting would get me moving to fix it right away.
PS The links to the error reporting directives I gave you were for testing. You really do not want them turned on in production apps or in a production environment.