Home > Article > Backend Development > Apache Php MySQL configuration steps under windows8.1, windows8.1apache_PHP tutorial
Software version:
apache:Apache 2.4.6 Win64
PHP: PHP 5.5 VC11 x64 Non Thread Safe
MySql:5.5 win64
Mysql installation:
Double-click to run and set the username, password, and encoding (utf8).
PHP configuration:
1. Unzip the downloaded zip file to a directory, in this tutorial: D:serverphp
2. Copy the file php.ini-development and rename it to php.ini;
3. Search for the keyword php_mysqli.dll in the php.ini file, remove the ";" in front of the line, and enable the mysql extension (using the mysql database);
4. Search for the keyword extension_dir and change it to: extension_dir = "D:/server/php/ext" (depending on the specific directory);
5. Modify in order
Support session:session.save_path = "D:/service/temp" Note: Create the folder first and have write permission (otherwise, cross-page session will be lost) ).
Upload file directory configuration: upload_tmp_dir = "D:/service/temp"
Time zone configuration: date.timezone =Asia/Shanghai
apache configuration:
1. Unzip the downloaded zip file to the server folder on drive D :D:serverApache24
2. For the httpd.conf file in the conf directory, locate the LoadModule and add it after it. The directory will be modified depending on the specific php directory.
LoadModule php5_module "D:/server/php/php5apache2_4.dll" //phpfensi.com
PHPIniDir "D:/server/php"
3. Locate AddType and add after it:
AddType application/x-httpd-php.php
AddType application/x-httpd-php.html
Default home page setting: DirectoryIndex index.php index.html
4. If you want to modify the apache port, locate Listen 80, for example, change it to: Listen 8081
5. Install apache service.
Open a DOS window as an administrator. If you are not an administrator, an error will be reported. For win8 and win8.1 systems, you can press C on the start page to search. First: Command prompt, right-click and select Run as administrator.
The default path of the command prompt is:
C:windowssystem32 . Assuming that you have placed the apache24 folder in the root directory of drive C according to the above steps, enter in the command prompt: cd c: apache24bin, press Enter to enter the bin folder, and then enter: httpd.exe -k install . (Of course, when starting | stopping | restarting, you need to use the -k parameter, that is, httpd.exe -k start |stop|restart. )
If the installation is successful, you can go to the bin in your apache directory and double-click ApacheMonitor.exe to manage the apache service.
Test configuration:
Browse http://localhost/index.html, (if the port has been modified, for example: http://localhost:8088/index.html in this tutorial) "It works!" is displayed, indicating apache Started successfully.
Create a new index.php file in the directory: C:Apache24htdocs, (apache default website directory),
cd739ad681178501952d2c59cda1aaa1
Browse: http://localhost/index.php. If the port has been modified, for example, in this tutorial it is: http://localhost:8088/index.php
Displaying the php version information page is
success:
To test the mysql connection, create a new file mysql.php in the directory just now, as follows:
<?php$connect=new mysqli("localhost","root","root","test");if(!$connect) echo "Mysql Connect Error!";else echo "mysql success";$connect->close();?>The page opens
mysql.php, if successful, output mysql success
The above are the steps to configure Apache Php MySQL under Windows 8.1. There may be some shortcomings. I hope you can add them.