[solved] Zend (Xenforo) with CloudLinux

Discussion in 'General' started by Licensecart, Apr 20, 2014.

  1. Licensecart

    Licensecart New Member

    Hello guys,

    I'm trying to convince a mate to move to LiteSpeed from nginx, and I installed a trial for him on cPanel (his preferred panel) and a customer of his who is testing the server for him is having issues with Xenforo.

    When LiteSpeed is disabled and Apache is enabled, the forum works fine, however switch it over to LiteSpeed and it breaks.

    I'm a bit confused and I believe it's down to the Zend loader.

    After Build Matching LSPHP I've noticed it only says:

    The error is:

    Code:
    Warning: Uncaught exception 'ErrorException' with message 'require_once(Zend/Controller/Request/Abstract.php): failed to open stream: No such file or directory' in /home/ivrp/public_html/forum/library/Zend/Controller/Request/Http.php:23 Stack trace: #0 /home/ivrp/public_html/forum/library/Zend/Controller/Request/Http.php(23): XenForo_Application::handlePhpError(2, 'require_once(Ze...', '/home/ivrp/publ...', 23, Array) #1 /home/ivrp/public_html/forum/library/Zend/Controller/Request/Http.php(23): require_once() #2 /home/ivrp/public_html/forum/library/XenForo/Autoloader.php(119): include('/home/ivrp/publ...') #3 [internal function]: XenForo_Autoloader->autoload('Zend_Controller...') #4 /home/ivrp/public_html/forum/library/XenForo/FrontController.php(244): spl_autoload_call('Zend_Controller...') #5 /home/ivrp/public_html/forum/library/XenForo/FrontController.php(123): XenForo_FrontController->setup() #6 /home/ivrp/public_html/forum/index.php(13): XenForo_FrontController->run() #7 {main} thrown in /home/ivrp/public_html/forum/library/Zend/Controller/Request/Http.php on line 23
    
    Fatal error: main(): Failed opening required 'Zend/Controller/Request/Abstract.php' (include_path='.:/usr/php4/lib/php:/usr/local/php4/lib/php:/usr/lib/php:/usr/local/lib/php:/home/ivrp/php') in /home/ivrp/public_html/forum/library/Zend/Controller/Request/Http.php on line 23
    
    Warning: Uncaught exception 'ErrorException' with message 'require_once(): open_basedir restriction in effect. File(Zend/Db/Adapter/Abstract.php) is not within the allowed path(s): (/home/ivrp:/usr/lib/php:/usr/php4/lib/php:/usr/local/lib/php:/usr/local/php4/lib/php:/tmp)' in /home/ivrp/public_html/forum/library/Zend/Db/Adapter/Mysqli.php:27 Stack trace: #0 /home/ivrp/public_html/forum/library/Zend/Db/Adapter/Mysqli.php(27): XenForo_Application::handlePhpError(2, 'require_once():...', '/home/ivrp/publ...', 27, Array) #1 /home/ivrp/public_html/forum/library/Zend/Db/Adapter/Mysqli.php(27): require_once() #2 /home/ivrp/public_html/forum/library/XenForo/Autoloader.php(119): include('/home/ivrp/publ...') #3 [internal function]: XenForo_Autoloader->autoload('Zend_Db_Adapter...') #4 [internal function]: spl_autoload_call('Zend_Db_Adapter...') #5 /home/ivrp/public_html/forum/library/Zend/Db.php(248): class_exists('Zend_Db_Adapter...') #6 /home/ivrp/public_html/forum/library/XenForo/Application.php(680): Zend_Db::factory('mysq in /home/ivrp/public_html/forum/library/Zend/Db/Adapter/Mysqli.php on line 27
    
    Fatal error: main(): Failed opening required 'Zend/Db/Adapter/Abstract.php' (include_path='.:/usr/php4/lib/php:/usr/local/php4/lib/php:/usr/lib/php:/usr/local/lib/php:/home/ivrp/php') in /home/ivrp/public_html/forum/library/Zend/Db/Adapter/Mysqli.php on line 23
  2. NiteWave

    NiteWave Administrator

  3. Licensecart

    Licensecart New Member

    Thank you mate I wouldn't have thought about the openbase_dir. I did what the blog post said and restarted Apache, then rebuilt the LSPHP and we still get an error however this is a bit different.

    Code:
    Warning: Uncaught exception 'ErrorException' with message 'require_once(Zend/Controller/Request/Abstract.php): failed to open stream: No such file or directory' in /home/ivrp/public_html/forum/library/Zend/Controller/Request/Http.php:23 Stack trace: #0 /home/ivrp/public_html/forum/library/Zend/Controller/Request/Http.php(23): XenForo_Application::handlePhpError(2, 'require_once(Ze...', '/home/ivrp/publ...', 23, Array) #1 /home/ivrp/public_html/forum/library/Zend/Controller/Request/Http.php(23): require_once() #2 /home/ivrp/public_html/forum/library/XenForo/Autoloader.php(119): include('/home/ivrp/publ...') #3 [internal function]: XenForo_Autoloader->autoload('Zend_Controller...') #4 /home/ivrp/public_html/forum/library/XenForo/FrontController.php(244): spl_autoload_call('Zend_Controller...') #5 /home/ivrp/public_html/forum/library/XenForo/FrontController.php(123): XenForo_FrontController->setup() #6 /home/ivrp/public_html/forum/index.php(13): XenForo_FrontController->run() #7 {main} thrown in /home/ivrp/public_html/forum/library/Zend/Controller/Request/Http.php on line 23
    
    Fatal error: main(): Failed opening required 'Zend/Controller/Request/Abstract.php' (include_path='.:/usr/php4/lib/php:/usr/local/php4/lib/php:/usr/lib/php:/usr/local/lib/php:/home/ivrp/php') in /home/ivrp/public_html/forum/library/Zend/Controller/Request/Http.php on line 23
    
    Warning: Uncaught exception 'ErrorException' with message 'require_once(Zend/Db/Adapter/Abstract.php): failed to open stream: No such file or directory' in /home/ivrp/public_html/forum/library/Zend/Db/Adapter/Mysqli.php:27 Stack trace: #0 /home/ivrp/public_html/forum/library/Zend/Db/Adapter/Mysqli.php(27): XenForo_Application::handlePhpError(2, 'require_once(Ze...', '/home/ivrp/publ...', 27, Array) #1 /home/ivrp/public_html/forum/library/Zend/Db/Adapter/Mysqli.php(27): require_once() #2 /home/ivrp/public_html/forum/library/XenForo/Autoloader.php(119): include('/home/ivrp/publ...') #3 [internal function]: XenForo_Autoloader->autoload('Zend_Db_Adapter...') #4 [internal function]: spl_autoload_call('Zend_Db_Adapter...') #5 /home/ivrp/public_html/forum/library/Zend/Db.php(248): class_exists('Zend_Db_Adapter...') #6 /home/ivrp/public_html/forum/library/XenForo/Application.php(680): Zend_Db::factory('mysqli', Array) #7 [internal function]: XenForo_Application->loadDb(Object(Zend_Config)) #8 /home/ivrp/public_html/forum/libr in /home/ivrp/public_html/forum/library/Zend/Db/Adapter/Mysqli.php on line 27
    
    Fatal error: main(): Failed opening required 'Zend/Db/Adapter/Abstract.php' (include_path='.:/usr/php4/lib/php:/usr/local/php4/lib/php:/usr/lib/php:/usr/local/lib/php:/home/ivrp/php') in /home/ivrp/public_html/forum/library/Zend/Db/Adapter/Mysqli.php on line 23
  4. NiteWave

    NiteWave Administrator

    looks openbase_dir issue has been fixed -- per the blog, no need rebuild lsphp.

    the remaining error messages can be shorten as below:
    the error itself, looks like include_path not right, so
    /home/ivrp/public_html/forum/library/Zend/Controller/Request/Http.php
    failed to open Zend/Controller/Request/Abstract.php
    and
    /home/ivrp/public_html/forum/library/Zend/Db/Adapter/Mysqli.php
    failed to open Zend/Db/Adapter/Abstract.php

    can you create a phpinfo page, to compare the "include_path" value between apache and lsws ? let's see if any helpful.
  5. Licensecart

    Licensecart New Member

    Thank you mate I did that:

    Apache:

    Code:
    Directive                       Local Value                                                        Master Value
    include_path    .:/usr/lib/php:/usr/local/lib/php                               .:/usr/lib/php:/usr/local/lib/php
    
    LiteSpeed:

    Code:
    Directive                       Local Value                                                                                                             Master Value
    include_path    .:/usr/php4/lib/php:/usr/local/php4/lib/php:/usr/lib/php:/usr/local/lib/php:/home/ivrp/php                       .:/usr/lib/php:/usr/local/lib/php
    
  6. NiteWave

    NiteWave Administrator

    can you run litespeed at port offset (e.g., 2000), and PM me the URL of phpinfo ?
    I want to compare the phpinfo page to see if any valuable difference between litespeed and apache
  7. Licensecart

    Licensecart New Member

    Done that mate and now going to PM you.
  8. NiteWave

    NiteWave Administrator

    status update: there is a workaround. need find the root cause.
    workaround:
    replace /usr/local/apache/conf/userdata/std/2/ivrp/cp_php_magic_include_path.conf
    Code:
        <IfModule concurrent_php.c>
           php4_admin_value include_path ".:/usr/php4/lib/php:/usr/local/php4/lib/php:/usr/lib/php:/usr/local/lib/php:/home/ivrp/php"
           php5_admin_value include_path ".:/usr/lib/php:/usr/local/lib/php:/home/ivrp/php"
        </IfModule>
        <IfModule !concurrent_php.c>
           <IfModule mod_php4.c>
              php_admin_value include_path ".:/usr/php4/lib/php:/usr/local/php4/lib/php:/usr/lib/php:/usr/local/lib/php:/home/ivrp/php"
           </IfModule>
           <IfModule mod_php5.c>
              php_admin_value include_path ".:/usr/lib/php:/usr/local/lib/php:/home/ivrp/php"
           </IfModule>
           <IfModule sapi_apache2.c>
              php_admin_value include_path ".:/usr/php4/lib/php:/usr/local/php4/lib/php:/usr/lib/php:/usr/local/lib/php:/home/ivrp/php"
           </IfModule>
        </IfModule>
    with
    Code:
    php_admin_value include_path ".:/usr/lib/php:/usr/local/lib/php:/home/ivrp/public_html/forum/library"
    fixed it.

    need further investigation.
    Licensecart likes this.
  9. NiteWave

    NiteWave Administrator

    has identified the cause. the minimal fix is:
    /usr/local/apache/conf/userdata/std/2/ivrp>diff cp_php_magic_include_path.conf cp_php_magic_include_path.conf.000
    13c13
    < php_value include_path ".:/usr/php4/lib/php:/usr/local/php4/lib/php:/usr/lib/php:/usr/local/lib/php:/home/ivrp/php"
    ---
    > php_admin_value include_path ".:/usr/php4/lib/php:/usr/local/php4/lib/php:/usr/lib/php:/usr/local/lib/php:/home/ivrp/php"

    why?
    did a a lot experiments on the server, and based on that, searched out this post in the end:
    http://xenforo.com/community/threads/installation-error-include-path-issues.26960/#post-656203
    so it's actual an incompatible issue between XenForo and mod_php + apache (PHP running as an Apache module)
    in this mode, php_admin_value take effects. while in suPHP / fastcgi etc modes, php_admin_value directive is ignored.
    and litespeed always honor php_admin_value/php_value/php_admin_flag/php_flag

    this is big lesson learned from this case. Thanks Licensecart for providing the access to the server.

    how to disable php_admin_value properly in WHM/cPanel, I'm not sure yet. but the issue becomes quite clear now.
    Licensecart likes this.
  10. Licensecart

    Licensecart New Member

    Thank you for finding the bleeder :)

Share This Page