Home php教程 php手册 Win7 下如何配置PHP运行环境

Win7 下如何配置PHP运行环境

Jun 06, 2016 pm 07:56 PM
php win win7 how environment run Enter Configuration

欢迎进入Windows社区论坛,与300万技术人员互动交流 >>进入 这一步是是否要把mysql设置成windows的,一般选择设成服务,这样以后就可以通过服务中启动和关闭mysql数据库.下面的复选框也勾选上,这样,在cmd模式下,不必非到mysql的bin目录下执行命令.也就是把上下

欢迎进入Windows社区论坛,与300万技术人员互动交流 >>进入

 

    这一步是是否要把mysql设置成windows的,一般选择设成服务,这样以后就可以通过服务中启动和关闭mysql数据库.下面的复选框也勾选上,这样,在cmd模式下,不必非到mysql的bin目录下执行命令.也就是把上下2个勾都打上,中间默认-“next”

    这一步是设置mysql的超级用户密码,这个超级用户非常重要,对mysql拥有全部的权限,请设置好并牢记超级用户的密码,下面有个复选框是选择是否允许远程机器用root用户连接到你的mysql服务器上面,如果有这个需求,也请勾选.这里我们使用默认选择,在New root password和Confirm中输入密码.“next”

    点击“execute”进行配置,稍微等待一会,圆点上的勾全部打上,就代表配置完毕.

    2.修改配置:

    打开D:\WAMP\MySQL\my.ini

    设置datadir为D:/WAMP/MySQL/data/或你所要存放数据位置的目录即可.

    三、PHP安装

    版本解释:VC9 专门为IIS定值的脚本,使用Visual Studio 2008编译器编译,支持最新的微软组建,从而提高效率.

    VC6 是为了其他WEB服务软件提供的脚本如 Apache.

    Thread Safe 现成安全,之星时会进行线程 安全检查,以防止有心要求就启动新线程(Thread)的CGI执行方式而耗尽系统资源.

    Non Thread Safe是非线程安全,在执行时不进行线程(Thread)安全检查

    选择版本:PHP5.3(5.3.1)中VC6 x86 Thread Safe下 ZIP下载

    1.安装说明

    由于我们下载的的是ZIP压缩包,只需要将文件解压到“D:\WAMP\PHP”目录下即可

    2.修改配置

    将E:\WAMP\PHP\php.ini-development 文件修改成php.ini

    打开php.ini

    ; extension_dir = “ext”

    修改成:extension_dir = “E:\WAMP\PHP\ext”

    将947行下,这些文件前面的“;”去除

    extension=php_curl.dll

    extension=php_gd2.dll

    extension=php_mbstring.dll

    extension=php_mysql.dll

    extension=php_mysqli.dll

    extension=php_pdo_mysql.dll

    extension=php_xmlrpc.dll

    ;date.timezone =

    修改成(很多网站没提到这里要修改,默认为美国时间,如果不修改会报错):date.timezone = Asia/Shanghai

    3.测试

    重启Apache(修改过配置文件 必须重启Apache才会生效)

    新建个index.php 页面,代码中输入,保存文件放到“D:\WMAP\www\”目录下

    打开浏览器输入://localhost/index.php 如果能正常显示,说明PHP配置完毕,可以查看该页面的PHP信息是否正确.

    (注:在改文件中输入函数可输出大量的有关PHP当前状态的信息,如PHP版本,服务器信息和环境等.)

    (注:)

    接着我们测试下,是否能连接到Mysql

    再新建个link.php,下代码中输入

    $link=mysql_connect(“127.0.0.1″,”root“,”Mysql安装时填写的密码“);

    if(!$link) echo ”Mysql数据库连接失败!“;

    else echo ”Mysql数据库连接成功!“;

    mysql_close();

    ?>

    也保存文件放到”D:\WMAP\www\“目录下

    打开浏览器输入:localhost/link.php 查看

    四、PhpMyAdmin安装

    版本解释:phpMyAdmin-3.2.5

    选择版本:phpMyAdmin-3.2.5-all-languages.zip

    1.安装说明

    解压到D:\WAMP\phpMyAdmin

    2.修改配置

    打开D:\WAMP\phpMyAdmin\libraries\config.default.php

    $cfg['PmaAbsoluteUri'] = ”;

    修改成(填写访问phpMyAdmin的绝对URL):$cfg['PmaAbsoluteUri'] = '//localhost/PHPMyadmin/';

    $cfg['Servers'][$i]['host'] = 'localhost';

    修改成(填写服务器地址,通常默认,不需要修改):$cfg['Servers'][$i]['host'] = 'localhost';

    $cfg['Servers'][$i]['user'] = 'root';

    修改成(填写Mysql用户名,这里我们默认):$cfg['Servers'][$i]['user'] = 'root';

    $cfg['Servers'][$i]['password'] = “;

    修改成(填写Mysql密码):$cfg['Servers'][$i]['password'] = 'Mysql PWD;

    $cfg['Servers'][$i]['auth_type'] = 'cookie';

    修改成(设置认证方法,安全因素考虑,填写成cookie):$cfg['Servers'][$i]['auth_type'] = 'cookie';

    $cfg['blowfish_secret'] = ”;

    修改成(设置短语密码,如果上面设置成cookie,那这里不能留空,不然登陆会提示错误):$cfg['blowfish_secret'] = 'cookie';

    3.测试

    打开浏览器输入:localhost/phpmyadmin/ 访问和登陆

    五、结尾

    至此Windows7下的PHP环境搭建完毕,大家尽情的使用吧.

  [1] [2] 

