*/
$ Version = apache_get_version (); // Obtain the apache version and assign it to the variable
Echo "$ version"; // output result
$ Server_ip = apache_getenv ("server_addr"); // Obtain the server ip address through the environment variable function.
Echo $ server_ip; // output result
$ Url_info = apache_lookup_uri ('2-1. php Tutorial '); // execute a request on the url and return information
Print_r ($ rul_info); // output result content
If (file_exists ($ rul_info-> filename) // if the returned result has a value
{
Echo 'file exists! '; // Output the corresponding content
}
Apache_note ("name", "Heaven wins"); // Set the name value in the apache request record
Echo apache_note ("name"); // Obtain the name value in the apache request record.
$ Headers = apache_request_headers (); // Obtain the http request header
Foreach ($ headers as $ header => $ value) // output the result array through loop
{
Echo "$ header: $ value <br> n"; // output array key/value pair
}
$ Result = apache_get_modules (); // return the list of modules loaded by apache and assign values to the variables.
Print_r ($ result); // output result array
If (apache_setenv ("example_var", "test_value") // sets the environment variable
{
Echo "the apache environment variable example_var is set successfully! "; // If the output content is set successfully
}
Else
{
Echo "failed to set apache environment variable example_var! "; // Output content if the setting fails
}