DevMvrht Posted March 1, 2017 Share Posted March 1, 2017 (edited) Hello, I am currently trying to set up the WebService on my shop currently "hosted" on my localhost. I am following the Web service tutorial on the Prestashop documentation and I have issues with the Chapter 3 - First steps - Accessing the web service and listing customers. As indicated in the documentation I have : Enabled cURL from the good PHP.ini (used by PHP) Downloaded the WebServiceLibrary script at the root of my shop Created my own script at the root of the shop and called the WebService as follow : try { $webService = new PrestaShopWebservice(PS_SHOP_PATH, PS_WS_AUTH_KEY, DEBUG); //$xml = $webService->get(array('resource' => 'carts')); $xml = $webService->get(array('url' => PS_SHOP_PATH.'/api/carts?schema=blank')); } catch (PrestaShopWebserviceException $e) { // Here we are dealing with errors $trace = $e->getTrace(); if ($trace[0]['args'][0] == 404) echo 'Bad ID'; else if ($trace[0]['args'][0] == 401) echo 'Bad auth key'; else echo 'Other error<br />'.$e->getMessage(); } However, when accessing the script from my browser, I get the following error : Fatal error: Maximum execution time of 30 seconds exceeded in ...\PSWebServiceLibrary.php on line 140 The line 140 of the scripts refers to call to the curl_exec function : $session = curl_init($url); //... curl_setopt_array($session, $curl_options); $response = curl_exec($session); When accessing the desired url from the browser itself, I get the response right away. I tried to change the options given to cURL according to what I found on the internet http://stackoverflow.com/questions/33733922/curl-takes-too-long-to-load http://stackoverflow.com/questions/22355739/php-curl-long-execution-time Here is information about my setup taken from the Prestashop admin panel and phpinfo() function : STORE INFORMATIONPrestaShop version: 1.6.1.11 // I have also tested with Prestashop 1.7Shop URL: http://localhost/projects/prestashop_1.6/Current theme in use: default-bootstrap SERVER INFORMATIONOS : Windows 10Wamp Package : EasyPHPServer software version: Apache/2.4.7 (Win32) PHP/5.4.24PHP version: 5.4.24Memory limit: 1024MMax execution time: 30 CURL cURL support : enabled cURL Information : 7.30.0 The shop is totally clear, I just have installed prestashop and activated the webservice right after. Thanks in advance for your help Edited March 1, 2017 by DevMvrht (see edit history) Link to comment Share on other sites More sharing options...
Xpert-Idea Posted March 2, 2017 Share Posted March 2, 2017 try to increase max execution time 30 to 300 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now