Table of Contents
Discuz 论坛搭建
Discuz! X3 安装图文教程
Home php教程 php手册 PHP搭建(windows64+apache2.4.7+mysql-5.6+php5.5+phpMyAdmin)

PHP搭建(windows64+apache2.4.7+mysql-5.6+php5.5+phpMyAdmin)

Jun 06, 2016 pm 07:36 PM
php build

以下文章参考的3个来源,在加上本人搭建过程中遇到的问题的修复完善笔记: 《PHP环境的搭建和Discuz! 安装 》 http://www.myxzy.com/post-386.html http://www.discuz.net/thread-3258186-1-1.html 现在大部分一键 安装 包多是32位的,并不支持64位,直接在6

以下文章参考的3个来源,在加上本人搭建过程中遇到的问题的修复完善笔记:

《PHP环境的搭建和Discuz!安装

http://www.myxzy.com/post-386.html

http://www.discuz.net/thread-3258186-1-1.html

现在大部分一键安装包多是32位的,并不支持64位,直接在64位的系统上使用会报错的,所以我这里就来说说windows 64位系统如何建立Apache+PHP+MySQL环境的!

我这里演示用的windows 2008 64位简体中文版,apache,php,mysql多用的是64位的版本。建立的是本地环境,所以我用的是默认设置。

1、下载PHP、Apache和Mysql软件以及VC库。

下面分别是PHP、Apache和Mysql的官网地址。

PHP:http://windows.php.net/qa/

Mysql:http://www.mysql.com/downloads/mysql/

Apache:http://www.apachelounge.com/download/win64/

本教程要用到的php,apache,mysql以及vc库,下载地址:百度网盘


2、安装前注意事项。

你注意下下载PHP,Apache的网站,上面有提示要安装Visual C++库的。

Apache2.4.4需要VC10库支持,Microsoft Visual C++ 2010 SP1 Redistributable Package (x64)

PHP5.6需要VC11库支持,Visual C++ Redistributable for Visual Studio 2012 Update 1

注1:如果Apache2.4.4没有安装VC10库,会出现如下提示的错误。

错误提示:“无法启动此程序,因为计算机中丢失MSVCR100.dll。尝试重新安装该程序以解决此问题。”

PHP搭建(windows64+apache2.4.7+mysql-5.6+php5.5+phpMyAdmin)

注2:如果PHP5.5.0beta2没有安装VC11库,会出现如下提示的错误。

PHP搭建(windows64+apache2.4.7+mysql-5.6+php5.5+phpMyAdmin)

3、安装Apache(D盘根目录下)

(1)打开D:\discuz\Apache24\conf下httpd.conf 文件,用记事本打开编辑作如下修改并保存。

第37行ServerRoot "c:/Apache24"改为ServerRoot “D:/discus/Apache24”;//Apache程序的位置。

第204行的ServerAdmin改不改无所谓;

第213行ServerName前面的“#”号去掉;

第237行DocumentRoot "c:/Apache24/htdocs"改为DocumentRoot " D:/discus/Apache24/htdocs ";//网站的根目录

第238行改为

第271行DirectoryIndex index.html改为DirectoryIndex index.html index.php index.htm   //支持更多的默认页

第354行 ScriptAlias /cgi-bin/ "c:/Apache24/cgi-bin/"改为ScriptAlias /cgi-bin/ " D:/discus/Apache24cgi-bin/"

第370行改为

(2)启动Apache。

开始 --- 运行,输入cmd,打开命令提示符。分别输入如下命令(每行回车)

d:

cd Apache24\bin

httpd

如果httpd.conf配置正确的话,输入httpd回车后是没有任何提示的。不要关闭命令窗口(关闭命令窗口就是关闭Apache),本地浏览器访问。出现“It works”那么就说明apache已经正确安装了。

PHP搭建(windows64+apache2.4.7+mysql-5.6+php5.5+phpMyAdmin)

(3)把Apache加入系统服务

关闭httpd命令窗口,不然会报错的。

开始 --- 运行,输入cmd,再打开一个命令提示符。分别输入如下命令(每行回车)

