How to populate SCRIPT_FILENAME and SCRIPT_PATH server vairables to php-cgi from the command line
问题 I'm trying to run cron php script from command line. The server does not have PHP CLI but php-cgi exists. I tried to pass PHP directly to php-cgi but this does not work because two server environment variables are missed ( $_SERVER['SCRIPT_FILENAME'] and $_SERVER['SCRIPT_PATH'] ). I tried to fill variables using following recommendation but these variables are not populated. What is missed in this answer? How to make php-cgi populate these server values? The question is not platform specific,