Win7 下如何配置PHP运行环境

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 8.4 Installation and Upgrade guide for Ubuntu and Debian PHP 8.4 Installation and Upgrade guide for Ubuntu and Debian Dec 24, 2024 pm 04:42 PM

PHP 8.4 brings several new features, security improvements, and performance improvements with healthy amounts of feature deprecations and removals. This guide explains how to install PHP 8.4 or upgrade to PHP 8.4 on Ubuntu, Debian, or their derivati

7 PHP Functions I Regret I Didn't Know Before 7 PHP Functions I Regret I Didn't Know Before Nov 13, 2024 am 09:42 AM

If you are an experienced PHP developer, you might have the feeling that you’ve been there and done that already.You have developed a significant number of applications, debugged millions of lines of code, and tweaked a bunch of scripts to achieve op

How To Set Up Visual Studio Code (VS Code) for PHP Development How To Set Up Visual Studio Code (VS Code) for PHP Development Dec 20, 2024 am 11:31 AM

Visual Studio Code, also known as VS Code, is a free source code editor — or integrated development environment (IDE) — available for all major operating systems. With a large collection of extensions for many programming languages, VS Code can be c

Explain JSON Web Tokens (JWT) and their use case in PHP APIs. Explain JSON Web Tokens (JWT) and their use case in PHP APIs. Apr 05, 2025 am 12:04 AM

JWT is an open standard based on JSON, used to securely transmit information between parties, mainly for identity authentication and information exchange. 1. JWT consists of three parts: Header, Payload and Signature. 2. The working principle of JWT includes three steps: generating JWT, verifying JWT and parsing Payload. 3. When using JWT for authentication in PHP, JWT can be generated and verified, and user role and permission information can be included in advanced usage. 4. Common errors include signature verification failure, token expiration, and payload oversized. Debugging skills include using debugging tools and logging. 5. Performance optimization and best practices include using appropriate signature algorithms, setting validity periods reasonably,

PHP Program to Count Vowels in a String PHP Program to Count Vowels in a String Feb 07, 2025 pm 12:12 PM

A string is a sequence of characters, including letters, numbers, and symbols. This tutorial will learn how to calculate the number of vowels in a given string in PHP using different methods. The vowels in English are a, e, i, o, u, and they can be uppercase or lowercase. What is a vowel? Vowels are alphabetic characters that represent a specific pronunciation. There are five vowels in English, including uppercase and lowercase: a, e, i, o, u Example 1 Input: String = "Tutorialspoint" Output: 6 explain The vowels in the string "Tutorialspoint" are u, o, i, a, o, i. There are 6 yuan in total

How do you parse and process HTML/XML in PHP? How do you parse and process HTML/XML in PHP? Feb 07, 2025 am 11:57 AM

This tutorial demonstrates how to efficiently process XML documents using PHP. XML (eXtensible Markup Language) is a versatile text-based markup language designed for both human readability and machine parsing. It's commonly used for data storage an

Explain late static binding in PHP (static::). Explain late static binding in PHP (static::). Apr 03, 2025 am 12:04 AM

Static binding (static::) implements late static binding (LSB) in PHP, allowing calling classes to be referenced in static contexts rather than defining classes. 1) The parsing process is performed at runtime, 2) Look up the call class in the inheritance relationship, 3) It may bring performance overhead.

What are PHP magic methods (__construct, __destruct, __call, __get, __set, etc.) and provide use cases? What are PHP magic methods (__construct, __destruct, __call, __get, __set, etc.) and provide use cases? Apr 03, 2025 am 12:03 AM

What are the magic methods of PHP? PHP's magic methods include: 1.\_\_construct, used to initialize objects; 2.\_\_destruct, used to clean up resources; 3.\_\_call, handle non-existent method calls; 4.\_\_get, implement dynamic attribute access; 5.\_\_set, implement dynamic attribute settings. These methods are automatically called in certain situations, improving code flexibility and efficiency.

See all articles