APC refuses to work on php 5.1.4

#1
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
 
#4
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
 
#5
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

LiteSpeed Staff
#6
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.
 
#7
xing said:
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

LiteSpeed Staff
#8
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

LiteSpeed Staff
#9
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.
 
#10
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
 
#11
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

LiteSpeed Staff
#12
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.
 
#13
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
 
#14
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
 
#15
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
 
Top