![]() |
[RESOLVED] PHP5 - Linklok IPN 503 error
This is a persistent problem I'm getting with Linklok IPN.
Linklok is a small PHP script that serves files outside the webroot to users who authenticate via a embedded token in the URL. I've reproduced the relevant portion of the code here: PHP Code:
This problem does not occur in Apache. We are using LSWS enterprise 4.12 and both Apache and LSWS are using the same version of PHP5. For now I'm running Apache in parallel JUST to support this script, on port 79. I can't figure out how to run LSWS on a negative port offset (it refuses this as a parameter) and some ISPs view sub-80 http ports as unsafe and refuse connections. |
php stream files is not efficient.
if you can make use of litespeed's "Internal Redirect"(http://www.litespeedtech.com/support...ernal_redirect) feature in the script, will improve a lot. faster and use less resource(mem/cpu/process). And, the issue you reported may be gone. this is not a direct reply to your issue, rather 's a comment. FYI. |
Quote:
EDIT: Ok tried it out, since I'm using PHP I have to use Code:
$header="X-LiteSpeed-Location: /".$link;I checked against a normal "Location :/".$link header and that worked just fine, however, it's doing a normal redirect in this case because I have a rewrite condition on the link which gives a 403 error and that is triggered. Could someone on Litespeed verify if this special header is in the PHP5 binary build for Litespeed? I built this using my Cpanel/Apache config and everything else works fine. |
It is a LiteSpeed internal feature. Only need the "X-LiteSpeed-location" header.
Maybe you can try a simple test script, see if it works. the $link should be a URL different from the request URL, otherwise, it will become a loop redirect. |
I got it to work, but can't seem to get the redirect working properly. Anything that correctly creates a 403 also causes the redirect to 403.
eg. my url is http://abc.com/1234/file.zip According to the wiki I am supposed to be matching for 1234/ to 403, and because litespeed is handling the redirect it should bypass this htaccess rule. However it still gives me a 403 error. |
I just did test on localhost(4.0.13 standard version), it's working as expected.
rewrite rule: Quote:
Quote:
Code:
http://localhost/a/block/test.htmlwhen access via Code:
http://localhost/a/b/test.php |
PHP stream files method
I just realized that this method needs to work properly or anyone using standard PHP scripts to deliver digital goods is going to have to rewrite a substantial amount of code in most shopping carts, and break forward compatibility. Zencart, OSCommerce, Magento etc all use PHP file streaming to secure digital goods.
I am still getting 503 errors in my shopping cart after 4.013 is installed. In order to continue using Litespeed, can you modify the litespeed WHM plugin to allow port offsets of negative numbers? So I can run the file downloads on apache at 8080 and accept normal web connections on Litespeed on the default port 80. Or better yet, solve the 503 issue. |
There was a bug in LiteSpeed PHP-lsapi 5.3 release that may cause 503 errors.
If you build PHP from our web console, please remove php-litespeed-5.3.tgz from /path/to/lsws/phpbuild/ directory then rebuild PHP. If you use WHM plugin to build PHP, you need t remove /home/cpeasyapache/ls.src/php-litespeed-5.3.tgz then build again. |
Just tried that, it seems to introduce a new bug breaking the phpThumb script which is a popular GD thumbnail generator. I've had to revert to Apache in the mean time.
http://phpthumb.sourceforge.net/ |
Maybe it require register_long_arrays
http://www.litespeedtech.com/support...ead.php?t=3757 |
| All times are GMT -7. The time now is 08:12 AM. |