APC refuses to work on php 5.1.4

Discussion in 'PHP' started by amcd, Jul 25, 2006.

  1. amcd

    amcd New Member

    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
  2. amcd

    amcd New Member

  3. xing

    xing LiteSpeed Staff

    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.
  4. amcd

    amcd New Member

    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. amcd

    amcd New Member

    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
  6. xing

    xing LiteSpeed Staff

    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. amcd

    amcd New Member

    i already did that

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

    xing LiteSpeed Staff

    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.
  9. xing

    xing LiteSpeed Staff

    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. amcd

    amcd New Member

    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. amcd

    amcd New Member

    i changed the command in external app configuration and apc is now working as confirmed by apc.php

    but my phpinfo doesnt load anymore
  12. xing

    xing LiteSpeed Staff

    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. amcd

    amcd New Member

    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. amcd

    amcd New Member

    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. amcd

    amcd New Member

    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

Share This Page