you start a new project. This choice is definitive! The status bar of ExeOutput for PHP tells you whether you are working with a GUI or console application:
ExeOutput for PHP creates a single and stand-alone executable file: end users just launch the resulting EXE file. No PHP installation is required. All compiled files are automatically fed into the PHP runtime when requested.
By default, the index page script is executed at startup. You can define another command line in the PHP Settings => Main Setting page.
A console application cannot prompt for elevated rights: use an administrator command prompt to complete administrative tasks.
exo_get_resstring can be used to protect resource strings.
A lof of ExeOutput for PHP features are NOT handled by console applications: global variables, global protection (security), HEScript scripting...
Do not use
$_SERVER['DOCUMENT_ROOT'] because the $_SERVER variable is empty in a console application (not running on a server and it is not processing an HTTP request).
To get the full path to the EXE dir, use this code:
The following code was used to render the console app whose screenshot is available above.
<?php print ("Hello World from a console app made with ExeOutput for PHP!\n"); print (exo_get_protstring('str1')); fputs(STDOUT, "\nThe Amazing Favourite Colour Script\n"); fputs(STDOUT, "What is your favourite colour? "); $sometext = strtolower(trim(fgets(STDIN, 256))); fputs(STDOUT, "Your favourite colour is $sometext!\n\n"); ?>