d:

cd Apache24\bin

httpd.exe -k install -n "servicename" \\加入服务。servicename是服务里面的名字,可以自定义。

如果要卸载这个服务的话,先要停止这个服务,然后输入httpd.exe -k uninstall -n "servicename"卸载这个服务。

4、安装PHP(D盘根目录下)

这里PHP5.5.0用php5apache2_4.dll来配置的。也不用PHP.ini文件了,用PHP默认的了。

(1)打开Apache24\conf下httpd.conf,在最后加上

# php5 support

LoadModule php5_module "d:/discuz/php/php5apache2_4.dll"

AddHandler application/x-httpd-php .php

# configure the path to php.ini

PHPIniDir "d: /discuz /php"

(2)重启 Apache 服务器。

网站文件夹D:/discuz/Apache24/htdocs新建一个index.php,内容为保存,访问出现php的信息就说明php已经成功安装。如下图。

PHP搭建(windows64+apache2.4.7+mysql-5.6+php5.5+phpMyAdmin)

5、MySQL安装

MySQL安装我简单说了下也就是通过cmd命令即可。(每行回车)

d:

cd mysql\bin

MySQLd --install MySQL

net start MySQL

在php目录下

第730行; extension_dir = "ext",去掉前面的“;”,并改为extension_dir ="d:\discuz\php\ext"

找到extension 添加下面两行

extension=php_mysql.dll

extension=php_mysqli.dll

extension=php_mbstring.dll (这里主要用于phpMyAdmin支持中文)

重启httpd即可测试

;D:\discuz\php\ext

phpMyAdmin 4.1.2安装

http://www.phpmyadmin.net/home_page/downloads.php 官网下载

解压到你网站跟目录下并重命名phpMyAdmin(我的网站根目录为:D:\discuz\Apache24\htdocs)

在phpMyAdmin目录下找到 libraries /config.default.php文件

查找password 找到两行,填入mysql的用户和密码

$cfg['Servers'][$i]['password'] = '*****';

$cfg['Servers'][$i]['user'] = 'root';

