Page 1 of 1

[Solved] Cannot access parent fatal error.

Posted: Tue Sep 04, 2012 4:31 pm
by social_experiment
I've recently come across this fatal error
Fatal error: Cannot access parent:: when current class scope has no parent in ...
I did some reading and came across this url
https://bugs.php.net/bug.php?id=56529

Has anyone else come across this bug and fixed it? Is it related to different versions of php because on my production server i didn't have this issue. From what i can gather the live server might be using Lampp where i used Xampp on my production server.

Thanks in advance

Re: Cannot access parent fatal error.

Posted: Tue Sep 04, 2012 5:49 pm
by requinix
Using APC? Disabled it? Or tried touch-ing the file so APC rebuilds it?

Re: Cannot access parent fatal error.

Posted: Tue Sep 04, 2012 5:54 pm
by social_experiment
requinix wrote:Using APC? Disabled it? Or tried touch-ing the file so APC rebuilds it?
No idea x 3. The code in question imports a file, reads the data into an array and the removes it. The line number that came with the error is linked to this code

Code: Select all

fclose($handle);

Re: Cannot access parent fatal error.

Posted: Wed Sep 05, 2012 5:04 am
by social_experiment
The problem seems to be generated by the apc extension. I downloaded and installed the extension on my development server and on certain pages i get this error message (and a notice)

Fatal error: Cannot redeclare __autoload() (previously declared in C:\xampp\htdocs\***\_autoloader.php:5) in C:\xampp\htdocs\***\_autoloader.php on line 10
Notice: A session had already been started - ignoring session_start() in C:\xampp\htdocs\***\_auth.php on line 2

One i've updated the php.ini file and removed the extension the above issue was resolved. I'm in the process of checking the live server to see if the acp extension is present there. My big concern now is if i remove the extension or disable it; what effect will it have on the rest of the server. Is this extension required for proper functioning of code? Also how can i go about preventing this type of thing from happening in future code?

Edit - 2012/09/06
Got additional information about the server housing the code - the apc extension isn't present on the server. The php version is 5.2.6; any ideas on what could be causing this issue?

Edit - 2012/09/10
Problem resolved. I'm not sure what went on here but i'm glad that it is now back to working order. Only problem i found was a 'Cannot redeclar _autoload()...' issue which i fixed.