1
I have a time consuming script that prevents the execution of other processes while it does not finish.
As a solution, I decided to create a file that runs it by the exec command (Mkt-start.php). Thus:
exec('php -f mkt-exec.php > mkt.log &');
& (and commercial) is for that file Mkt-exec.php run in the background, so that the browser does not wait for the end of the execution.
But the result of Mkt.log is itself Mkt.start.php and not the Mkt-exec.php, resulting in an infinite loop of plays.
When I execute the command by shell (php -f mkt-exec.php > mkt.log &
) works properly.
Does anyone know why this behavior?
Obs: The result is the same if you put the full file path and/or the full php path.
+1 by reply, edited and removed what was irrelevant and added links, what I find more strange is the safe_mode work, you must be using PHP5.3 or older yet, something extremely unusual these days, even more than php5.3 is no longer maintained, being in 5.6 and 7.1
– Guilherme Nascimento
Exactly. It’s a client whose server is old (PHP 5.4) and safe_mode came active. We’re used to 7.0. But the customer paid for the system and not for the upgrade (not for lack of offer on our part), so rsssss
– Szag-Ot
PHP 5.4 does not have
safe_mode
: http://php.net/manual/en/migration54.incompatible.php. See the first item Safe mode is no longer supported. Any Applications that rely on safe mode may need adjustment, in Terms of security., you must have more than one version of PHP.– Guilherme Nascimento