First, Apache
Because the Apache website only provides source code, if you want to use it must be compiled yourself, here I choose the third party installation package Apache Lounge.
Apache has a path by default: "c:\Apache24" (the version number may be different). If not, you need to open the apach\conf\httpd.conf configuration file, which will have all the "c:\Apache24", "c:\Apache24\htdocs" and " c:\Apache24\cgi-bin\"Change to the corresponding path.
Specify IP and port: Find "ServerName www.example.com:80" in httpd.conf, remove the previous comment, and modify "www.example.com" to "localhost "。 If you want to modify the port, the "80" here and the previous "listen:80" in the 801 changes.
Second, PHP
Go to php download address http://windows.php.net/download Download the latest thread-safe PHP Zip package and place it under the path you want to install. Note: The downloaded PHP VC version can not be higher than the previously installed VC Redist version.
Go to the PHP installation directory, copy a php.ini-development renamed php.ini to the installation path, open find "extension_dir", remove the comment, change the value to "PHP installation path \ext "
Open the Apache configuration file conf\httpd.conf, locate the LoadModule zone, and then add:
LoadModule php7_module "PHP installation path \php7apache2_4.dll" # Loading PHP as a module in Apache, " Php7_module"7" in the version corresponding to PHP, in addition, different versions of PHP "php7apache2_4.dll" may be different.
Phpinidir "PHP installation path " #告诉Apache the installation path of PHP
find AddType application/x-gzip. gz. tgz, adding code on its next line: addtype application/x-httpd-php. php. HTML: Declares . php and. html files can execute PHP programs.
Test: New file under Apache installation path \htdocs: test.php, Inside Editor: <?php phpinfo ();?;, start Apache, enter in browser:localhost:80/test.php .
Third, MySQL
Description: Different PHP versions may provide different connection mysq assemblies, go to the Ext folder to see what PHP is offering here and what to write. Different assemblies may be used differently when connecting to a database.
Test: Edited in test.php: <?php $mysqli = mysqli_connect ("localhost", "root", "pwd") or Die (" Cannt connet");, start the database, restart Apache, view it on the browser side, and configure it correctly if there is no error message.