Home Database Mysql Tutorial IIS+PHP+MYSQL环境配置

IIS+PHP+MYSQL环境配置

Jun 01, 2016 pm 01:11 PM
iis mysql php

首先下载php-5.2.0-win32.zip,mysql-noinstall-5.0.22-win32.zip和phpMyAdmin-2.9.1.1-all-languages.zip。这三个文件的下载地址可以在百度搜索得到。

相关mysql视频教程推荐:《mysql教程

一、安装php

    1) 在D盘新建一个名为PHP的文件夹,解压缩php-5.2.0-win32.zip到D:/PHP。

    2) 在D:/PHP文件夹下找到php.ini-dist文件,将其复制一份以做备份。将复制后的文件更名为php-ini。     

    3) 在php.ini文件中找到以下行:extension_dir = "./"(注:该行指定PHP查找扩展的位置),编辑该行,如下所示:

       extension_dir = "D:/PHP/ext"(注:不要这里用的是斜杠/而不是反斜杠/)。

    4) 在php.ini文件中找到以下行:;extension=php_mysql.dll(注:该行开始的分号指示PHP忽略该行),删除该行始的分号以启用扩展extension=php_mysql.dll;;extension=php_mbstring.dll 改成 extension=php_mbstring.dll  

    5) 保存并关闭php.ini文件;将修改好的php.ini文件复制到C:/Windows/文件夹下;

    6) 在D:/PHP/文件夹下找到名为php5ts.dll,libmysql.dll的文件,并将其复制到C:/windows/System32文件夹中 (注:IIS处理PHP 5和MYSQL需要该文件)。

至此,PHP安装完毕。

二、安装配置IIS

    1) 在控制面板中选择添加/删除程序,然后在弹出的对话框中选择添加/删除windows组件,勾中IIS即可。如果没有安装盘,可以去网下下一个从安装盘中抽取出来的iis包。安装完成后在C盘会有一个Inetpub的文件夹。

    2) 在管理工具中打开Internet 信息服务(IIS)管理器,或者在运行对话框中输入"inetmgr"(不包括引号)后确定。

    3) 在默认网站下新建虚拟目录,这里可以存放你的php文件。比如新建虚拟目录php指向电脑上的D:/phpamdin目录。在PHP文件夹上单击鼠标右键,选择"属性",依次点单击"虚拟目录"选项卡上的"配置",打开应用程序配置对话框。

    4) 在"映射"选项卡上点"添加",打开"添加/编辑应用程序扩展名映射"对话框,点击"可执行文件"后的"浏览",定位到D:/PHP/php5isapi.dll,在"扩展名"后的文本框内输入".php"(注:一定要注意扩展名前的句点),点击确定。

    5) 在文档选项卡中添加index.php做为默认文档。也可不添加。

    6) 再点"确定",退出"应用程序配置"对话框,再点"确定",退出PHP属性对话框。

至此,IIS配置完毕。

     某些配置可能需要重启服务器:cmd下使用:

      net stop w3svc
        net start w3svc
Copy after login

三、测试PHP安装

1) 在D:/phpamdin下,(该目录在配置IIS时设置了虚拟目录为php)新建记事本文件后打开,输入以下代码:

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

        将该段代码保存成version.php(后辍名必须为php)。   

    2) 打开浏览器,在地址栏里输入localhost/php/version.php,如果显示正常,则PHP安装成功。

四、安装MYSQL

    1)在D盘新建一个名为mysql的文件夹,解压缩下载下来的mysql-noinstall-5.0.22-win32.zip到D:/mysql。

    2)运行D:/mysql/bin下的mysqld-nt.exe,会有一个dos画面一闪而过。这样就启动了mysql服务。

    3)在命令行下切换目录到D:/mysql/bin,键入mysql -u root -p 回车,如果提示Enter password: 则表示mysql安装成功。默认是空密码。

五、安装PHPMyAdmin

    1)将下载的phpMyAdmin-2.9.1.1-all-languages.zip中的全部内容解压缩到配置IIS时建立的D:/phpadmin目录下。

    2)启动浏览器,确保IIS和Mysql服务都在运行,键入http://localhost/php/index.php即可看到phpMyAdmin的管理画面。

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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

PHP's Purpose: Building Dynamic Websites PHP's Purpose: Building Dynamic Websites Apr 15, 2025 am 12:18 AM

PHP is used to build dynamic websites, and its core functions include: 1. Generate dynamic content and generate web pages in real time by connecting with the database; 2. Process user interaction and form submissions, verify inputs and respond to operations; 3. Manage sessions and user authentication to provide a personalized experience; 4. Optimize performance and follow best practices to improve website efficiency and security.

PHP and Python: Different Paradigms Explained PHP and Python: Different Paradigms Explained Apr 18, 2025 am 12:26 AM

PHP is mainly procedural programming, but also supports object-oriented programming (OOP); Python supports a variety of paradigms, including OOP, functional and procedural programming. PHP is suitable for web development, and Python is suitable for a variety of applications such as data analysis and machine learning.

PHP and Python: Code Examples and Comparison PHP and Python: Code Examples and Comparison Apr 15, 2025 am 12:07 AM

PHP and Python have their own advantages and disadvantages, and the choice depends on project needs and personal preferences. 1.PHP is suitable for rapid development and maintenance of large-scale web applications. 2. Python dominates the field of data science and machine learning.

Why Use PHP? Advantages and Benefits Explained Why Use PHP? Advantages and Benefits Explained Apr 16, 2025 am 12:16 AM

The core benefits of PHP include ease of learning, strong web development support, rich libraries and frameworks, high performance and scalability, cross-platform compatibility, and cost-effectiveness. 1) Easy to learn and use, suitable for beginners; 2) Good integration with web servers and supports multiple databases; 3) Have powerful frameworks such as Laravel; 4) High performance can be achieved through optimization; 5) Support multiple operating systems; 6) Open source to reduce development costs.

PHP: Handling Databases and Server-Side Logic PHP: Handling Databases and Server-Side Logic Apr 15, 2025 am 12:15 AM

PHP uses MySQLi and PDO extensions to interact in database operations and server-side logic processing, and processes server-side logic through functions such as session management. 1) Use MySQLi or PDO to connect to the database and execute SQL queries. 2) Handle HTTP requests and user status through session management and other functions. 3) Use transactions to ensure the atomicity of database operations. 4) Prevent SQL injection, use exception handling and closing connections for debugging. 5) Optimize performance through indexing and cache, write highly readable code and perform error handling.

Choosing Between PHP and Python: A Guide Choosing Between PHP and Python: A Guide Apr 18, 2025 am 12:24 AM

PHP is suitable for web development and rapid prototyping, and Python is suitable for data science and machine learning. 1.PHP is used for dynamic web development, with simple syntax and suitable for rapid development. 2. Python has concise syntax, is suitable for multiple fields, and has a strong library ecosystem.

MySQL's Role: Databases in Web Applications MySQL's Role: Databases in Web Applications Apr 17, 2025 am 12:23 AM

The main role of MySQL in web applications is to store and manage data. 1.MySQL efficiently processes user information, product catalogs, transaction records and other data. 2. Through SQL query, developers can extract information from the database to generate dynamic content. 3.MySQL works based on the client-server model to ensure acceptable query speed.

How to start mysql by docker How to start mysql by docker Apr 15, 2025 pm 12:09 PM

The process of starting MySQL in Docker consists of the following steps: Pull the MySQL image to create and start the container, set the root user password, and map the port verification connection Create the database and the user grants all permissions to the database

See all articles