设置$cfg['PmaAbsoluteUri'] = ''; 为phpMyAdmin目录路径(如:http://localhost/phpMyAdmin/)

$cfg['DefaultLang'] = 'en'; 这里可以设置编码 zh

$cfg['DefaultConnectionCollation'] = 'utf8_general_ci'; 设置数据库编码

测试(apache和mysql均已经启动)打开http://localhost/phpMyAdmin/ 出现以下页面则安装成功

PHP搭建(windows64+apache2.4.7+mysql-5.6+php5.5+phpMyAdmin)

填入之前设置的用户名和密码,登陆即可

PHP搭建(windows64+apache2.4.7+mysql-5.6+php5.5+phpMyAdmin)

Discuz 论坛搭建

在D盘下新建网站跟目录文件夹web,

把原来D:\discuz\Apache24\htdocs 下的phpMyAdmin复制到web里面

修改apache下conf/ httpd.conf文件里的DocumentRoot 改为 DocumentRoot "D:/web"

改为

重启apache

在D:/web文件下编辑测试文件web.php ,编辑

在浏览器打开http://localhost/web.php 成功出现以下图片

PHP搭建(windows64+apache2.4.7+mysql-5.6+php5.5+phpMyAdmin)

Discuz! X3 安装图文教程

下载x3.1

http://www.comsenz.com/downloads/install/discuzx

二、解压并上传 Discuz! X3 程序到服务器且修改相应目录权限 
1、上传 Discuz! X3 程序到服务器上 
解压缩得到如下图所示的三个文件: 
PHP搭建(windows64+apache2.4.7+mysql-5.6+php5.5+phpMyAdmin) 
upload 这个目录下面的所有文件是我们需要上传到服务器上的可用程序文件; 
readme 目录为产品介绍、授权、安装、升级、转换以及版本更新日志说明; 
utility 目录为论坛附带工具,包括升级程序。

这里分开两种方式说明:第一种本地,第二种空间

(1)复制upload里面的所有文件到web下面 
(2)如果是上传到空间则将其中 upload 目录下的所有文件使用 FTP 软件以二进制方式

(常见 FTP 软件二进制的设置方法:点击查看详细说明)上传到空间。如下图所示: 
PHP搭建(windows64+apache2.4.7+mysql-5.6+php5.5+phpMyAdmin)

(1)输入http://localhost/install/ 则会出现安装目录

(2)上传完毕后,开始在浏览器中安装 Discuz! X3,在浏览器中运行 http://www.domain.com/bbs/install/

开始全新安装(其中http://www.domain.com/bbs 为你的站点访问地址) 
PHP搭建(windows64+apache2.4.7+mysql-5.6+php5.5+phpMyAdmin) 
阅读授权协议后点击“我同意”,系统会自动检查环境及文件目录权限,如下图所示: 
PHP搭建(windows64+apache2.4.7+mysql-5.6+php5.5+phpMyAdmin) 
检测成功,点击“下一步”,即进入检测服务器环境以及设置 UCenter 界面,如下图所示: 
PHP搭建(windows64+apache2.4.7+mysql-5.6+php5.5+phpMyAdmin) 
1、选择“全新安装 Discuz! X (含 UCenter Server)” 
如果您之前没有安装过我们的产品,需要全新安装的话,请选择此项。 
2、选择“仅安装 Discuz! X (手工指定已经安装的 UCenter Server )” 
如果您之前安装过我们的产品,现在只是升级的话,请选择此项并保证之前的 UCenter 是 UCenter 1.6.0 版本,如果之前安装的 UCenter Server 没有进行升级操作的话,一般为 1.5.1 或 1.5.2 版本,您需要首先升级 Ucenter 到 1.6.0版本, 否则安装程序会提示错误,无法继续。这里以全新安装 Discuz! X 为例。

新建数据库

PHP搭建(windows64+apache2.4.7+mysql-5.6+php5.5+phpMyAdmin)

输入密码

PHP搭建(windows64+apache2.4.7+mysql-5.6+php5.5+phpMyAdmin)

创建数据库

mysql> create database discus;

discus (数据库名称,可以自己指定)

出现Query OK, 1 row affected (0.02 sec) (说明成功)

退出mysql

exit;

点击“下一步”,进入安装数据库的界面,如下图所示: 
PHP搭建(windows64+apache2.4.7+mysql-5.6+php5.5+phpMyAdmin)

填写好 Discuz! X 数据库信息及管理员信息。 
点击“下一步”,系统会自动安装数据库直至完毕,如下图所示: 
PHP搭建(windows64+apache2.4.7+mysql-5.6+php5.5+phpMyAdmin) 
安装成功后,出现欢迎开通 Discuz!云平台以及 Discuz! 应用中心的安装的界面: 
PHP搭建(windows64+apache2.4.7+mysql-5.6+php5.5+phpMyAdmin) 
如果您想马上开启云平台,可以点击“开通 Discuz!云平台”,创始人登录站点后台,如下图所示: 
PHP搭建(windows64+apache2.4.7+mysql-5.6+php5.5+phpMyAdmin) 
开通即可,如果暂时不想开通 Discuz!云平台可以选择“暂不开通”需要开通的时候登录后台开通即可。 
如果您想马上安装 Discuz! 应用的话,可以点击“马上去装应用”,创始人登录站点后台,如下图所示: 
PHP搭建(windows64+apache2.4.7+mysql-5.6+php5.5+phpMyAdmin) 
选择要安装的应用,安装即可 
安装完毕后进入 Discuz! X 首页查看网站: 
PHP搭建(windows64+apache2.4.7+mysql-5.6+php5.5+phpMyAdmin)

至此,Discuz! X3 已经成功地安装完毕!您可以登录 Discuz! X 站点并开始设置了。

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 尊渡假赌尊渡假赌尊渡假赌
Mandragora: Whispers Of The Witch Tree - How To Unlock The Grappling Hook
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
1269
29
C# Tutorial
1249
24
Explain JSON Web Tokens (JWT) and their use case in PHP APIs. Explain JSON Web Tokens (JWT) and their use case in PHP APIs. Apr 05, 2025 am 12:04 AM

JWT is an open standard based on JSON, used to securely transmit information between parties, mainly for identity authentication and information exchange. 1. JWT consists of three parts: Header, Payload and Signature. 2. The working principle of JWT includes three steps: generating JWT, verifying JWT and parsing Payload. 3. When using JWT for authentication in PHP, JWT can be generated and verified, and user role and permission information can be included in advanced usage. 4. Common errors include signature verification failure, token expiration, and payload oversized. Debugging skills include using debugging tools and logging. 5. Performance optimization and best practices include using appropriate signature algorithms, setting validity periods reasonably,

What are PHP magic methods (__construct, __destruct, __call, __get, __set, etc.) and provide use cases? What are PHP magic methods (__construct, __destruct, __call, __get, __set, etc.) and provide use cases? Apr 03, 2025 am 12:03 AM

What are the magic methods of PHP? PHP's magic methods include: 1.\_\_construct, used to initialize objects; 2.\_\_destruct, used to clean up resources; 3.\_\_call, handle non-existent method calls; 4.\_\_get, implement dynamic attribute access; 5.\_\_set, implement dynamic attribute settings. These methods are automatically called in certain situations, improving code flexibility and efficiency.

Explain late static binding in PHP (static::). Explain late static binding in PHP (static::). Apr 03, 2025 am 12:04 AM

Static binding (static::) implements late static binding (LSB) in PHP, allowing calling classes to be referenced in static contexts rather than defining classes. 1) The parsing process is performed at runtime, 2) Look up the call class in the inheritance relationship, 3) It may bring performance overhead.

