Home Backend Development PHP Tutorial Win下配置Apache2,PHP5,MYSQL5,Zend_PHP

Win下配置Apache2,PHP5,MYSQL5,Zend_PHP

Jun 01, 2016 pm 12:30 PM
mysql Install document Table of contents Configuration

ApacheZendOptimizer

Windows XP下全新安装Apache2,PHP5,MYSQL5,Zend的简单过程
  
  一、下载地址:
  
  Apache2.0.50 :http://httpd.apache.org/download.cgi
  PHP5.0.2 :http://cn2.php.net/get/php-5.0.2-Win32.zip/from/a/mirror
  MYSQL5.0.2:http://dev.mysql.com/downloads/mysql/5.0.html
  Zend2.5.2 :http://www.zend.com/store/free_download.php?pid=13]
  
  软件的安装偶就不说了,其中只有PHP下的是zip包,直接解压就可以了。
  
  安装顺序就是上面列出来的顺序,Zend我是最后等所有的运行都没问题后才装的。
  
  二、简单安装过程:
  
  (一)Apache:
  Apache2.0.50的安装很简单,我就直接把他装到了E盘根目录下(我C盘是系统盘,D盘是temp盘,偶发现在windows下单独拿个分区来做临时文件的存放地对系统的速度影响不小,这样做能提升系统运行的速度,感兴趣的朋友可以试试看),安装完后我的apache目录就是E:\apache2
  
  (二)PHP:
  我是直接解压缩放到E盘php目录下了,这样查找文件会方便许多。
  
  (三)Mysql:
  直接装到E:\mysql下,它的默认目录太长,是在C盘下的,偶的C盘是除windows的文件外别的一概不放的。
  
  (四)Zend:
  所有的调试都正常后我把Zend装到了E:\program files\zend下
  
  三、配置过程:
  
  (一)http.conf
  
  这个文件我改了几个地方:
  把PHP直接作为apache的一个模块运行,我在里面加了两句:
  
  CODE: [Copy to clipboard]
  LoadModule php5_module "E:/php/php5apache2.dll"
  AddType application/x-httpd-php .php
  
  我在E:\apache2目录下建立了一个www的目录用于存放我的站点文件,在http.conf里改了这样一句话:
  把DocumentRoot "E:/Apache2/htdocs"改成了DocumentRoot "E:/Apache2/www"
  
  Apache2.0.x于1.3.x相比2.0.x默认不能直接列目录,偶感觉不爽,就改了:
  把DocumentRoot "E:/Apache2/www"这句下的如下语句
  
  CODE: [Copy to clipboard]
  
  Options FollowSymLinks
  AllowOverride None
  
  改为:
  
  CODE: [Copy to clipboard]
  
  Options Indexes FollowSymLinks
  AllowOverride None
  
  把apache的默认字符设置为中文简体:
  AddDefaultCharset GB2312
  
  修改目录的默认首页:
  DirectoryIndex 后面写上你想设置为首页的文件名,如:index.html index.php等
  
  别的就没再动什么地方
  
  注意一点的是,要使这些配置生效需要重新启动apache
  
  (二)php.ini
  
  以前用php4.x的时候觉得配置起来很简单,所以偶用PHP5也直接那么配了,谁知道完了mysql不能用,说是无法连接动态库,我仔细检查了一下 php_mysql.dll明明存在,可就说找不到,这点让我郁闷了N久,偶重新解压了php5也没用,后来在php的install文档里发现了这么一句话: php_mysql.dll MySQL functions PHP >= 5.0.0, requires libmysql.dll  (bundled)
  
  于是偶才找到了原因......
  
  配置php5.0.2是这样来过的:
  
  把php.ini-dist复制到C:\windows 下改名为 php.ini(装过php的都做过吧)
  
  然后修改了几个地方:
  extension_dir = "E:\php\ext" (指定动态连接库的目录,php5和php4不同的地方就是它的动态连接库目录变了,这在它的文档结构里有详细的说明)
  
  然后把下面几句前面的分号去掉
  ;extension=php_dba.dll
  ;extension=php_dbase.dll
  ;extension=php_filepro.dll
  ;extension=php_gd2.dll
  ;extension=php_imap.dll
  ;extension=php_mysql.dll
  
  接下来修改了一些文件上传以及内存使用最大限制:
  memory_limit = 20M
  post_max_size = 20M
  upload_max_filesize = 20M
  
  别的就没改什么了,这里修改过php.ini以后也要重新启动apache
  
  接下来一点很重要的就是把php目录下的 libmysql.dll 和 libmysqli.dll 复制到windows/system32下,如果不这样做,mysql动态连接库就无法正常加载。
  
  (三)Mysql和Zend的配置
  
  现在Apache和PHP都已经配置好了,在浏览器里输入localhost看看结果,运行成功,然后输入localhost/phpmyadmin看也成功。郁闷,Phpmyadmin提示错误信息:
  
  QUOTE:
  MySQL 返回:
  
  #1251 - Client does not support authentication protocol requested by server; consider upgrading MySQL client
  
  奇怪了,偶明明装的是MYSQL最新版本怎么会客户端版本过低呢,真是郁闷啊
  
  就此放了一下,经多次测试仍然不成功就先放弃了一下,玩了一把KOF97
  
  然后在CCF.熊猫和IM286.ceo的帮助下,终于找到了原因:
  
  落伍ceo:“升级客户端
  
  新版本的mysql使用了新的密码验证方法
  
  设置mysql密码时使用old_password可以解决这个问题”
  
  CCF.熊猫:“使用old_password”重新设定密码就可以了”。
  
  感谢这两位朋友,具体解决办法如下:
  
  由于偶不知道怎么升级client,因为在windows 下 server和client是捆绑安装的,我就用了old_password的方法:
  
  QUOTE:
  mysql> UPDATE mysql.user SET Password = OLD_PASSWORD('newpwd')
  -> WHERE Host = 'some_host' AND User = 'some_user';
  mysql> FLUSH PRIVILEGES;
  
  然后浏览“http://localhost/phpmyadmin”,OH YEAH! 测试成功!
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 Article

