If you are running this script in CGI mode(* The Locaweb only allows the execution of these methods in CGI mode), you can use the exec function of php
I couldn’t find anything in Locaweb about the exec function, but I found it on the shell_exec function that serves to execute shell commands:
http://wiki.locaweb.com.br/pt-br/Como_utilizar_a_fun%C3%A7%C3%A3o_PHP_shell_exec()
I don’t know exactly what you want to do but it is worth a reservation if your idea is to perform processing in parallel.
PHP supports threads, so if this is your idea take a look at the doc:
http://php.net/manual/en/intro.pthreads.php
Another option if this runs on the command line and is synchronous, you can subdivide this script into smaller scripts and use redirect via Pipes:
ex: script1.php, script2.php, script3.php
Would run on the command line something like this here:
php script1.php | php script2.php | php script3.php
I hope I’ve helped.
Use
include
orrequire
to make sure you’re going to shoot once just use_once
example:include_once
– Leonardo
Cannot be used include or require. The idea is to "shoot" a script in parallel and not include it in the current script.
– Bertonni Magnus
Include this information in the question then, and all other relevant details (for example, what is your concept of "shooting a script"), otherwise staff may waste time answering things that will not suit you.
– Bacco
Actually, I’m running a script that runs a long list of tasks. The intention is, at the end of each task, to update a dialogue with written information about the progress (whether each stage was successful or not). This information about the progress, brings to the user, accurate information about what is happening (rather than just a gauge showing the percentage of execution).
– Bertonni Magnus
Colleagues need to pay more attention when a question is SPECIFIC or CONCEPTUAL. Examples: 1) Is it possible to open a text file in PHP? (this is a CONCEPTUAL question (no source code required) -> Just provide some links or snippets of code. 2) My Submit button is not working, what should I do? (this is a specific question and requires the user to display their source code)
– Bertonni Magnus
First of all, the question must be addressed carefully. In my question, I wouldn’t even need to show a pseudo-code, because it’s a CONCEPTUAL question.
– Bertonni Magnus
Yes. But say you want to run another script in parallel is essential. It would be good also to clarify what I meant by "parallel" in the comment.
– bfavaretto
I mentioned this in the code: //*** Here I need to restart the script: test.php Just read.
– Bertonni Magnus