LiteSpeed Technologies
Download Download     Blog Blog     Wiki Wiki     Forum Forum     Store     Contact Contact    

Go Back   LiteSpeed Support Forums > LiteSpeed Web Server > Bug Reports > 503 Error when using 3scale PHP Libraries

Reply
 
Thread Tools Display Modes
  #1  
Old 08-15-2012, 07:47 PM
m3dia m3dia is offline
Member
 
Join Date: Aug 2012
Posts: 13
Default 503 Error when using 3scale PHP Libraries

Using the libraries for 3scale here: https://github.com/3scale/3scale_ws_api_for_php

On Litespeed Web Server Standard v4.1.13, I'm getting a 503 Error when I try to use the libraries. Specifically when I run:

$response = $client->authorize($app_id_one, $app_key_one);

Here is the definition:

/**
* Authorize an application.
*
* @param $appId application id.
* @param $appKey secret application key.
* @param $serviceId service id, only required in the case of multiple services
*
* @return ThreeScaleResponse object containing additional authorization information.
* If both provider key and application id are valid, the returned object is actually
* @see ThreeScaleAuthorizeResponse (which is derived from ThreeScaleResponse) and
* contains additional information about the usage status.
*
* @see ThreeScaleResponse
* @see ThreeScaleAuthorizeResponse
*
* @throws ThreeScaleServerError in case of unexpected internal server error
*
* Example:
*
* <code>
* <?php
* $response = $client->authorize('app-id', 'app-key');
* // or $response = $client->authorize('app-id', 'app-key', 'service_id');
*
* if ($response->isSuccess()) {
* // ok.
* } else {
* // something is wrong.
* }
* ?>
* </code>
*/
public function authorize($appId, $appKey = null, $serviceId = null) {
$url = "http://" . $this->getHost() . "/transactions/authorize.xml";
$params = array('provider_key' => $this->getProviderKey(), 'app_id' => $appId);

if ($appKey) {
$params['app_key'] = $appKey;
}

if ($serviceId) {
$params['service_id'] = $serviceId;
}

$httpResponse = $this->httpClient->get($url, $params);

if (self::isHttpSuccess($httpResponse)) {
return $this->buildAuthorizeResponse($httpResponse->body);
} else {
return $this->processError($httpResponse);
}
}


Log export in next post! Please help! Thanks in advance!

m3dia
Reply With Quote
  #2  
Old 08-15-2012, 07:48 PM
m3dia m3dia is offline
Member
 
Join Date: Aug 2012
Posts: 13
Default Log Export 1

Here is my log export:

