[Resolved] Magento/CPANEL/LiteSpeed issue

Geoff

Active Member
#1
OK, I have had a few problems now, and have been able to resolve quite a few.

Most recently was that PHP wasnt compiled with the right options for magento. I resolved that in CPANEL, by switching back to apache, rebuilding php with all the options for magento, and then getting litespeed to create a matching binary. So far so good.
Now, however, if I view the site in apache, the magento shop loads no problem, however, in litespeed I get:
Warning: include_once(Mage/Core/functions.php) [function.include-once]: failed to open stream: No such file or directory in /home/xxxx/public_html/app/Mage.php on line 49

Warning: include_once() [function.include]: Failed opening 'Mage/Core/functions.php' for inclusion (include_path='.:/usr/php4/lib/php:/usr/local/php4/lib/php:/usr/lib/php:/usr/local/lib/php:/home/xxxx/php') in /home/xxxx/public_html/app/Mage.php on line 49

Warning: include_once(Varien/Autoload.php) [function.include-once]: failed to open stream: No such file or directory in /home/xxxx/public_html/app/Mage.php on line 50

Warning: include_once() [function.include]: Failed opening 'Varien/Autoload.php' for inclusion (include_path='.:/usr/php4/lib/php:/usr/local/php4/lib/php:/usr/lib/php:/usr/local/lib/php:/home/xxxx/php') in /home/xxxx/public_html/app/Mage.php on line 50

Fatal error: Class 'Varien_Autoload' not found in /home/xxxx/public_html/app/Mage.php on line 53

So, did some research and found out this is sometimes due to rewrite not being enabled.
1. Cant find the rewrite switch in admin plugin (CPANEL) (LS 4.0.13 licensed).
2. noted that there are NO vhost templates loaded..
3. The sites are showing as listeners and as APVH_ hosts in general
4. other "basic" sites appear to be working ok

Anyone has any idea, please let me know. My customer has paid for a litespeed license and I'm not keen on telling him to go back to apache :)
 
Last edited by a moderator:

Geoff

Active Member
#3
they are in the appropriate directories in the customer's folder..

CPANEL appears to install it, and it "just works" if I switch to apache. The error only occurs when litespeed is serving the pages.
 

NiteWave

Administrator
#4
apache and litespeed use different php binary.
it looks the problem at php include_path setting.

can you compare the phpinfo() output, regarding "include_path"?
 

Geoff

Active Member
#5
litespeed:
Code:
include_path	.:/usr/php4/lib/php:/usr/local/php4/lib/php:/usr/lib/php:/usr/local/lib/php:/home/xxxx/php	.:/usr/lib/php:/usr/local/lib/php
apache:
Code:
include_path	.:/usr/lib/php:/usr/local/lib/php	.:/usr/lib/php:/usr/local/lib/php
 

Geoff

Active Member
#7
didnt work:s

I certainly wouldnt want to have to add each one for each site on the server manually :p

Last night I took the configure commands for the apache version of PHP and compiled another php for litespeed... same problem.
 

Geoff

Active Member
#8
fyi:
Code:
Configure Command	 './configure' '--prefix=/usr/local/lsws/lsphp5' '--enable-bcmath' '--enable-calendar' '--enable-force-cgi-redirect' '--enable-ftp' '--enable-libxml' '--enable-magic-quotes' '--enable-mbstring' '--enable-pdo=shared' '--enable-sockets' '--with-curl=/opt/curlssl/' '--with-curlwrappers' '--with-gd' '--with-gettext' '--with-imap=/opt/php_with_imap_client/' '--with-imap-ssl=/usr' '--with-jpeg-dir=/usr' '--with-kerberos' '--with-libxml-dir=/opt/xml2/' '--with-mcrypt=/opt/libmcrypt/' '--with-mysql=/usr' '--with-mysql-sock=/var/lib/mysql/mysql.sock' '--with-openssl=/usr' '--with-openssl-dir=/usr' '--with-pdo-mysql=shared' '--with-pdo-sqlite=shared' '--with-png-dir=/usr' '--with-sqlite=shared' '--with-xpm-dir=/usr' '--with-zlib' '--with-zlib-dir=/usr' '--with-litespeed' '--enable-suhosin'
Server API	LiteSpeed V5.3
Virtual Directory Support	disabled
Configuration File (php.ini) Path	/usr/local/lsws/lsphp5/lib
virtual directory support disabled.. is that normal?
 
Last edited:

Geoff

Active Member
#9
Ok, more info

