Is PHP 7.2 (CGI), for example add 2 simple script:
<?phpexec("su -s /bin/sh - user -c cd /var/www/user/data/www/example.com/ && /opt/php72/bin/php -q /var/www/user/data/www/example.com/sleep.php > /dev/null 2>&1 &");
cd /var/www/user/data/www/example.com/ && /opt/php72/bin/php-q /var/www/user/data/www/example.com/background.php
In the file background.php we run the command in the background, but the script hangs for 30 seconds, why is this happening?
In the documentation it says:
If you are going to use this function in a program running as a daemon, make sure that the standard function output directed to a file or another stream, otherwise PHP will hang until the end of program execution.
The problem with the environment? How it is adjusted? What am I doing wrong?