CakePHP 3 shell script increase execution timeout limit
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.
php shell cakephp cakephp-3.0 php-7.0
add a comment |
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.
php shell cakephp cakephp-3.0 php-7.0
You are confusing PHP timeout with object and webservice timeout. PHP timeout is 0 by default in CLI. The problem is the timeout of the webservice and the connection to this one (Client object etc). Those timeouts are hard to change (can be raised a bit but will result in flaky behavior). You should make sure you never do requests to webservices beyond a few seconds!
– mark
Nov 13 '18 at 14:28
Thanks @mark for the clarification. I'm in touch with the webservice developer to improve API performance. Using Postman for testing, the response takes an average of 46 to 50 seconds to retrieve the data.
– hilton22
Nov 13 '18 at 15:32
How exactly do you make call to webservice? please, provide more details
– Vadim
Nov 14 '18 at 4:35
add a comment |
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.
php shell cakephp cakephp-3.0 php-7.0
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.
php shell cakephp cakephp-3.0 php-7.0
php shell cakephp cakephp-3.0 php-7.0
edited Nov 13 '18 at 18:08
hilton22
asked Nov 13 '18 at 12:48
hilton22hilton22
12
12
You are confusing PHP timeout with object and webservice timeout. PHP timeout is 0 by default in CLI. The problem is the timeout of the webservice and the connection to this one (Client object etc). Those timeouts are hard to change (can be raised a bit but will result in flaky behavior). You should make sure you never do requests to webservices beyond a few seconds!
– mark
Nov 13 '18 at 14:28
Thanks @mark for the clarification. I'm in touch with the webservice developer to improve API performance. Using Postman for testing, the response takes an average of 46 to 50 seconds to retrieve the data.
– hilton22
Nov 13 '18 at 15:32
How exactly do you make call to webservice? please, provide more details
– Vadim
Nov 14 '18 at 4:35
add a comment |
You are confusing PHP timeout with object and webservice timeout. PHP timeout is 0 by default in CLI. The problem is the timeout of the webservice and the connection to this one (Client object etc). Those timeouts are hard to change (can be raised a bit but will result in flaky behavior). You should make sure you never do requests to webservices beyond a few seconds!
– mark
Nov 13 '18 at 14:28
Thanks @mark for the clarification. I'm in touch with the webservice developer to improve API performance. Using Postman for testing, the response takes an average of 46 to 50 seconds to retrieve the data.
– hilton22
Nov 13 '18 at 15:32
How exactly do you make call to webservice? please, provide more details
– Vadim
Nov 14 '18 at 4:35
You are confusing PHP timeout with object and webservice timeout. PHP timeout is 0 by default in CLI. The problem is the timeout of the webservice and the connection to this one (Client object etc). Those timeouts are hard to change (can be raised a bit but will result in flaky behavior). You should make sure you never do requests to webservices beyond a few seconds!
– mark
Nov 13 '18 at 14:28
You are confusing PHP timeout with object and webservice timeout. PHP timeout is 0 by default in CLI. The problem is the timeout of the webservice and the connection to this one (Client object etc). Those timeouts are hard to change (can be raised a bit but will result in flaky behavior). You should make sure you never do requests to webservices beyond a few seconds!
– mark
Nov 13 '18 at 14:28
Thanks @mark for the clarification. I'm in touch with the webservice developer to improve API performance. Using Postman for testing, the response takes an average of 46 to 50 seconds to retrieve the data.
– hilton22
Nov 13 '18 at 15:32
Thanks @mark for the clarification. I'm in touch with the webservice developer to improve API performance. Using Postman for testing, the response takes an average of 46 to 50 seconds to retrieve the data.
– hilton22
Nov 13 '18 at 15:32
How exactly do you make call to webservice? please, provide more details
– Vadim
Nov 14 '18 at 4:35
How exactly do you make call to webservice? please, provide more details
– Vadim
Nov 14 '18 at 4:35
add a comment |
2 Answers
2
active
oldest
votes
Ensure you are looking to the good configuration file, of the PHP your are using, thanks to this command:
php -ini |grep "php.ini"
Thanks for the reply @Bsquare. My localhost is using /cli php.ini. But I already tried to change the 'max_execution_time' in /cli/php.ini, restarted the service, but no success.
– hilton22
Nov 13 '18 at 13:25
It is strange, Try putting this instruction at beginning of your script to be 100% sure your configuration is well taken care.
– Bsquare
Nov 13 '18 at 13:48
Not a valid answer, see my comment.
– mark
Nov 13 '18 at 14:28
add a comment |
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!
Well, give @mark some props then.
– Mary
Nov 14 '18 at 9:38
cakephp now composer based. not sure about Http Client Class, but in several another http client libraries changing of timeout is normal and not lead to any issues. For example you can use docs.guzzlephp.org/en/stable/overview.html#installation docs.guzzlephp.org/en/stable/…
– Vadim
Nov 14 '18 at 14:12
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53281380%2fcakephp-3-shell-script-increase-execution-timeout-limit%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
Ensure you are looking to the good configuration file, of the PHP your are using, thanks to this command:
php -ini |grep "php.ini"
Thanks for the reply @Bsquare. My localhost is using /cli php.ini. But I already tried to change the 'max_execution_time' in /cli/php.ini, restarted the service, but no success.
– hilton22
Nov 13 '18 at 13:25
It is strange, Try putting this instruction at beginning of your script to be 100% sure your configuration is well taken care.
– Bsquare
Nov 13 '18 at 13:48
Not a valid answer, see my comment.
– mark
Nov 13 '18 at 14:28
add a comment |
Ensure you are looking to the good configuration file, of the PHP your are using, thanks to this command:
php -ini |grep "php.ini"
Thanks for the reply @Bsquare. My localhost is using /cli php.ini. But I already tried to change the 'max_execution_time' in /cli/php.ini, restarted the service, but no success.
– hilton22
Nov 13 '18 at 13:25
It is strange, Try putting this instruction at beginning of your script to be 100% sure your configuration is well taken care.
– Bsquare
Nov 13 '18 at 13:48
Not a valid answer, see my comment.
– mark
Nov 13 '18 at 14:28
add a comment |
Ensure you are looking to the good configuration file, of the PHP your are using, thanks to this command:
php -ini |grep "php.ini"
Ensure you are looking to the good configuration file, of the PHP your are using, thanks to this command:
php -ini |grep "php.ini"
answered Nov 13 '18 at 13:02
BsquareBsquare
3,35141134
3,35141134
Thanks for the reply @Bsquare. My localhost is using /cli php.ini. But I already tried to change the 'max_execution_time' in /cli/php.ini, restarted the service, but no success.
– hilton22
Nov 13 '18 at 13:25
It is strange, Try putting this instruction at beginning of your script to be 100% sure your configuration is well taken care.
– Bsquare
Nov 13 '18 at 13:48
Not a valid answer, see my comment.
– mark
Nov 13 '18 at 14:28
add a comment |
Thanks for the reply @Bsquare. My localhost is using /cli php.ini. But I already tried to change the 'max_execution_time' in /cli/php.ini, restarted the service, but no success.
– hilton22
Nov 13 '18 at 13:25
It is strange, Try putting this instruction at beginning of your script to be 100% sure your configuration is well taken care.
– Bsquare
Nov 13 '18 at 13:48
Not a valid answer, see my comment.
– mark
Nov 13 '18 at 14:28
Thanks for the reply @Bsquare. My localhost is using /cli php.ini. But I already tried to change the 'max_execution_time' in /cli/php.ini, restarted the service, but no success.
– hilton22
Nov 13 '18 at 13:25
Thanks for the reply @Bsquare. My localhost is using /cli php.ini. But I already tried to change the 'max_execution_time' in /cli/php.ini, restarted the service, but no success.
– hilton22
Nov 13 '18 at 13:25
It is strange, Try putting this instruction at beginning of your script to be 100% sure your configuration is well taken care.
– Bsquare
Nov 13 '18 at 13:48
It is strange, Try putting this instruction at beginning of your script to be 100% sure your configuration is well taken care.
– Bsquare
Nov 13 '18 at 13:48
Not a valid answer, see my comment.
– mark
Nov 13 '18 at 14:28
Not a valid answer, see my comment.
– mark
Nov 13 '18 at 14:28
add a comment |
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!
Well, give @mark some props then.
– Mary
Nov 14 '18 at 9:38
cakephp now composer based. not sure about Http Client Class, but in several another http client libraries changing of timeout is normal and not lead to any issues. For example you can use docs.guzzlephp.org/en/stable/overview.html#installation docs.guzzlephp.org/en/stable/…
– Vadim
Nov 14 '18 at 14:12
add a comment |
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!
Well, give @mark some props then.
– Mary
Nov 14 '18 at 9:38
cakephp now composer based. not sure about Http Client Class, but in several another http client libraries changing of timeout is normal and not lead to any issues. For example you can use docs.guzzlephp.org/en/stable/overview.html#installation docs.guzzlephp.org/en/stable/…
– Vadim
Nov 14 '18 at 14:12
add a comment |
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!
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!
answered Nov 13 '18 at 18:12
hilton22hilton22
12
12
Well, give @mark some props then.
– Mary
Nov 14 '18 at 9:38
cakephp now composer based. not sure about Http Client Class, but in several another http client libraries changing of timeout is normal and not lead to any issues. For example you can use docs.guzzlephp.org/en/stable/overview.html#installation docs.guzzlephp.org/en/stable/…
– Vadim
Nov 14 '18 at 14:12
add a comment |
Well, give @mark some props then.
– Mary
Nov 14 '18 at 9:38
cakephp now composer based. not sure about Http Client Class, but in several another http client libraries changing of timeout is normal and not lead to any issues. For example you can use docs.guzzlephp.org/en/stable/overview.html#installation docs.guzzlephp.org/en/stable/…
– Vadim
Nov 14 '18 at 14:12
Well, give @mark some props then.
– Mary
Nov 14 '18 at 9:38
Well, give @mark some props then.
– Mary
Nov 14 '18 at 9:38
cakephp now composer based. not sure about Http Client Class, but in several another http client libraries changing of timeout is normal and not lead to any issues. For example you can use docs.guzzlephp.org/en/stable/overview.html#installation docs.guzzlephp.org/en/stable/…
– Vadim
Nov 14 '18 at 14:12
cakephp now composer based. not sure about Http Client Class, but in several another http client libraries changing of timeout is normal and not lead to any issues. For example you can use docs.guzzlephp.org/en/stable/overview.html#installation docs.guzzlephp.org/en/stable/…
– Vadim
Nov 14 '18 at 14:12
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53281380%2fcakephp-3-shell-script-increase-execution-timeout-limit%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
You are confusing PHP timeout with object and webservice timeout. PHP timeout is 0 by default in CLI. The problem is the timeout of the webservice and the connection to this one (Client object etc). Those timeouts are hard to change (can be raised a bit but will result in flaky behavior). You should make sure you never do requests to webservices beyond a few seconds!
– mark
Nov 13 '18 at 14:28
Thanks @mark for the clarification. I'm in touch with the webservice developer to improve API performance. Using Postman for testing, the response takes an average of 46 to 50 seconds to retrieve the data.
– hilton22
Nov 13 '18 at 15:32
How exactly do you make call to webservice? please, provide more details
– Vadim
Nov 14 '18 at 4:35