Trying to use APC but it seems to be clearing out?

Discussion in 'PHP' started by NUTNDUN, Jun 17, 2011.

  1. webizen

    webizen New Member

    this means xcache is enabled.
  2. prandah

    prandah Member

    hello webizen
    i have little confuse

    xcached enable

    but when i check

    [root@poseidon lsws]# fcgi-bin/lsphp5 -v
    PHP 5.2.17 (litespeed) (built: Nov 23 2011 17:33:56)
    Copyright (c) 1997-2004 The PHP Group
    Zend Engine v2.2.0, Copyright (c) 1998-2010 Zend Technologies
    [root@poseidon lsws]#
  3. webizen

    webizen New Member

    I have to take it back.

    you need to be in /usr/local/lsws/fcgi-bin/ to check lsphp5.

    for below, it is likely you are in a different directory (.../php) that has a copy of php.ini with "extension=xcache.so" in it.

    However, your fcgi-bin/lsphp5 uses a copy of php.ini with *NO* "extension=xcache.so" (xcache not enabled). that's why 'fcgi-bin/lsphp5 -v' shows no xcache. To find out which php.ini your lsphp5 uses, do following.
    So in your case, lsphp5 doesn't not have xcache enabled.
  4. prandah

    prandah Member

    yes i have copy it to /opt/
    thanks webizen
    my problem solved now :D
  5. prandah

    prandah Member

    hello
    i have install it
    but i still confused

    PHP:
    HTTP/1.0 200 OK

    X
    -Powered-ByPHP/5.2.17

    Cache
    -Control: private

    Pragma: private

    Content-Typetext/htmlcharset=ISO-8859-1

    X
    -UA-CompatibleIE=7

    Content
    -Encodinggzip

    Content
    -Length19414
    Date
    Sun27 Nov 2011 10:15:05 GMT

    Server
    LiteSpeed

    X
    -CacheMISS from wire.clearos.lan

    X
    -Cache-LookupMISS from wire.clearos.lan:3128

    Via
    1.0 wire.clearos.lan:3128 (squid/2.6.STABLE21)

    Connectionkeep-alive
    how to know xcache work ?
  6. webizen

    webizen New Member

  7. prandah

    prandah Member

    wow work like charm :D
    thanks webizen
  8. azn_romeo_4u

    azn_romeo_4u Member

    I'm having problems. I used the build php with xcache and memcached check in the lsws admin page. I noted down the install directory for xcache.so

    When I check php -v it says xcache is installed. But when I view a phpinfo on a web page no xcache is installed.

  9. NiteWave

    NiteWave Administrator

    does this file exist?
    /usr/local/lsws/lsphp5/lib/php/extensions/no-debug-non-zts-20060613/xcache.so
  10. prandah

    prandah Member

    if you check from php -v i think it's wrong
    try fcgi-bin/lsphp5 -v

    if you check with php -v alsi it just chect your server
    and not your litespeed CMIIW

    example :

    Last edited: Dec 22, 2011
  11. semprot

    semprot Member

    Here it is (while i open litespeed admin on whm)
    Code:
    root@mybox [~]# pstree -p | grep litespeed
            |-litespeed(28249)-+-httpd(28250)
            |                  |-litespeed(28251)-+-admin_php(32375)
            |                  |                  |-{litespeed}(28253)
            |                  |                  `-{litespeed}(28254)
            |                  `-litespeed(28252)-+-lsphp5(28271)-+-lsphp5(32446)
            |                                     |-{litespeed}(28255)
            |                                     `-{litespeed}(28256)
    
    Here it is
    Code:
    Name : lsphp5
    Address	 : uds://tmp/lshttpd/lsphp5.sock
    Notes : Not Set
    Max Connections	: 35
    
    Environment :
    PHP_LSAPI_MAX_REQUESTS=500
    PHP_LSAPI_CHILDREN=35
    Initial Request Timeout (secs) : 60
    Retry Timeout (secs) : 0
    Persistent Connection : Yes
    Connection Keepalive Timeout : Not Set
    Response Buffering : No
    Auto Start : Yes
    Command	: $SERVER_ROOT/fcgi-bin/lsphp5
    Back Log : 100
    Instances : 1
    suEXEC User : Not Set
    suEXEC Group : Not Set
    Run On Start Up	: Not Set
    Max Idle Time : 10
    Priority : 0
    Memory Soft Limit (bytes) : 1024M
    Memory Hard Limit (bytes) : 1024M
    Process Soft Limit : 500
    Process Hard Limit : 500
    What setting should i change? Max idle time to -1?
  12. NiteWave

    NiteWave Administrator

    it will help. what's your issue? "Trying to use APC but it seems to be clearing out" as titled ?
  13. semprot

    semprot Member

    Yes.. My APC is restarted every 30mins-3 hours, (more frequent at peak traffic).
  14. NiteWave

    NiteWave Administrator

    please watch the result after set "Max idle time" -1
  15. semprot

    semprot Member

    i've set it to -1 about 1 h ago, but my apc was restarted 20 minutes ago.. Any log that i should check?
  16. NiteWave

    NiteWave Administrator

    please memo down the pid of parent lsphp5, see if it changes too.
    in your previous post,
    parent lsphp5 pid is 28271
  17. semprot

    semprot Member

    Here is my result now

    Code:
    root@mybox[~]# pstree -p | grep litespeed
            |-litespeed(10551)-+-httpd(10552)
            |                  |-litespeed(10553)-+-lsphp5(10559)-+-lsphp5(14546)
            |                  |                  |-{litespeed}(10555)
            |                  |                  `-{litespeed}(10556)
            |                  `-litespeed(10554)-+-lsphp5(10595)-+-lsphp5(13525)
            |                                     |-{litespeed}(10557)
            |                                     `-{litespeed}(10558)
    Yes it is changed now, so it seems litespeed was restarted?
    Last edited: May 10, 2012
  18. NiteWave

    NiteWave Administrator

    yes, if pid of litespeed changed, it must have been restarted.

    litespeed may restart to fix 503 error automatically.
    in a site with buggy php script, this may be helpful without whole site down.
  19. semprot

    semprot Member

    Usually when i got an 503 error and LS was restarted, i got an e-mail notification. Why i didn't get any notification?

    Is there any log that i can check to see why it happened?
    I tried to open "Server Log Viewer" but there are too many.
  20. NiteWave

    NiteWave Administrator

    grep "Server Stopped" in error log, check log entries before it.

Share This Page