PHP Fatal error: Call to undefined function

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!

Moderator: General Moderators

Post Reply
alxsss
Forum Newbie
Posts: 5
Joined: Sat Apr 26, 2008 7:39 pm

PHP Fatal error: Call to undefined function

Post by alxsss »

Hello,

I use php fast cgi witn nginx and from time to time I see this error
PHP Fatal error: Call to undefined function myfunction, although myfunction is defined inside a file that is included via include_once dirname(__FILE__)."/myfile.php";.
If I move functions around in myfile.php and save it, the error is gone for a while, not forever.

php -v
PHP 5.3.8 (cli) (built: Sep 25 2011 19:21:38)
Copyright (c) 1997-2011 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2011 Zend Technologies

This started happening recently, after an update to all software in the linux box. Could it be a bug in this version of php?

Any ideas how to debug this issue?

Thanks.
Alex.
User avatar
twinedev
Forum Regular
Posts: 984
Joined: Tue Sep 28, 2010 11:41 am
Location: Columbus, Ohio

Re: PHP Fatal error: Call to undefined function

Post by twinedev »

That is strange, try changing it to require_once to see if it is an issue of including the file or the function itself (require wills top the program if it can't load it)

-Greg
Post Reply