Home  >  Article  >  Backend Development  >  The purest Apache 2 && PHP 5 && Mys_PHP tutorial

The purest Apache 2 && PHP 5 && Mys_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 17:33:43725browse

前期准备:

Windows XP SP2 (其实系统只要是 98 以上都可以遵循这样的方法我认为)
apache(Unix平台最流行的WEB服务器平台) 2本例中我选用了 2.2.2 for Win32 ……)
http://archive.apache(Unix平台最流行的WEB服务器平台).org/dist/httpd/

php(做为现在的主流开发语言) 5 (虽然版本数有点不吉利…… 但我还是毅然选择了 5.1.4 for Win32 Zip 版……)
http://www.php(做为现在的主流开发语言).net/downloads.php(做为现在的主流开发语言)
 
MySQL(和PHP搭配之最佳组合) 5 (5.1 尚不稳定…… 我们姑且还是选择 MySQL(和PHP搭配之最佳组合) 5.0.22 for Win32 Zip 版……)
http://www.MySQL(和PHP搭配之最佳组合).com/

本方案并不涉及系统文件夹…… 所以我们大可选择其它分区的某个文件夹来方便日后的伺服器维护…… 本为以 X:Server 为例…… 注意:文件夹名称最好不要包含空格或其它非英文字符…… 否则某些情况下容易造成伺服器崩溃……

========================================
安装 apache(Unix平台最流行的WEB服务器平台)

运行 apache(Unix平台最流行的WEB服务器平台)_2.2.2-win32-x86-no_ssl.msi …… 一路 Next 下来…… 到选择安装方式的时候,选择 “Custom” 自定义方式…… 然后 Next 选择安装路径…… 定位到 X:Serverapache(Unix平台最流行的WEB服务器平台) (当然,你选择其它路径也可以,甚至选择 Complete 安装都没问题…… 我只是习惯讲所有服伺服器相关软体集中到一起而已)
本来不准备写 iis(微软的WEB服务器平台) 与 apache(Unix平台最流行的WEB服务器平台) 的共存配置…… 想一想还是带一笔吧…… 提示填写 Server Information 时…… 最下方会让你选择端口…… 如果你安装了 iis(微软的WEB服务器平台) 伺服器…… 这里就选择第二项 “only for the current user, on Port 8080, when started manually.”…… 也就是说 apache(Unix平台最流行的WEB服务器平台) 将占用 8080 端口…… 如果你没安装 iis(微软的WEB服务器平台) …… 无视之……
继续 Next …… 弹出几个 CMD 窗口安装 Windows 服务以后…… 安装就完成了…… 右下角将出现 apache(Unix平台最流行的WEB服务器平台) 粉红色的羽毛 Icon,不出意外图标上应该显示绿灯(表示 HTTP 伺服已经正常启动)…… 你可以访问 http://www.quchao.com/ 来试试,如果屏幕出现 “It Works” 就表示安装成功…… (我记得以前的版本不是这样的,而是一个挺花哨的页面…… 所以只要不出现找不到页面的提示…… apache(Unix平台最流行的WEB服务器平台) 伺服就安装成功了)当然了…… 如果亮起红灯…… 配置肯定错误…… 回头查查吧……
apache(Unix平台最流行的WEB服务器平台) 伺服器就安装完毕了……

=======================================
安装 php(做为现在的主流开发语言) :

解压 php(做为现在的主流开发语言)-5.1.4-Win32.zip …… 并放置到 X:Serverphp(做为现在的主流开发语言) 之下……
接下来为 php(做为现在的主流开发语言) 的安装目录添加环境变量…… 在我的电脑图标上点击滑鼠右键…… 查看‘属性’…… 然后切换到‘高级’选项卡…… 点击‘环境变量’按钮(快捷键:Alt+N)…… 在弹出的‘系统变量’域中找到‘Path’变量…… 双击编辑并在变量值的最后添加 ‘;X:Serverphp(做为现在的主流开发语言)’ (注意有个分号,用来分隔之前的值)……
重启电脑…… 为啥? 让环境变量生效呗……
至此 php(做为现在的主流开发语言) 就安装完毕了…… 当然,现在还未与 apache(Unix平台最流行的WEB服务器平台) 关联…… 而且未作任何设置…… 不要急…… 后面我会写……

