Hi Guys,
I've found the reason for the rewrite issues with litespeed and PHP running under fastcgi.
The issue is that fastcgi sends different variables over the fastcgi connection then apache - which results in PHP not interpreting PATH_INFO correctly.
If you compare the output from the fastcgi variables below, especially the path_translated and path_info as that is what the PHP fastcgi handlers care about, you will see the obvious error. All the complaints on the forums about PHP saying 'file not found' for this style of URL can be explained in the differences below.
Is there any chance if LSWS being updated? I don't really want to change the fastcgi code in PHP to work with LSWS if I can help it, and I haven't checked if LSAPI works correctly or not - but for this particular use case (and I imagine many others where there is a migration from webserverX -> litespeed) this is the best option forward.
FastCGI request from Apache:
SERVER_SOFTWAREApache
SERVER_NAMEtest.com
SERVER_ADDR1.2.3.4
SERVER_PORT80
REMOTE_ADDR1.2.3.4
DOCUMENT_ROOT/my/document/root
SERVER_ADMINtest@test.com
SCRIPT_FILENAME/bin/php5 <- from apache config
REMOTE_PORT53960
REDIRECT_URL/index.php/category/library
GATEWAY_INTERFACECGI/1.1
SERVER_PROTOCOLHTTP/1.1
REQUEST_METHODGET
REQUEST_URI/category/library
SCRIPT_NAME/fcgi-bin/php5ac <- from apache config
PATH_INFO/index.php/category/library
PATH_TRANSLATED/my/document/root/index.php/category/library
Request method from LSWS:
GATEWAY_INTERFACECGI/1.1
SERVER_SOFTWARELiteSpeed
SERVER_PROTOCOLHTTP/1.1
REQUEST_METHODGET
SCRIPT_FILENAME/my/document/root
QUERY_STRING
SCRIPT_NAME/index.php/category/library
DOCUMENT_ROOT/my/document/root
REMOTE_ADDR1.2.3.4
REMOTE_PORT50424
SERVER_ADDR1.2.3.4
SERVER_NAMEtest.com
SERVER_ADMIN
SERVER_PORT8088
REQUEST_URI/category/library
PATH_TRANSLATED/my/document/root/category/library
PATH_INFO/category/library
I've found the reason for the rewrite issues with litespeed and PHP running under fastcgi.
The issue is that fastcgi sends different variables over the fastcgi connection then apache - which results in PHP not interpreting PATH_INFO correctly.
If you compare the output from the fastcgi variables below, especially the path_translated and path_info as that is what the PHP fastcgi handlers care about, you will see the obvious error. All the complaints on the forums about PHP saying 'file not found' for this style of URL can be explained in the differences below.
Is there any chance if LSWS being updated? I don't really want to change the fastcgi code in PHP to work with LSWS if I can help it, and I haven't checked if LSAPI works correctly or not - but for this particular use case (and I imagine many others where there is a migration from webserverX -> litespeed) this is the best option forward.
FastCGI request from Apache:
SERVER_SOFTWAREApache
SERVER_NAMEtest.com
SERVER_ADDR1.2.3.4
SERVER_PORT80
REMOTE_ADDR1.2.3.4
DOCUMENT_ROOT/my/document/root
SERVER_ADMINtest@test.com
SCRIPT_FILENAME/bin/php5 <- from apache config
REMOTE_PORT53960
REDIRECT_URL/index.php/category/library
GATEWAY_INTERFACECGI/1.1
SERVER_PROTOCOLHTTP/1.1
REQUEST_METHODGET
REQUEST_URI/category/library
SCRIPT_NAME/fcgi-bin/php5ac <- from apache config
PATH_INFO/index.php/category/library
PATH_TRANSLATED/my/document/root/index.php/category/library
Request method from LSWS:
GATEWAY_INTERFACECGI/1.1
SERVER_SOFTWARELiteSpeed
SERVER_PROTOCOLHTTP/1.1
REQUEST_METHODGET
SCRIPT_FILENAME/my/document/root
QUERY_STRING
SCRIPT_NAME/index.php/category/library
DOCUMENT_ROOT/my/document/root
REMOTE_ADDR1.2.3.4
REMOTE_PORT50424
SERVER_ADDR1.2.3.4
SERVER_NAMEtest.com
SERVER_ADMIN
SERVER_PORT8088
REQUEST_URI/category/library
PATH_TRANSLATED/my/document/root/category/library
PATH_INFO/category/library