Run a custom PHP script

Add your PHP script to the installdir/apache2/htdocs/ directory, then browse to it via the URL http://localhost/FILENAME.php, where FILENAME is the name of the PHP script.

For an example, refer to the section on using phpinfo.

NOTE: If your script file is named index.php, then you must access it using the URL http://localhost/index.php and not http://localhost. This is because the Apache server included in the AMP stack is configured to recognize both index.html and index.php files by default, but to give the included index.html file priority. To alter this behaviour, simply move the installdir/apache2/htdocs/index.html file to a different location.