Im having a problem with PHP where im trying to run commands for an embedded linux target. The code executes / works but after extended use im seeing the available memory drop and then loss of exec() functionality with the error_log reporting PHP Warning: exec(): Unable to fork [sudo /usr/bin/whoami........]
Apache is still serving web pages for clients and the mysql DB is still active. Restarting the Apache services restores exec() functionality. Ive tried websockets and this problem still occurs.
Im running PHP 5.6.31, Apache 2.4.27
The code im trying to run from a web browser is as follows..
Code: Select all
<?php exec("sudo /usr/bin/whoami", $outputArr, $returnVal); echo "returnVal(" . $returnVal . ") outputArr(" . implode("", $outputArr) . ")"; ?>
Thanking you in advance