Code:
include_path	.:/usr/php4/lib/php:/usr/local/php4/lib/php:/usr/lib/php:/usr/local/lib/php:/home/custname/php	.:/usr/local/lsws/lsphp5/lib/php
The php.ini appears to be the one in "/usr/local/lsws/lsphp5/lib"

The first lot of include_dir are the "local value", the last one is the master value.

What is overriding the master value? I can set the master value to anything I like, and it makes no difference.
In fact, php.ini says nothing, as per:
Code:
; UNIX: "/path1:/path2"
;include_path = ".:/php/includes"
;
; Windows: "\path1;\path2"
;include_path = ".;c:\php\includes"
So, I installed cpanel, then litespeed, compiled php using litespeed, then installed magento, put the php.ini into the right folder and the errors are gone away, and nothing at all displays now, just a blank page.

note: other php based sites are ok, its just this magento one.
 
Last edited:

Geoff

Active Member
#10
ok, the problem "appears" to be that there is some kind of local config which is over riding the "master" in the php.ini, here:
Code:
Warning: include_once() [function.include]: Failed opening 'Mage/Core/functions.php' for inclusion (include_path='.:/usr/php4/lib/php:/usr/local/php4/lib/php:/usr/lib/php:/usr/local/lib/php:/home/pcshop/php') in /home/pcshop/public_html/app/Mage.php on line 49
Any ideas where this is? (or what?)
 

Geoff

Active Member
#13
litespeed:
Code:
include_path	.:/usr/php4/lib/php:/usr/local/php4/lib/php:/usr/lib/php:/usr/local/lib/php:/home/xxxx/php	.:/usr/lib/php:/usr/local/lib/php
apache:
Code:
include_path	.:/usr/lib/php:/usr/local/lib/php	.:/usr/lib/php:/usr/local/lib/php
As you can see from the above quote the apache php.ini include path is quite different from the litespeed one. The thing is.. ITS THE SAME PHP.INI!!!

So.. there is no code in the magento install that is changing anything, its coming from litespeed.. BUT WHERE?

All I have done is make a working php install in apache, then "match php build" in litespeed, and this is the error..

(note, that lightspeed is looking in php4 directories too, and yet its using php5)
 

Geoff

Active Member
#14
actually, I found it.. its in the httpd.conf..

now.. if anyone has any ideas how to fix it, let me know.. otherwise I shall approach the CPANEL crowd and see if I can get any help
 
#15
can you try: edit /home/pcshop/public_html/includes/config.php

delete or comment following 2 lines:
Code:
#define('COMPILER_INCLUDE_PATH', dirname(__FILE__).DIRECTORY_SEPARATOR.'src');
#define('COMPILER_COLLECT_PATH', dirname(__FILE__).DIRECTORY_SEPARATOR.'stat');
 

mistwang

LiteSpeed Staff
#16
actually, I found it.. its in the httpd.conf..

now.. if anyone has any ideas how to fix it, let me know.. otherwise I shall approach the CPANEL crowd and see if I can get any help
Please do not bother cPanel support for LiteSpeed related issue, we got complaints, we will help you figure it out.

There tons of Magento sites hosted with Litespeed. should not be any problem.

Try "Build Matching PHP" from LSWS WHM plugin, it should fix your problem.
With cPanel, we do not recommend using "Build PHP" function in LSWS web console.
 

Geoff

Active Member
#18
hi mistwang,

just fyi, I already did the build matching php from the plugin, right from the beginning. I have redone it a few times after rebuilding php in easyapache.

Those 2 lines in /home/pcshop/public_html/includes/config.php are already commented out.

It appears to me that something very weird is going on. In CPANEL, apache and litespeed use the same php.ini, correct? And they also use the same httpd.conf to get configuration, at least, I am assuming that is what is happening from the settings I have selected.

however, litespeed is doing something strange with the vhost php includes that cpanel insists on having, which is found here:

/usr/local/apache/conf/userdata/std/2/pcshop/*.conf

This is an include in the apache vhost config.

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/pcshop/php"
       php5_admin_value include_path ".:/usr/lib/php:/usr/local/lib/php:/home/pcshop/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/pcshop/php"
       </IfModule>
       <IfModule mod_php5.c>
          php_admin_value include_path ".:/usr/lib/php:/usr/local/lib/php:/home/pcshop/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/pcshop/php"
       </IfModule>
    </IfModule
This works with apache, but not with litespeed.. also, this location: /home/pcshop/php - doesnt exist, there is no php folder there.
 

Geoff

Active Member
#20
the funny thing is, that when I switch back to apache, it appears to ignore the vhost include paths I had in the previous post and just reads this for both local and master values:

Code:
.:/usr/lib/php:/usr/local/lib/php
 
Top