Roblox: Bubble Gum Simulator Infinity - How To Get And Use Royal Keys
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Nordhold: Fusion System, Explained
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Mandragora: Whispers Of The Witch Tree - How To Unlock The Grappling Hook
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

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)

Hot Topics

Java Tutorial
1665
14
PHP Tutorial
1269
29
C# Tutorial
1249
24
Laravel Introduction Example Laravel Introduction Example Apr 18, 2025 pm 12:45 PM

Laravel is a PHP framework for easy building of web applications. It provides a range of powerful features including: Installation: Install the Laravel CLI globally with Composer and create applications in the project directory. Routing: Define the relationship between the URL and the handler in routes/web.php. View: Create a view in resources/views to render the application's interface. Database Integration: Provides out-of-the-box integration with databases such as MySQL and uses migration to create and modify tables. Model and Controller: The model represents the database entity and the controller processes HTTP requests.

MySQL and phpMyAdmin: Core Features and Functions MySQL and phpMyAdmin: Core Features and Functions Apr 22, 2025 am 12:12 AM

MySQL and phpMyAdmin are powerful database management tools. 1) MySQL is used to create databases and tables, and to execute DML and SQL queries. 2) phpMyAdmin provides an intuitive interface for database management, table structure management, data operations and user permission management.

MySQL vs. Other Programming Languages: A Comparison MySQL vs. Other Programming Languages: A Comparison Apr 19, 2025 am 12:22 AM

Compared with other programming languages, MySQL is mainly used to store and manage data, while other languages ​​such as Python, Java, and C are used for logical processing and application development. MySQL is known for its high performance, scalability and cross-platform support, suitable for data management needs, while other languages ​​have advantages in their respective fields such as data analytics, enterprise applications, and system programming.

Solve database connection problem: a practical case of using minii/db library Solve database connection problem: a practical case of using minii/db library Apr 18, 2025 am 07:09 AM

I encountered a tricky problem when developing a small application: the need to quickly integrate a lightweight database operation library. After trying multiple libraries, I found that they either have too much functionality or are not very compatible. Eventually, I found minii/db, a simplified version based on Yii2 that solved my problem perfectly.

Laravel framework installation method Laravel framework installation method Apr 18, 2025 pm 12:54 PM

Article summary: This article provides detailed step-by-step instructions to guide readers on how to easily install the Laravel framework. Laravel is a powerful PHP framework that speeds up the development process of web applications. This tutorial covers the installation process from system requirements to configuring databases and setting up routing. By following these steps, readers can quickly and efficiently lay a solid foundation for their Laravel project.

Solve MySQL mode problem: The experience of using the TheliaMySQLModesChecker module Solve MySQL mode problem: The experience of using the TheliaMySQLModesChecker module Apr 18, 2025 am 08:42 AM

When developing an e-commerce website using Thelia, I encountered a tricky problem: MySQL mode is not set properly, causing some features to not function properly. After some exploration, I found a module called TheliaMySQLModesChecker, which is able to automatically fix the MySQL pattern required by Thelia, completely solving my troubles.

MySQL: Structured Data and Relational Databases MySQL: Structured Data and Relational Databases Apr 18, 2025 am 12:22 AM

MySQL efficiently manages structured data through table structure and SQL query, and implements inter-table relationships through foreign keys. 1. Define the data format and type when creating a table. 2. Use foreign keys to establish relationships between tables. 3. Improve performance through indexing and query optimization. 4. Regularly backup and monitor databases to ensure data security and performance optimization.

MySQL: Key Features and Capabilities Explained MySQL: Key Features and Capabilities Explained Apr 18, 2025 am 12:17 AM

MySQL is an open source relational database management system that is widely used in Web development. Its key features include: 1. Supports multiple storage engines, such as InnoDB and MyISAM, suitable for different scenarios; 2. Provides master-slave replication functions to facilitate load balancing and data backup; 3. Improve query efficiency through query optimization and index use.

See all articles