[Resolved] Zend (Xenforo) with CloudLinux

Status
Not open for further replies.

Licensecart

Well-Known Member
#1
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:

Build IonCube ...
Determining PHP version
Installing IonCube Loader binaries
Activating IonCube Loader extension in /usr/local/lib/php.ini
IonCube Loader extension activated
copy compiled php binary to litespeed directory
cd /usr/local/lsws/fcgi-bin
ln -sf lsphp-5.4.27 lsphp5

==============================================
Finished building PHP 5.4.27 with LSAPI
==============================================
Sun Apr 20 17:53:09 UTC 2014
**COMPLETE**
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
 

Licensecart

Well-Known Member
#3
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
 

NiteWave

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

the remaining error messages can be shorten as below:
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

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

Licensecart

Well-Known Member
#5
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.
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
 

NiteWave

Administrator
#6
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
 

NiteWave

Administrator
#8
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.
 

NiteWave

Administrator
#9
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
In your Apache configuration files (probably your site's <VirtualHost> entry), I suspect that the include_path is being set via php_admin_value -- this makes it impossible to override. It should be set by php_value instead. After changing that, restart Apache and you should be able to access XenForo correctly.
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.
 
Status
Not open for further replies.
Top