What are the standard variables that need to be passed to the PHP interpreter in a CGI version?

When running PHP scripts in a CGI version, certain standard variables need to be passed to the PHP interpreter for the script to execute correctly. These variables include REQUEST_METHOD, SCRIPT_FILENAME, QUERY_STRING, CONTENT_TYPE, CONTENT_LENGTH, and others. Without passing these variables, the PHP script may not function as expected.

<?php
// Standard variables to pass to the PHP interpreter in CGI version
putenv('REQUEST_METHOD=GET');
putenv('SCRIPT_FILENAME=/path/to/your/php/script.php');
putenv('QUERY_STRING=');
putenv('CONTENT_TYPE=');
putenv('CONTENT_LENGTH=');

// Your PHP script code here
?>