CodeIgniter Forums

Full Version: Problems with CI and the PHP APC extension
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

I have recently been trying to implement a file upload progress app using PHP and AJAX. I got a simple app working outside of CI which required activating the APC extension in PHP. After tweaking things to get it working the way I wanted , I decided to integrate it into a CI app that was waiting for this functionality.

Before attempting the integration, I decided to run my CI app to make sure was still working OK. To my surprise, I got a bunch of 'Constant already defined' errors pointing to the 'config/constants.php' file and these errors were followed by the fatal error 'Class 'Controller' not found in .......'. I then checked several other CI apps and they all had the same errors.

I then went back to my php.ini file and disabled the APC extension, ran my CI apps and they all ran OK. I've enabled and disabled APC several times to confirm that it was the cause of the problem.

I'm running the XAMMPLITE 1.6.6a suite on a Windows machine with the following versions:
Apache 2.2.x
PHP 5.2.5
MySQL ???

I sure would like to resolve this problem ... does anyone have any ideas. I haven't checked this out on my Linux box yet, so I'm not sure whether it's platform specific or not.

Thanks in advance,
Tom Kelly

El Forum

[eluser]Pascal Kriete[/eluser]
I have APC enabled on my development box (PHP 5.2.6, lighttpd 1.4) and CI works fine.

Do you have any APC calls in the app right now? (apc_store, apc_fetch, etc.)
Have you tried with just a base CI install?

[Edit: reading fail - you said you tried several others. I'm at a loss, it might be xammp]

El Forum

I have no APC calls at all in my CI apps. APC is definitely the direct or indirect cause of the problem. CI doesn't even get out of the chute with APC enabled.
I'm somewhat new (and enamored with) CI. I was hoping someone more adept with CI would recognize the scenario ...:

warnings that all the constants defined in constants.php have already been defined and then a fatal error that the 'controller class' is undefined.

Thanks for your input though,

Tom Kelly