I have two PHP scripts.
The first PHP script is specifically a command-line only script that is to be run on the server only at all times. It will check the argv and argc server variables to ensure this is the case.
Script 2 is one that an adminstrator can access remotely in a web browser.
Script 2 calls on script 1 asynchronously so script 1 can do processing while Script 2 periodically updates the administrator on the work progress.
The way Script 2 currently does this is with PHP shell_exec (with passing parameters in) but websites like https://loadforge.com/guides/disable-dangerous-php-functions-for-enhanced-security claim that’s a dangerous command to make available to those external people authorized to upload files to the server (especially if the file is a malicious CMS).
Is there a way I can call a PHP script with command-line parameters without using shell_exec or any other dangerous function where that script can see values for the environment variables argv and argc?
I tried pcntl_fork but that did not help at all.