Home Backend Development PHP Tutorial windows下Apache2 php4 MySql5集成简明教程_PHP

windows下Apache2 php4 MySql5集成简明教程_PHP

Jun 01, 2016 pm 12:29 PM
apache d Down Install Tutorial integrated

Apache

fbysss
Blog:blog.csdn.net/fbysss
msn:
jameslastchina@hotmail.com
声明:本文章由fbysss原创,转载或引用请注明引用地址。
关键字:Apache,php,MySql
一、软件下载
1.到www.apache.org下载Apache2的安装文件
参考链接:http://mirror.apache.or.kr/httpd/binaries/win32/apache_2.0.55-win32-x86-no_ssl.exe
2.到www.php.net下载php4的zip包
参考链接:http://www.php.net/get/php-4.4.2-Win32.zip/from/a/mirror
说明:(1)php5已经比较稳定了,但是由于有很多php应用与php5兼容不够好,所以php4是一个比较好的选择。(2)php4有windows下的exe安装文件,但那个版本是一个微缩版,不够全,所以建议下载zip包,但需要手工安装。
3.到www.mysql.com下载MySql5
参考链接:http://dev.mysql.com/downloads/mysql/5.0.html
4.下载PhpMyAdmin,用于操作MySql
参考链接:http://count.skycn.com/softdownload.php?id=10687&url=http://gztt.driversky.com/down/phpMyAdmin-2.7.0.zip
二、安装配置
1. Apache和MySql的安装比较简单,跟一般windows程序安装没有多大区别,按照默认选项一步往下走即可,需要注意的一点是,最好把安装路径修改一下,不要太长,也不要有空格。比如安装Apache时选择d:\,这样安装后的Root是d:\Apache2。
MySql的安装路径可以写d:\mysql50;安装好了以后,进入d:\mysql50\bin,运行mysqld-nt --install将MySQL安装为系统服务。(mysqld-nt --remove是卸载服务)
安装好Apache2后,打开d:\Apache2\conf\httpd.conf,查找LoadModule,在所有LoadModule语句之后加入
#sss added (这句是注释)
LoadModule php4_module "d:/php4/php4apache2.dll"
AddType application/x-httpd-php .php
PHPIniDir "d:/php4"
然后保存退出。
2.至于php:
(1)解压zip包到d:\php4,然后把dlls和sapi目录中的dll都拷贝出来放到其父目录,即d:\php4下。
(2)把php.ini-dist(php默认设置)或者php.ini-recommended(php推荐设置)复制到\windows目录下(有的是winnt,视系统安装而定),然后改名为php.ini。
(3)把php4ts.dll复制到\windows\system32目录下。
(4)在环境变量中,把d\:php4加入系统变量的Path。(加在尾部,前面用分号隔开)
3.将PhpMyAdmin解压到d:\Apache2\htdocs\phpmyadmin。
四、运行服务
1.运行MySql:键入net start mysql即可(net stop mysql是停止服务)
2.运行Apache:点击开始菜单->程序->Apache HTTP Server 2.0.55->Control Apache Server->Monitor Apache Servers,会在任务栏右下角出现一个红色羽毛图标,点击右键Open Apache Monitor,然后点击start按钮,如果有配置不正确,会有弹出窗口提示错误。否则会在窗口左下区域看到The Apache2 server is starting字样。
五、测试效果
1.打开浏览器,输入http://localhost,正常会看到一个默认主页。
2.输入http://localhost/phpMyAdmin/index.php,正常会看到phpMyAdmin的主页。
注:如果端口号不是默认的80,而是8080,需要将localhost修改为localhost:8080。
六、写给新手
安装和配置甚至使用的步骤,往往在软件的文档中都已经写的很详细,虽然都是英文,但并不难懂,抓住关键词汇即可。我认为下载完一个好的习惯是首先阅读faq、readme、install等文档,然后再进行下一步。
如果软件的文档不够详细,可以到其官方网站,找相关技术论坛。国内也有很多很好的论坛,但学会阅读英文资料,我想对自己提高技术水平很有帮助。
补充:原来在Windows sp1下安装没有问题,SP2中启动mysql时发现一个1067代号的错误,解决办法如下:
在c:\windows下建立一个my.ini。输入以下内容:
[mysqld]
# set basedir to installation path, e.g., c:/mysql
basedir=D:/MySQL50

# set datadir to location of data directory,
datadir=D:/MySQL50/data

[WinMySQLadmin]
Server=D:/MySQL50/bin/mysqld-nt.exe
user=root
password=
保存退出。然后再运行服务,应该没有问题了。

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 尊渡假赌尊渡假赌尊渡假赌

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
1664
14
PHP Tutorial
1268
29
C# Tutorial
1248
24
How to set the cgi directory in apache How to set the cgi directory in apache Apr 13, 2025 pm 01:18 PM

To set up a CGI directory in Apache, you need to perform the following steps: Create a CGI directory such as "cgi-bin", and grant Apache write permissions. Add the "ScriptAlias" directive block in the Apache configuration file to map the CGI directory to the "/cgi-bin" URL. Restart Apache.

How to connect to the database of apache How to connect to the database of apache Apr 13, 2025 pm 01:03 PM

Apache connects to a database requires the following steps: Install the database driver. Configure the web.xml file to create a connection pool. Create a JDBC data source and specify the connection settings. Use the JDBC API to access the database from Java code, including getting connections, creating statements, binding parameters, executing queries or updates, and processing results.

How to view your apache version How to view your apache version Apr 13, 2025 pm 01:15 PM

There are 3 ways to view the version on the Apache server: via the command line (apachectl -v or apache2ctl -v), check the server status page (http://<server IP or domain name>/server-status), or view the Apache configuration file (ServerVersion: Apache/<version number>).

What to do if the apache80 port is occupied What to do if the apache80 port is occupied Apr 13, 2025 pm 01:24 PM

When the Apache 80 port is occupied, the solution is as follows: find out the process that occupies the port and close it. Check the firewall settings to make sure Apache is not blocked. If the above method does not work, please reconfigure Apache to use a different port. Restart the Apache service.

How to view the apache version How to view the apache version Apr 13, 2025 pm 01:00 PM

How to view the Apache version? Start the Apache server: Use sudo service apache2 start to start the server. View version number: Use one of the following methods to view version: Command line: Run the apache2 -v command. Server Status Page: Access the default port of the Apache server (usually 80) in a web browser, and the version information is displayed at the bottom of the page.

How to configure zend for apache How to configure zend for apache Apr 13, 2025 pm 12:57 PM

How to configure Zend in Apache? The steps to configure Zend Framework in an Apache Web Server are as follows: Install Zend Framework and extract it into the Web Server directory. Create a .htaccess file. Create the Zend application directory and add the index.php file. Configure the Zend application (application.ini). Restart the Apache Web server.

How to solve the problem that apache cannot be started How to solve the problem that apache cannot be started Apr 13, 2025 pm 01:21 PM

Apache cannot start because the following reasons may be: Configuration file syntax error. Conflict with other application ports. Permissions issue. Out of memory. Process deadlock. Daemon failure. SELinux permissions issues. Firewall problem. Software conflict.

How to delete more than server names of apache How to delete more than server names of apache Apr 13, 2025 pm 01:09 PM

To delete an extra ServerName directive from Apache, you can take the following steps: Identify and delete the extra ServerName directive. Restart Apache to make the changes take effect. Check the configuration file to verify changes. Test the server to make sure the problem is resolved.

See all articles