|
|

08-15-2012, 07:47 PM
|
|
Member
|
|
Join Date: Aug 2012
Posts: 13
|
|
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
|

08-15-2012, 07:48 PM
|
|
Member
|
|
Join Date: Aug 2012
Posts: 13
|
|
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..
|

08-15-2012, 07:49 PM
|
|
Member
|
|
Join Date: Aug 2012
Posts: 13
|
|
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..
|

08-15-2012, 07:50 PM
|
|
Member
|
|
Join Date: Aug 2012
Posts: 13
|
|
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..
|

08-15-2012, 09:46 PM
|
|
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.
|

08-16-2012, 07:05 AM
|
|
Member
|
|
Join Date: Aug 2012
Posts: 13
|
|
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
|

08-16-2012, 07:06 AM
|
|
Member
|
|
Join Date: Aug 2012
Posts: 13
|
|
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;
|

08-16-2012, 08:18 AM
|
|
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
|

08-16-2012, 08:24 AM
|
|
Member
|
|
Join Date: Aug 2012
Posts: 13
|
|
./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?"
|

08-16-2012, 08:30 AM
|
|
Member
|
|
Join Date: Aug 2012
Posts: 13
|
|
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
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -7. The time now is 09:52 PM.
|
|