搞个论坛玩下

来源:互联网 发布:linux rpm安装路径 编辑:程序博客网 时间:2024/05/01 09:39

最近比较闲,以前架设过IIS的动网dvbbs。后来因为意外,和同事聊天的时候说起,居然有个同名的“动网” discuz!. 是用php写的,没搞过php 先架起来玩下。

软件环境: Windows xp + apache + mysql + php

三个软件装起来都很简单,我这里用的是
apache_2.2.11-win32-x86-no_ssl.msi
mysql-5.0.18-win32.zip
php-5.2.9-win32-installer.msi

呵呵,没什么特别原因,调高集成的,弄起来简单。

配置:

安装都是很简单的,不用特别注意的地方。装完后需要修改php.ini(php-dist.ini有些版本里头,改名成php.ini)、httpd.ini ——apache配置文件。具体如下:

注意在装php的时候一定要选上mysql组件,application will add lines to php.ini as follows:
"extension=php_mysql.dll
[PHP_MSSQL]
extension=php_mssql.dll
[PHP_MYSQL]
extension=php_mysql.dll"

httpd.ini里头要改动的主要是一个访问地址、docRoot路径(网站文件路径),以及php的位置

1. 访问地址:
#
# Listen: Allows you to bind Apache to specific IP addresses and/or
# ports, instead of the default. See also the <VirtualHost>
# directive.
#
# Change this to Listen on specific IP addresses as shown below to
# prevent Apache from glomming onto all bound IP addresses.
#
#Listen 12.34.56.78:80
Listen 80 #port

#
# ServerName gives the name and port that the server uses to identify itself.
# This can often be determined automatically, but we recommend you specify
# it explicitly to prevent problems during startup.
#
# If your host doesn't have a registered DNS name, enter its IP address here.
#
#ServerName www.myfaq.com:80 <- 如果又DNS服务器,这里可以弄下

2.访问路径
#
# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#
DocumentRoot   [Path]

#
# This should be changed to whatever you set DocumentRoot to.
#
<Directory [Path]>

3. php路径,这个在使用php 5的时候,软件会自动加

#BEGIN PHP INSTALLER EDITS - REMOVE ONLY ON UNINSTALL
#PHPIniDir "C:/Program Files/PHP/"
#LoadModule php5_module "C:/Program Files/PHP/php5apache2_2.dll"
#END PHP INSTALLER EDITS - REMOVE ONLY ON UNINSTALL

##############################################################

遇到的问题:

Apache 里头的httpd.exe可以分析httpd.ini文件的语法正确性;

搭建平台的时候可能会遇到在安装论坛的时候,连接不了数据库的问题。localhost是默认的访问名,这个不是设置Mysql的时候设置的服务名"MySQL". root是管理员账号,密码自设。这样已经差不多搞定了。如果出现服务启动问题(通常是开始的是不会用Mysql,多次生成服务实例造成类似cannot create windows service for mysql.error:0的错误)。参考网络上的资料后终极解决方法是,先移除实例

删除服务 win+R -> 输入 sc delete mysql (mysql是服务名)
卸载Mysql,(注意一定要删除Mysql文件夹)后重装,搞定。

原创粉丝点击