2012-08-16 01:09:07.537 [NOTICE] [10.122.205.242:53275-0#Example] Content len: 0, Request line: 'GET /api/v1/data/index.php?c=get.customer.distinct.contentprovider& cmcustlocid=1446&appid=4579e681&appkey=c83e559ee2b 2c4a8acb48eae0db5e744 HTTP/1.1'
[ec2-user@ip-10-90-129-117 logs]$ tail error.log -n 100
2012-08-16 00:35:55.347 [INFO] [10.122.205.242:58905-0#Example] connection to [/tmp/lshttpd/lsphp5.sock] on request #500, confirmed, 0, associated process: 11498, running: 1, error: Connection reset by peer!
.....
2012-08-16 00:40:10.919 [INFO] [10.122.205.242:41914-0#Example] connection to [/tmp/lshttpd/lsphp5.sock] on request #500, confirmed, 0, associated process: 11498, running: 1, error: Connection reset by peer!

Last edited by NiteWave; 08-15-2012 at 09:36 PM..
Reply With Quote
  #3  
Old 08-15-2012, 07:49 PM
m3dia m3dia is offline
Member
 
Join Date: Aug 2012
Posts: 13
Default Log Export 2

2012-08-16 00:40:11.661 [INFO] [10.122.205.242:42003-0#Example] connection to [/tmp/lshttpd/lsphp5.sock] on request #500, confirmed, 0, associated process: 11498, running: 1, error: Connection reset by peer!
...
2012-08-16 00:53:19.305 [INFO] [10.122.205.242:48406-0#Example] connection to [/tmp/lshttpd/lsphp5.sock] on request #500, confirmed, 0, associated process: 11498, running: 1, error: Connection reset by peer!

Last edited by NiteWave; 08-15-2012 at 09:37 PM..
Reply With Quote
  #4  
Old 08-15-2012, 07:50 PM
m3dia m3dia is offline
Member
 
Join Date: Aug 2012
Posts: 13
Default Log Export 3

2012-08-16 00:53:25.594 [INFO] [10.122.205.242:49006-0#Example] connection to [/tmp/lshttpd/lsphp5.sock] on request #500, confirmed, 0, associated process: 11498, running: 1, error: Connection reset by peer!
...
2012-08-16 01:06:22.104 [INFO] [10.122.205.242:24096-0#Example] connection to [/tmp/lshttpd/lsphp5.sock] on request #500, confirmed, 0, associated process: 11498, running: 1, error: Connection reset by peer!
2012-08-16 01:09:07.531 [INFO] [10.122.205.242:53275-0#Example] connection to [/tmp/lshttpd/lsphp5.sock] on request #84, confirmed, 1, associated process: 11498, running: 1, error: Connection reset by peer!
2012-08-16 01:09:07.534 [INFO] [10.122.205.242:53275-0#Example] connection to [/tmp/lshttpd/lsphp5.sock] on request #272, confirmed, 1, associated process: 11498, running: 1, error: Connection reset by peer!
2012-08-16 01:09:07.537 [INFO] [10.122.205.242:53275-0#Example] connection to [/tmp/lshttpd/lsphp5.sock] on request #163, confirmed, 1, associated process: 11498, running: 1, error: Connection reset by peer!
2012-08-16 01:09:07.537 [NOTICE] [10.122.205.242:53275-0#Example] Max retries has been reached, 503!
2012-08-16 01:09:07.537 [NOTICE] [10.122.205.242:53275-0#Example] oops! 503 Service Unavailable

Last edited by NiteWave; 08-15-2012 at 09:38 PM..
Reply With Quote
  #5  
Old 08-15-2012, 09:46 PM
NiteWave NiteWave is offline
LiteSpeed Staff
 
Join Date: Sep 2009
Posts: 2,216
I removed many lines of error logs, they are same pattern like:
Code:
2012-08-16 01:06:22.104 [INFO] [10.122.205.242:24096-0#Example] connection to [/tmp/lshttpd/lsphp5.sock] on request #500, confirmed, 0, associated process: 11498, running: 1, error: Connection reset by peer!
it's [INFO], not error.

please refer:
https://store.litespeedtech.com/stor...yarticle&id=31

to check if your 503 can be fixed by this guide.
Reply With Quote
  #6  
Old 08-16-2012, 07:05 AM
m3dia m3dia is offline
Member
 
Join Date: Aug 2012
Posts: 13
Default Checking the guide now

I'm checking the guide link provided now. One more thing to notice, while it fails on the PHP I've compiled specifically for Litespeed:

PHP 5.4.5
'./configure' '--prefix=/usr/local/lsws/lsphp5' '--with-mysqli' '--with-mysql' '--with-zlib' '--enable-shmop' '--enable-track-vars' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-magic-quotes' '--enable-mbstring' '--with-iconv' '--with-mcrypt' '--with-litespeed' '--enable-memcache' '--with-curl' '--with-libdir=/lib64' '--with-soap' '--with-gd' '--with-jpeg-dir=/usr' '--with-png-dir=/usr'

It works on the PHP version I have locally installed on my machine, when called from the command line:

[ec2-user@ip-10-90-129-117 ~]$ php -v
PHP Warning: PHP Startup: apc.shm_segments setting ignored in MMAP mode in Unknown on line 0
PHP 5.3.15 (cli) (built: Jul 20 2012 23:10:20)
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2012 Zend Technologies
Reply With Quote
  #7  
Old 08-16-2012, 07:06 AM
m3dia m3dia is offline
Member
 
Join Date: Aug 2012
Posts: 13
Default Here is my php.ini, which based on the provided link, I'll be modifying

extension=apc.so;
extension=suhosin.so;
extension=adodb.so;
extension=zip.so;
memory_limit = 64M;
max_execution_time=30;
Reply With Quote
  #8  
Old 08-16-2012, 08:18 AM
NiteWave NiteWave is offline
LiteSpeed Staff
 
Join Date: Sep 2009
Posts: 2,216
Quote:
[ec2-user@ip-10-90-129-117 ~]$ php -v
this is not lsphp.
please run:
cd /usr/local/lsws/fcgi-bin
./lsphp5 -i |head
Reply With Quote
  #9  
Old 08-16-2012, 08:24 AM
m3dia m3dia is offline
Member
 
Join Date: Aug 2012
Posts: 13
Default ./lsphp5 -i |head

PHP Deprecated: Comments starting with '#' are deprecated in /usr/local/lsws/lsphp5/lib/php.ini on line 2 in Unknown on line 0PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/lsws/lsphp5/lib/php/extensions/no-debug-non-zts-20100525/adodb.so' - /usr/local/lsws/lsphp5/lib/php/extensions/no-debug-non-zts-20100525/adodb.so: cannot open shared object file: No such file or directory in Unknown on line 0PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/lsws/lsphp5/lib/php/extensions/no-debug-non-zts-20100525/zip.so' - /usr/local/lsws/lsphp5/lib/php/extensions/no-debug-non-zts-20100525/zip.so: cannot open shared object file: No such file or directory in Unknown on line 0phpinfo()
PHP Version => 5.4.5

System => Linux ip-10-90-129-117 3.2.22-35.60.amzn1.x86_64 #1 SMP Thu Jul 5 14:07:24 UTC 2012 x86_64
Build Date => Aug 4 2012 22:14:40
Configure Command => './configure' '--prefix=/usr/local/lsws/lsphp5' '--with-mysqli' '--with-mysql' '--with-zlib' '--enable-shmop' '--enable-track-vars' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-magic-quotes' '--enable-mbstring' '--with-iconv' '--with-mcrypt' '--with-litespeed' '--enable-memcache' '--with-curl' '--with-libdir=/lib64' '--with-soap' '--with-gd' '--with-jpeg-dir=/usr' '--with-png-dir=/usr'
Server API => LiteSpeed V5.5
Virtual Directory Support => disabled
Configuration File (php.ini) Path => /usr/local/lsws/lsphp5/lib
Loaded Configuration File => /usr/local/lsws/lsphp5/lib/php.ini
*** glibc detected *** ./lsphp5: free(): invalid pointer: 0x00007ff714ae9dc8 ***

Do you need all of the "Backtrace?"
Reply With Quote
  #10  
Old 08-16-2012, 08:30 AM
m3dia m3dia is offline
Member
 
Join Date: Aug 2012
Posts: 13
Default Disabling apc.so in php.ini

My issue appears to be resolved by commenting out the line in my php.ini:

#extension=apc.so;

While this makes the PHP code function, it is now negatively effecting the performance of my entire server because the APC caching is now globally disabled.

Any suggestions that may allow me to re-enable the the apc.so line in my php.ini would be greatly appreciated! Thanks.

m3dia
Reply With Quote
Reply

Tags
503, bug, error, http 503

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 09:52 PM.



- Archive - Top
© Copyright 2003-2011 LiteSpeed Technologies, Inc. All rights reserved. Privacy Policy.