tags:

views:

421

answers:

1

Hi!

I've been trying to install PHP5-APC (http://uk.php.net/apc/). I used macports to get this far.

When i run php -m , i get a list of lots of modules including apc, but the apache error log gives out:

PHP Warning: PHP Startup: Unable to load dynamic library '/opt/local/lib/php/extensions/no-debug-non-zts-20060613/apc.so' - (null) in Unknown on line 0

and there's no modules at all loaded in phpinfo()

Please help! I'm completely confused by this.

Thanks,

Dan

+1  A: 

php-cli and mod_php are completely different runtimes. You can easily have different version installed, and they usually read from different php.ini files.

In this case, the problem lies with the apc extension. Try to comments it out from your php.ini file (The one that Apache uses). apc is a cache, so if you only use your machine for development (You aren't hosting anything on a Mac, I presume), you don't really need it anyway.

troelskn
ah yes - you're right - there are two different versions of php in use.is it possible to get apache to use the same php that the shell is using?i'd like to use APC to make an upload progress bar with php, although i am open to other means of doing this if you can suggest any!thanks very much for your help!
significance
In principle yes, in practise no. You can run php as cgi, but that has a whole class of its own problems associated with it. I'd rather suggest that you make sure that you have the right build of apc.so that matches your mod_php build. This is most likely the root cause of the problem.
troelskn
It just occurred to me that apc is probably the first extension to load (as A is early in the alphabet). Can you try and check if the folder `/opt/local/lib/php/extensions/no-debug-non-zts-20060613/` actually exists?
troelskn