CakePHP 3 shell script increase execution timeout limit

530 Views Asked by At

I'm new at cakephp 3 and I'm developing an app using it and php 7.0.

I have a shell script at /app/src/Shell, that connects to a webservice and consumes JSON data.

The problem is, it's taking more than 30 secs to retrieve the data.

I already tried to change the max_execution_time at /etc/php/7.0/cli/php.ini and /etc/php/7.0/apache2/php.ini, but no success.

Am I missing something? Is there a config in cakephp that needs to be changed?

Thanks.

2

There are 2 best solutions below

1
hilton22 On BEST ANSWER

Edit: After what @mark said in his comment, I did some research and found out the solution. The thing is, I'm using the Http Client Class of cakephp 3. Reading the docs, I realized that you can pass the 'timeout' parameter at the moment that the object is been created.

But, also following the @mark's comment, change the timeout value, is not a good practice.

Thank you all for the help!

3
Bsquare ℬℬ On

Ensure you are looking to the good configuration file, of the PHP your are using, thanks to this command:

php -ini |grep "php.ini"