Test PHP locally with Apache Web Server

Tips submitted by PHPMaker users
Post Reply
arbei
User
Posts: 9284

Test PHP locally with Apache Web Server

Post by arbei »

To test PHP locally, use Apache web server which is much faster than IIS.

If you have not installed Apache yet, you may try XAMPP which is a free Apache distribution with MariaDB (a fork of the MySQL) and PHP.

After installation, if you want to change the document root of the default website, edit the Apache httpd.conf (in the XAMPP Control Panel, under Apache module, click Config button, select Apache (httpd.conf)) and change the DocumentRoot directive.

For example, change:

DocumentRoot "D:/xampp/htdocs"
<Directory "D:/xampp/htdocs">
...
</Directory>

to:

DocumentRoot "D:/MyTestSite"
<Directory "D:/MyTestSite">
...
</Directory>

Then restart the Apache server (in the XAMPP Control Panel, under Apache module, click Stop and then Start).

To change the settings for the directory (the document root), find <Directory "your document root"> in httpd.conf and change your settings, see <Directory> directive.


Post Reply