'unable to read, or response is empty' using Web Service

'unable to read, or response is empty' using Web Service

by Pau Cardells -
Number of replies: 6

Hi everybody, i have this error message using WebService's and, i've been looking for solution for several days in this forums, but i find nothing at all and don't know how to fix it, so any help will be wellcome. I'm begginer developing with PHP and Moodle but i will try to explain:

I'm testing in LOCAL-SERVER Moodle 2.2.2 with Apache 2.2.14, PHP 5.3.2, MySQL 5.1.62 and using XLMRPC protocol on WebService.

 

My PHP-script works really fine and quick calling WebServices and inserting users (core_user_create_users), courses (core_course_create_courses) and enrolments (enrol_manual_enrol_users), if they are LESS of 500 users, courses or enrolments. But when I try to insert about 600, moodle web-service answers this error: object(Zend_Http_Client_Exception)#11822 _ _ _ _ _ 'Unable to read response, or response is empty'.

 

To work with such a number of rows, i 've had to modify the 'timeout' on my Zend_XmlRpc_Client by this way (according to what i read in another forum):

$xmlrpcclient->getHttpClient()->setConfig(array('timeout' => $timeout)) from 10 (seconds) to 300 so it works.

 

Any idea why it gives that error?

Thanks in advance.

Pau

Average of ratings: -
In reply to Pau Cardells

Re: 'unable to read, or response is empty' using Web Service

by robin leveque -

Hi Pau,

Are you sure to have update "max_execution_time" in file "php.ini" in your localhost because i think that it's the problem.

The way for acces to the file is :

wamp/bin/apache/Apache2.2.14/bin/php.ini

cordially,

In reply to robin leveque

Re: 'unable to read, or response is empty' using Web Service

by Pau Cardells -

Hi Robin, thanks for your reply

Default values in my php.ini: max_execution_time = 30  /  max_input_time = 60

I've tried with this values:

- max_execution_time = 300  /  max_input_time = 600

- max_execution_time = 0  /  max_input_time = -1  (trying to disable it)

but it does not work having the same error response

I think it's not relevant but I forgot to say i'm working on linux/ubuntu and my path to php.ini is /etc/php5/apache2

greetings

In reply to Pau Cardells

Re: 'unable to read, or response is empty' using Web Service

by robin leveque -

Re,

Same with max_execution_time = 0, you see an error ? Because put 0 in value allow to update the timeout in unlimited.

Have you go restart your server localhost after this update? because it's indispensable.

After i don't work on linux, so i can help you for its.

greetings

In reply to robin leveque

Re: 'unable to read, or response is empty' using Web Service

by Pau Cardells -

Yes. the same error. I know how to restart the Apache-SERVER to take the new 'php.ini' configuration but I even tried (to be sure) by restarting the computer. Every time, get the same error.

(After your logic and good advice, I also seemed to me that it did not take the configuration)

Best regards

In reply to Pau Cardells

Re: 'unable to read, or response is empty' using Web Service

by robin leveque -
In reply to robin leveque

Re: 'unable to read, or response is empty' using Web Service

by Pau Cardells -

Many thanks Robin. I found and read your first link one week ago and solve my first error 'time exceded'.

I'll continue searching and testing the php.ini configuration, couse i think problems come around it. If find solution, i'll tell you in this forum

Greetings from the distance. Thanks at all.

Pau