0

I am not very good with bash or shell script. I would like to know if what I want to do is possible.

I have a big request to do with PHP. Only when I launch it my server is in Timout (and I can't extend it). I had the idea to split the PHP requests in iterations. Every time I reload my page, my script iterates over a JSON file.

I want to know if I can use a script with a CRON to run my PHP file as long as it has iterations to perform. And if I can use a response from my PHP in my bash to stop the script when everything is finished?

I apologize for my English, thank you for your time. I have searched the web several times, but I can't find an answer to use a php file with a bash script with iterator.

Thanks in advance,

3
  • If it's just a timeout problem and your script would work, just run it from command line. php script.php Assuming you have a non-infinite loop in your script, it will automatically stop once it finishes everything Commented Mar 14, 2022 at 15:03
  • No timeout when using command line ? Commented Mar 21, 2022 at 17:13
  • No, timeout is only present when you're executing from a webserver. More info Commented Mar 22, 2022 at 0:57

1 Answer 1

0

Thank to Andrea Olivato :

If it's just a timeout problem and your script would work, just run it from command line. php script.php Assuming you have a non-infinite loop in your script, it will automatically stop once it finishes everything

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.