=======================================
配置 apache(Unix平台最流行的WEB服务器平台)

A particularly important step: If you, like me, have chosen the latest PHP (as the current mainstream development language) Stable version 5.1.4... The modules in the official downloaded source code package It supports php(as the current mainstream development language)5apache(the most popular WEB server platform on the Unix platform)2.dll is not suitable for apache(the most popular Unix platform) Popular WEB server platform) 2.2.2... It is found that php (as the current mainstream development language) needs to be recompiled ... However, php (as the current mainstream development language) Language)5 The research laboratory provides a solution:
Download this compressed package (http://www.php(as the current mainstream development language)v.net/php(As the current mainstream development language)5apache(The most popular WEB server platform on the Unix platform)2.dll-php(As the current mainstream development language) 5.1.x.rar)... After unzipping, throw php(as the current mainstream development language)5apache(the most popular WEB server platform on Unix platform)2.dll into X :Serverphp(as the current mainstream development language) Overwrite the original file... Throw httpd.exe.manifest into X:Serverapache(The most popular WEB server platform on Unix platform)Bin Folder... Finally run vcredist_x86.exe (if you have .Net FrameWork installed, you do not need to install this file)...
Of course, you can skip this step if you choose an older version.
Let’s start modifying apache(The most popular WEB server platform on the Unix platform) Configuration file: X:/Server/apache(The most popular WEB server platform on the Unix platform)/conf /httpd.conf
Modify the document publishing path...
Search for:
DocumentRoot "X:/Server/apache(The most popular WEB server platform on Unix platform)/htdocs"
Change the value to the publishing path you want, for example:
DocumentRoot “X:/Server/WWW”
Then there is one more thing that needs to be modified... Otherwise, you will not have access...
Search:
Directory “X:/Server/apache(The most popular WEB server platform on Unix platform)/htdocs”
Modified to:
Directory “X:/Server/WWW”
Modify the default script:
Search:
DirectoryIndex index.html
Add the default script name you want, separated by spaces, pay attention to the precedence order, for example:
DirectoryIndex index.php(as the current mainstream development language) index.html index.htm
Configuration for php(as the current mainstream development language) 5:
at the end of the document Add the following characters below:
# Call php (as the current mainstream development language) 5 module
LoadModule php (as the current mainstream development language) 5_module “ X:/Server/php(as the current mainstream development language)/php(as the current mainstream development language)5apache(the most popular WEB server on the Unix platform Platform)2.dll”
# Add Mime type... You can also modify the mime.types file
AddType application/x-httpd-php(as the current mainstream development language) .php(as the current mainstream development language)
AddType application/x-httpd-php(as the current mainstream development language)-source .php(as the current mainstream development language)s
# Add the default character set... utf8 is the way to go...
AddDefaultCharset UTF8
# Set up php(as the current mainstream Development language).ini Directory
php(as the current mainstream development language)IniDir “X:/Server/php(as the current mainstream development language)
At this point, apache(the most popular WEB server platform on the Unix platform) can already support php(as the current mainstream development language)... Of course... This article It only introduces how to perform basic installation... Detailed configuration and optimization will not be involved... You can refer to the manual for configuration...
www.knowsky.com
============ ===========================
Install MySQL(The best combination with PHP)

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/508551.htmlTechArticlePreliminary preparation: Windows XP SP2 (In fact, as long as the system is 98 or above, I think this method can be followed) apache ( The most popular WEB server platform on the Unix platform) 2 In this example I chose...
Statement:
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