Win下配置Apache2,PHP5,MYSQL5,Zend_PHP
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! 测试成功!

What’s still popular is the ease of use, flexibility and a strong ecosystem. 1) Ease of use and simple syntax make it the first choice for beginners. 2) Closely integrated with web development, excellent interaction with HTTP requests and database. 3) The huge ecosystem provides a wealth of tools and libraries. 4) Active community and open source nature adapts them to new needs and technology trends.

PHP and Python are both high-level programming languages that are widely used in web development, data processing and automation tasks. 1.PHP is often used to build dynamic websites and content management systems, while Python is often used to build web frameworks and data science. 2.PHP uses echo to output content, Python uses print. 3. Both support object-oriented programming, but the syntax and keywords are different. 4. PHP supports weak type conversion, while Python is more stringent. 5. PHP performance optimization includes using OPcache and asynchronous programming, while Python uses cProfile and asynchronous programming.

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 originated in 1994 and was developed by RasmusLerdorf. It was originally used to track website visitors and gradually evolved into a server-side scripting language and was widely used in web development. Python was developed by Guidovan Rossum in the late 1980s and was first released in 1991. It emphasizes code readability and simplicity, and is suitable for scientific computing, data analysis and other fields.

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.

PHP remains important in the modernization process because it supports a large number of websites and applications and adapts to development needs through frameworks. 1.PHP7 improves performance and introduces new features. 2. Modern frameworks such as Laravel, Symfony and CodeIgniter simplify development and improve code quality. 3. Performance optimization and best practices further improve application efficiency.

PHPhassignificantlyimpactedwebdevelopmentandextendsbeyondit.1)ItpowersmajorplatformslikeWordPressandexcelsindatabaseinteractions.2)PHP'sadaptabilityallowsittoscaleforlargeapplicationsusingframeworkslikeLaravel.3)Beyondweb,PHPisusedincommand-linescrip

PHP type prompts to improve code quality and readability. 1) Scalar type tips: Since PHP7.0, basic data types are allowed to be specified in function parameters, such as int, float, etc. 2) Return type prompt: Ensure the consistency of the function return value type. 3) Union type prompt: Since PHP8.0, multiple types are allowed to be specified in function parameters or return values. 4) Nullable type prompt: Allows to include null values and handle functions that may return null values.


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Dreamweaver Mac version
Visual web development tools

WebStorm Mac version
Useful JavaScript development tools

Zend Studio 13.0.1
Powerful PHP integrated development environment