Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to install and configure PHP under win10

2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article introduces the relevant knowledge of "how to install and configure PHP under win10". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

Installation and configuration of PHP under window10

download

First of all, go to the official php website http://php.net/downloads.php to download, here we choose version 5.6 Windows downloads

Look at your own computer, it is 32-bit to choose X86, if it is a 64-bit operating system, choose X64, because it is a windows system, so choose the safe thread version of Thread Safe, here we choose a compressed file Zip to download.

Installation

After downloading, it is a compressed package and unzipped directly to the appropriate directory. Here I create a PHP folder on disk D and extract it into it, which means that the installation directory is D:\ PHP.

Configuration

Environment variable

The first step in installing the php service is to add environment variables

Right-click on this computer = > Properties = > Advanced system Settings = > Environment variable = > system variable = > path

If you are windows10, click New and add the D:\ PHP address to it. If it's windows7, just add lowercase; at the end, and then add the path.

Click OK all the way to complete the configuration of environment variables.

Consistent with the previous process of adding environment variables to Apache, so that you can see the information of php on the command line

Configuration file

Php is usually used with WEB server in windows environment. Here we use it with Apache. In this case, we need to modify the configuration file of Apache and find the configuration file of Apache:\ Apache24\ conf\ httpd.conf to open it.

/ / find the location of LoadModule, add modules to the PHP environment, LoadModule php5_module "D:/PHP/php5apache2_4.dll" PHPIniDir "D:/PHP/php.ini" / / find the location of AddType, add PHP support AddType application/x-httpd-php .php / / find here, add file type support, and put index.php in front of index.html DirectoryIndex index.php index.html

Careful students have found that the above D:/PHP/php.ini file is not in the PHP installation directory, which needs to be modified by ourselves. Rename the php.ini-development file under the root directory to php.ini, open it through the editing tool, and find the

Extension_dir = ". /"

Change it to the following:

Extension_dir = "D:/PHP/ext"

Pay attention to the semicolon in front of it; remove it and write in the top box without leaving a space. Then add the database extension, because we are using mysql, so modify the relevant line.

/ / remove the semicolon in front of here, extension=php_mysqli.dll//. Here is also the semicolon extension=php_pdo_mysql.dll in front of it.

Note that every time you modify the configuration file, you need to restart the service. The steps to restart the service are as follows: open the search cmd in the lower left corner, then run the command prompt as an administrator, and enter the command.

Httpd-k restart

Next, create a new php file index.php in the project path D:\ Apache24\ htdocs of Apache, which reads

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report