Install apc

Mitch

Verified User
Joined
Apr 16, 2013
Messages
75
Hi,

I just updated my php to 5.4.24 but I'm getting this message:

PHP Fatal error: Call to undefined function Doctrine\Common\Cache\apc_fetch()
and
PHP Fatal error: Cannot redeclare class SessionHandlerInterface in (symfony2 project)


How to get APC back to work?
I tried: http://help.directadmin.com/item.php?id=400

But its still not working.
I dont even know how to check if its working

This path does not exist on the file system:
extension_dir = "/usr/local/lib/php/extensions/no-debug-non-zts-20060613/"

PHP Warning: PHP Startup: apc: Unable to initialize module
Module compiled with module API=20090626
PHP compiled with module API=20100525
 
Last edited:
Hello,

This error
Code:
[COLOR=#333333]PHP Warning: PHP Startup: apc: Unable to initialize module[/COLOR]
[COLOR=#333333]Module compiled with module API=20090626[/COLOR]
[COLOR=#333333]PHP compiled with module API=20100525
means that apc.so was compiled against the old php version.
Since this is a new version of php, the solution is to re-compile and re-install the apc.so file again.
Basically, just re-run the id=400 guide again, and you should be done after the "make install" command.
The make install will output a path.. so double check that the extension_dir matches that path.

To check if it's working, create an info.php file in a web directory somewhere.
Add the code
Code:
<?php
phpinfo();
?>
then view the info.php with a browser.

There should be an APC section, looking like this:

[/COLOR][h=2]apc[/h][TABLE="width: 600"]
[TR="class: h, bgcolor: #9999CC"]
[TH="align: center"]APC Support[/TH]
[TH="align: center"]enabled[/TH]
[/TR]
[TR]
[TD="class: e, bgcolor: #CCCCFF"]Version[/TD]
[TD="class: v, bgcolor: #CCCCCC"]3.1.13[/TD]
[/TR]
[TR]
[TD="class: e, bgcolor: #CCCCFF"]APC Debugging[/TD]
[TD="class: v, bgcolor: #CCCCCC"]Disabled[/TD]
[/TR]
[TR]
[TD="class: e, bgcolor: #CCCCFF"]MMAP Support[/TD]
[TD="class: v, bgcolor: #CCCCCC"]Enabled[/TD]
[/TR]
[TR]
[TD="class: e, bgcolor: #CCCCFF"]MMAP File Mask[/TD]
[TD="class: v, bgcolor: #CCCCCC"]no value[/TD]
[/TR]
[TR]
[TD="class: e, bgcolor: #CCCCFF"]Locking type[/TD]
[TD="class: v, bgcolor: #CCCCCC"]pthread mutex Locks[/TD]
[/TR]
[TR]
[TD="class: e, bgcolor: #CCCCFF"]Serialization Support[/TD]
[TD="class: v, bgcolor: #CCCCCC"]php[/TD]
[/TR]
[TR]
[TD="class: e, bgcolor: #CCCCFF"]Revision[/TD]
[TD="class: v, bgcolor: #CCCCCC"]$Revision: 327136 $[/TD]
[/TR]
[TR]
[TD="class: e, bgcolor: #CCCCFF"]Build Date[/TD]
[TD="class: v, bgcolor: #CCCCCC"]Jan 25 2014 17:57:27[/TD]
[/TR]
[/TABLE]

John
 
Oke, I did it all over again.

Now I installed successfully to 5.4.24.
after that I did the id=400 page.

when thats done I did ./build rewrite_confs
restart httpd was [OK]

Now, i'm looking into my phpinfo() page and I don't see de APC part.
I have the old phpinfo still open and there I can see a APC part.

What's wrong?

Error log:
PHP Warning: PHP Startup: apc: Unable to initialize module
Module compiled with module API=20090626
PHP compiled with module API=20100525
These options need to match in Unknown on line 0

config file:
extension_dir = "/usr/local/lib/php/extensions/no-debug-non-zts-20100525/"

I did the steps again and still no success


Can this be the problem?
http://stackoverflow.com/questions/...h-incorrect-compiled-api-unable-to-initialize

Code:
phpize
Configuring for:
PHP Api Version:         20100412
Zend Module Api No:      20100525
Zend Extension Api No:   220100525
 
Last edited:
Here is somthing to try, it might solve the problem, or it might not, but it is worth trying:

1: Check this path: /usr/local/directadmin/custombuild - if that path contain any folder/directory with php in its name, then delete the php folder/directory from that path, then recompile php again:

Code:
cd /usr/local/directadmin/custombuild
./build update
./build php n

Then do the id=400 page http://help.directadmin.com/item.php?id=400

2: If problem still exist, then delete or rename all these files (maybe only some of them exist on your server, delete or rename all that exist):

Code:
/usr/local/php5/bin/phpize
/usr/local/php5/bin/php-config
/usr/local/bin/php-config
/usr/local/bin/phpize

After deleting og renaming those files, then recompile php again:

Code:
cd /usr/local/directadmin/custombuild
./build update
./build php n

Then do the id=400 page http://help.directadmin.com/item.php?id=400
 
Since you've compiled apc module with the wrong library (5.3 instead 5.4 o viceversa) you need to recreate the config.h file inside APC folder (APC-3.1.13) under /usr/local/directadmin/custombuild/ to reinstall APC with the correct library, so simply delete APC folder APC-3.1.13 in path mentioned above and do the id=400 page http://help.directadmin.com/item.php?id=400 again, this solved problem for me.
 
Back
Top