PHP and Python: Comparing Two Popular Programming Languages PHP and Python: Comparing Two Popular Programming Languages Apr 14, 2025 am 12:13 AM

PHP and Python each have their own advantages, and choose according to project requirements. 1.PHP is suitable for web development, especially for rapid development and maintenance of websites. 2. Python is suitable for data science, machine learning and artificial intelligence, with concise syntax and suitable for beginners.

PHP in Action: Real-World Examples and Applications PHP in Action: Real-World Examples and Applications Apr 14, 2025 am 12:19 AM

PHP is widely used in e-commerce, content management systems and API development. 1) E-commerce: used for shopping cart function and payment processing. 2) Content management system: used for dynamic content generation and user management. 3) API development: used for RESTful API development and API security. Through performance optimization and best practices, the efficiency and maintainability of PHP applications are improved.

PHP: A Key Language for Web Development PHP: A Key Language for Web Development Apr 13, 2025 am 12:08 AM

PHP is a scripting language widely used on the server side, especially suitable for web development. 1.PHP can embed HTML, process HTTP requests and responses, and supports a variety of databases. 2.PHP is used to generate dynamic web content, process form data, access databases, etc., with strong community support and open source resources. 3. PHP is an interpreted language, and the execution process includes lexical analysis, grammatical analysis, compilation and execution. 4.PHP can be combined with MySQL for advanced applications such as user registration systems. 5. When debugging PHP, you can use functions such as error_reporting() and var_dump(). 6. Optimize PHP code to use caching mechanisms, optimize database queries and use built-in functions. 7

The Enduring Relevance of PHP: Is It Still Alive? The Enduring Relevance of PHP: Is It Still Alive? Apr 14, 2025 am 12:12 AM

PHP is still dynamic and still occupies an important position in the field of modern programming. 1) PHP's simplicity and powerful community support make it widely used in web development; 2) Its flexibility and stability make it outstanding in handling web forms, database operations and file processing; 3) PHP is constantly evolving and optimizing, suitable for beginners and experienced developers.

PHP vs. Python: Understanding the Differences PHP vs. Python: Understanding the Differences Apr 11, 2025 am 12:15 AM

PHP and Python each have their own advantages, and the choice should be based on project requirements. 1.PHP is suitable for web development, with simple syntax and high execution efficiency. 2. Python is suitable for data science and machine learning, with concise syntax and rich libraries.

See all articles