Home > Backend Development > PHP Problem > win php installation tutorial

win php installation tutorial

藏色散人
Release: 2023-03-07 16:58:02
Original
3487 people have browsed it

win php installation method: first download php; then copy a copy of "php.ini-development" and rename it to "php.ini" and put it in the installation path; then load PHP in Apache; finally configure mysql is enough.

win php installation tutorial

The operating environment of this tutorial: Windows 7 system, PHP 7 version. This article is applicable to all brands of computers.

Recommended: "PHP Video Tutorial"

windows php installation

1. Download address

https://windows.php.net/download
Copy after login

2. Install and configure php

In the installation directory, copy a copy of php.ini-development and rename it to php.ini and put it in the installation path

Add

extension_dir = "c:\php\ext"
Copy after login
to the .ini file

c:\php is the php installation path

3. Load PHP in Apache

Open httpd.conf under conf in the apache installation directory

Add

LoadModule php7_module C:/php/php7apache2_4.dll
AddType application/x-httpd-php .php .html
PHPIniDir "c:\php"
Copy after login

Create a new file under the Apache installation path\htdocs: test.php and edit it:

<?php  phpinfo(); ?>
Copy after login

Open the apache service and type http://localhost/test.php in the browser. The page can display apache information

4. Configure mysql

Add a line in the php.ini extension section

extension=php_mysqli.dll
Copy after login

Edit in test.php:

<?php  $mysqli = mysqli_connect("localhost","root","pwd") or die("cannt connet"); ?>
Copy after login

apache service opens the mysql service and opens the browser Type http://localhost/test.php

and the password is correct. No information should be displayed. Fill in the wrong password

Warning: mysqli_connect(): (HY000/1045): Access denied for user &#39;root&#39;@&#39;localhost&#39; (using password: YES) in C:\httpd-2.4.34-win64-VC15\Apache24\htdocs\test.php on line 1
can not connet
Copy after login

The above is the detailed content of win php installation tutorial. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template