[solved] Some PHP functions not working in Litespeed PHP

Discussion in 'General' started by Nandhakumar, Aug 21, 2014.

  1. Nandhakumar

    Nandhakumar Member

    I am using the REST API for my magento store.API post/get responses are working if it's under normal php packages but if we go with Litespeed php, API post/get methods are not working.

    here is the REST API code snippet not working when we go with Litespeed server and it's PHP but its working fine in Normal apache and PHP.

    $controller = new $controller_name;
    $action_name = strtolower($request->method);
    $response_str = call_user_func_array(array($controller, $action_name),

    Please refer the screenshot for more info.

    Please let me the solution ASAP

    Attached Files:

    Last edited: Aug 21, 2014
  2. mistwang

    mistwang LiteSpeed Staff

    It could because _SERVER["PATH_INFO"] has been populated to different values.
    please create phpinfo page under /rest/ directory, then compare the result of

    under lsphp and Apache php. see if any differences in the _SERVER[] value.
  3. Nandhakumar

    Nandhakumar Member

    i can't use the phpinfo.php like you have suggested because all the function calling done through index.php file. so i have attached the lsphp info and apache php info along this ticket so please review and let me know what could be the problem for that.


    Attached Files:

  4. mistwang

    mistwang LiteSpeed Staff

    You Apache and LiteSpeed PHP setup does not match, PHP version is different, the compile options are different.

    When you check the phpinfo.php page just add those REST parameters. compare the SERVER[] variables.

  5. Nandhakumar

    Nandhakumar Member

    Actually i have compiled the lsphp version to next level means that (5.4.15) but still i couldn't get this work and this doesn't seems to server PATH issues because when print some parameter in that link it works but in LSPHP the following code snippet doesn't work

    $controller = new $controller_name;
    $action_name = strtolower($request->method);
    $response_str = call_user_func_array(array($controller, $action_name), array($request));

    but the same code snippet working fine in apache php. so what could be the reason for above mentioned code was not working in lsphp?
  6. mistwang

    mistwang LiteSpeed Staff

    I think you should print out the parameters passed to call_user_func_array(), if the value of member is not as expected, need to find out why.

    Can you create a simple test script for us to test?
  7. Nandhakumar

    Nandhakumar Member

    Issue was resolved. i have compiled some more modules with lspph then problem was resolved. thanks for the great effort anyway:)
  8. mistwang

    mistwang LiteSpeed Staff

    The key is that lsphp need to exactly match Apache's PHP, module configuration wise. Need to comparing phpinfo output, add missing modules, match runtime configurations.

Share This Page