[RESOLVED] APC not working correctly?

Discussion in 'PHP' started by azn_romeo_4u, Feb 6, 2010.

  1. azn_romeo_4u

    azn_romeo_4u Member

    On "Uptime" it always says 0 or 1 minute. During that minute it caches and stuff...then just resets.

    This is all i got in php.ini

    extension = "apc.so"
    apc.shm_size = 64

    This is apc.php
    [​IMG]

    Edit. When I switch to apache, it works and continues to cache. Uptime and everything seems to work. But right when I change to litespeed, it resets itself. Uptime is then 0 again.

    Edit. I scoured the web...can't really figure it out.

    Also read a bunch of threads on this forum...nothing.

    I followed the wiki...but do got a question regarding

    What's suppose to do go there? this?

    include_path = ".:/usr/local/lib/php"

    If so...didn't do anything. Is the apc.so suppose to be in there? I also tried the enviroment thing I read on here. Max Connection = to PHP_LSAPI_CHILDREN and instances set @1. Didn't seem to do anything either.
    Last edited: Feb 9, 2010
  2. NiteWave

    NiteWave Administrator

    run phpinfo(), get the setting of "extension_dir", to check if apc.so is under that folder.
  3. azn_romeo_4u

    azn_romeo_4u Member

    Yup I have exntension_dir = "/usr/local/lib/php/extensions/no-debug-non-zts-20060613/" in php.ini and

    extension = "apc.so"
    apc.shm_size = 64

    somewhere in php.ini as well. I'm still confused on that one this one though include_path = ".:/usr/local/lib/php"

    But I don't think it's problem...cuz when I turn on apache...it works...but when I turn on litespeed, it doesn't work. So many a wrong setting in litespeed?
  4. NiteWave

    NiteWave Administrator

    1.does file
    /usr/local/lib/php/extensions/no-debug-non-zts-20060613/apc.so exists?

    2.any related messages in error.log and stderr.log?
  5. azn_romeo_4u

    azn_romeo_4u Member

    Yup that exist, thats why apc.php is loading. No related error_log messages or stderr.log messages.
  6. NiteWave

    NiteWave Administrator

    which version of lsapi? or post your phpinfo() output here.
  7. azn_romeo_4u

    azn_romeo_4u Member

    Not sure which version...but I don't think the latest version that just came out...since I odn't know how to update properly, and it seems like a few bugs have to worked out
    Last edited: Feb 9, 2010
  8. NiteWave

    NiteWave Administrator

    the APC version 3.0.19. not sure rebuild PHP 5.2.11 + latest APC 3.1.3p1 will solve the problem. Build PHP through lsws admin console is convenient and safe.
  9. azn_romeo_4u

    azn_romeo_4u Member

    Same problem. I recompiled APC from source with the version you suggested, and I thought it was working but after 2 minutes didn't work. Next I recompiled php through the lsws admin console and same problem. Also when I switch back to apache, it seems to be caching.
    Last edited: Feb 9, 2010
  10. mistwang

    mistwang LiteSpeed Staff

    APC does not work well with PHP suEXEC as each PHP process will use its own cache memory, not shared.

    You should try eAccelerator + /dev/shm if you need to use PHP suEXEC.
  11. azn_romeo_4u

    azn_romeo_4u Member

    Thank you mw. That might have been the problem. I took out APC and recompiled and went with XCACHE instead. However I had the same problem. It would restart itself. Then I went and disabled SuEXEC (Configuration > Server > General > Php Suexec > No) and it's loading now (XCache is). I'll probably try APC again in the future to see if that will also help with the problem.

    But for now it fixed, weeeeeeeeeeeeeeeee. Server load is soooooo much better
  12. azn_romeo_4u

    azn_romeo_4u Member

    Okay I have another problem. With php suexec turned off, all instances of media wiki upload functions don't work probably. Not sure how they code their thing but I think base on what I read, it requires that the user by run by the user of the site. But with phpsuexc off, everyone is running as nobody.

    Is there anything I can do?
  13. mistwang

    mistwang LiteSpeed Staff

    You need to fix the permission mask of the upload folder to allow write permission for nobody.
  14. azn_romeo_4u

    azn_romeo_4u Member

    Sorry can you explain what you mean? Do you mean chmodding the folder that it's uploaded tom to 777? I have tried that or do you mean something else?
  15. NiteWave

    NiteWave Administrator

    also need check its parent folder's permission.

    sudo -u <user_run_lsphp5> cat <upload_folder>/test.txt

    is a quick way to check all parent folders's permissions.

    This maybe due to various apache rules to prevent a user to upload files to a folder out of his home. Add alias for each user's upload folder, point to a common upload area, maybe a way to resolve this issue. Not sure if there are better ways.
    Last edited: Feb 14, 2010
  16. canglan

    canglan New Member

    We had the same problem where APC keeps crashing. We then reverted PHP LSAPI back from 5.3 to 5.2, everyting was smooth again.

    EDIT: Spoke too soon. Somehow we still get the same issue... :(
    Last edited: Feb 21, 2010

Share This Page