Windows Apache PHP environment setup method
- 2020-05-17 07:28:17
- OfStack
I often build php environment in Linux environment, and it is the first time in windows environment. It doesn't have any technical content, just record 1, so as to save me from having to look around next time.
Download address
http://windows.php.net/download/#php-5.5
http://www.apachelounge.com/download/
http://www.microsoft.com/zh-CN/download/details.aspx?id=30679
V11 is a Microsoft component. If you do not install it, you will be notified that msvcr110.dll is missing.
After downloading, install V11 and unzip Apache and PHP to the directory you want.
configuration
PHP configuration
PHP needs to configure environment variables. The; X: \ php; X:\php\ext added to PATH.
APACHE configuration
Modify X:\Apache24\conf\ httpd.conf file.
Need to be modified:
ServerRoot "X:\Apache24"
DocumentRoot "X:/Apache24/htdocs"
<Directory "X:/Apache24/htdocs">
Listen 8080
ServerName localhost:8080
Need to add:
# php5 support
LoadModule php5_module X:/php/php5apache2_4.dll
AddType application/x-httpd-php .php .html .htm
# configure the path to php.ini
PHPIniDir "X:/php"
Configure Apache, configure environment variables, install V11, and you may need to restart your computer for 1.
Start the Apache
X:\Apache24\bin\httpd.exe -k install/start/stop/restart
To verify whether the Apache server is set up successfully, directly enter 127.0.0.1:8080 in the address bar. If you can open the web page, it means that Apache is successful. Verify that PHP has been configured successfully. Create a new php file, such as php.php, and enter it
<?php phpinfo(); ?>
On X: \ Apache24 \ htdocs directory, and then use the browser open 127.0.0.1:8080 / php php.