您的位置:首页 > 运维架构 > Apache

Establish a web server [php-mysql-apache] on Windows XP

2005-08-30 21:09 776 查看

Download software from web sites (www.apache.org, www.mysql.com, www.php.net), make sure you downloaded the windows version and unpacking all software in separate folders. install apache 2.0.54.


install apache
double click the downloaded file and begin to install. Make sure to fill in the right information and select the proper path for installation. Also you must unblocking apache in order to provide web service. I use the following information.
domain name: wamp.
server name: wamp.
email: smart-li@163.net
path: C:/.  (APACHE will install under the C:/Apache2)
you can visit http://localhost to see whether you have apache properly installed. The default web pages are in the folder (C:/Apache2/htdocs), maybe you need to change to your newly designed web sites’ folder such as (D:/www/mysite) by editing httpd.conf (C:/Apache2/conf/httpd.conf). Opening the file using Wordpad or Notepad. Seaching DocumentRoot “C:/Apache2/htdocs” and change to DocumentRoot “D:/www/mysite”; Save the file and restart apache by double clicking apache running icon.


install PHP 5.0.4
create a folder named php under C: and copy all unpacked files to this folder. Editing httpd.conf (C:/Apache2/conf/httpd.conf) using the file using Wordpad or Notepad.
Searching DirectoryIndex index.html index.html.var and add index.htm index.php at the end of the line.
Searching AddType application/x-gzip and add a new line below.
AddType application/ x-httpd-php .php
Seaching LoadModule ssl_module and add a new line below.
LoadModule php5_module “c:/php/php5apache2.dll”
Save the file and restart apache by double clicking apache running icon.
create a simple php file in the folder (D:/www/mysite) wamptest.php to test whether php successfully installed by navigating (http://localhost/wamptest.php).
<?php
echo phpinfo();
?>


install Mysql 4.1.11
select custom install and change the path to C:/mysql
skip the account signing up at mysql.com
select configure now
select detailed configuration
in select server type. select “Developer Machine”, click Next.
in select the database engine. Select multifunctional database. Click next.
in select the drive for the InnoDB datafiles, use the default settings. Click next.
in select number of concurrent connections to the server. Select decision support (DSS)/OLAP. CLICK NEXT.
In select the networking options, enable TCP/IP Networking and the port number is 3306.
In select the default character set. Choose standard character set. Click next.
In setting windows option. Enabling lauch the Mysql Server automatically. Click next.
In setting the security options. typing your mysql root password. Click next.
In ready to execute, click Execute to begin configuration.
click finish to end the installation.
from start menu,run MySql>Mysql command line client. Typing the root password you set during Mysql configuration. You can see Mysql> prompt.
Mysql> SHOW DATABASES;
You can see two databases mysql and test available. Which is save in the folder C:/mysql/data. In order to make Mysql work with PHP, do the following.
opening c:/windows/php.ini and searching extension=php_mysql.dll, delete “;” in the front of the line.
copy c:/php/libmysql.dll to c:/WINDOWS
restart apache.
editing D:/www/mysite/wamptest.php to the following.
<?php
mysql_connect(‘localhost’,’root’,’root password’) or die(“fail to connect to host”);
echo “connect to host successfully!<br>”;
echo phpinfo();
?>
navigating http://localhost/wamptest.php to know whether Mysql works well or not.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息