PDA

View Full Version : APC refuses to work on php 5.1.4


amcd
07-25-2006, 07:26 AM
i was running php 4.4.2 with APC 3.0.10 and it was working ok

today i upgraded php to 5.1.14 and i just cannot get APC to work

i tried compiling apc statically into the php binary also but it doesnt work

there are no errors regarding this in the error_log also

it is as if APC doesnt exist

amcd
07-25-2006, 10:01 AM
my phpinfo is here

http://xboard.us/bbb/phpinfo.php

xing
07-25-2006, 12:28 PM
Please view our APC how-to wiki for PHP:

http://www.litespeedtech.com/community/wiki/

Based on your phpinfo, you either do not have the correct APC compiled for php 5.1.4 or it's installed into the wrong location.

Follow our wiki for a perfect how-to.

amcd
07-25-2006, 12:46 PM
i did follow your wiki exactly, both for installation of php 5 and for installation of APC

earlier i had installed php 4.4.2 and APC also by following your wiki and faced no problems

amcd
07-25-2006, 12:48 PM
do not have the correct APC compiled for php 5.1.4

what does this mean? AFAIK, the APC source is the same, we just have to compile it again for new php version by using the new ppize and php-config path

xing
07-25-2006, 12:52 PM
Remove the current APC source directory. Re-download APC package and uncompress. And start the compilation from the beginning.

Looks like you compiled APC for PHP 4.4 and then used the same source directory for PHP 5. You usually can get away with this with "make clean" by removing all PHP 4.4 generated config files but most often than not, you run into problems if all files are not removed.

amcd
07-25-2006, 12:54 PM
Remove the current APC source directory. Re-download APC package and uncompress. And start the compilation from the beginning.

Looks like you compiled APC for PHP 4.4 and then used the same source directory for PHP 5. You usually can get away with this with "make clean" by removing all PHP 4.4 generated config files but most often than not, you run into problems if all files are not removed.
i already did that

later i created a new directory and tried to install the latest version from cvs also, but same results

xing
07-25-2006, 01:17 PM
Not sure what's going on with your setup. Hopefully other people can jump and help out.

The problem is not that you can't compile APC, it is that php.ini entries could be incorrect or that php is reading from the wrong php.ini so resulting in the fact it can't load/find the apc.so module.

xing
07-25-2006, 01:18 PM
Try this

"php -c /myfullpath/php.ini -i"

Run your php 5.1.4 binary and explicitely state the php.ini file path. Check the output for APC.

amcd
07-25-2006, 01:25 PM
root@webserver [/usr/local/lsws/fcgi-bin]# ./lsphp -c usr/local/lsws/conf/php.ini -i | less

i ran this and i can see APC :yahoo:

does this mean that php running from the webserver is reading config from the wrong location?

but as u can see, phpinfo shows
Configuration File (php.ini) Path ../conf

amcd
07-25-2006, 01:34 PM
i changed the command in external app configuration and apc is now working as confirmed by apc.php

but my phpinfo doesnt load anymore

xing
07-25-2006, 01:38 PM
Now that we have isolated the problem.

The php binary is compiled to read php.ini from "../conf". Which means is that if lsphp is located in /lsws/fcgi-bin/lsphp then the correct php.ini it reads must be in /lsws/conf/php.ini. In addition, you should not use any relative paths in php.ini.

amcd
07-25-2006, 02:06 PM
what you are saying is right, but somehow it is not happening

if i add "-c /fullpath/php.ini" to the command in external app config then apc runs, my site runs, but phpinfo doesnt work

if i remove that path then apc doesnt work

amcd
07-25-2006, 02:10 PM
ok, i solved the phpinfo problem

the php5 ini had short open tag off by default - i switched that on and phpinfo works

but why should i have to explicitly specify the ini location with a -c switch? that is still a mystery to me

amcd
07-25-2006, 02:21 PM
my forums were showing multiple errors with that php.ini

i created a new php.ini in the fcgi-bin directory with only 1 line
extension=apc.so

i figured that if my site runs fine, but only with high load without the ini file, why should i load a huge ini file and complicate things?

now lsphp loads the ini without any '-c' switch (as it looks in current directory first) and everything looks good for the time being