Home php教程 php手册 win7(64位)安装搭建php

win7(64位)安装搭建php

Jun 06, 2016 pm 08:00 PM
64 bit php win7 Install tool build

工具/ 原料 php-5.5.10-Win32-VC11-x64.zip 下载地址: http://windows.php.net/download/ httpd-2.4.7-win64-VC11.zip 下载地址: http://www.apachelounge.com/download/ mysql-5.6.16-winx64.zip 下载地址: http://dev.mysql.com/downloads/mysql/ 方法/ 步



工具/原料

  • php-5.5.10-Win32-VC11-x64.zip 下载地址: http://windows.php.net/download/
  • httpd-2.4.7-win64-VC11.zip 下载地址: http://www.apachelounge.com/download/
  • mysql-5.6.16-winx64.zip 下载地址: http://dev.mysql.com/downloads/mysql/




方法/步骤

1. 1

一、安装配置Apache2.4.7(httpd-2.4.7-win64-VC11.zip )

1、解压下载的安装包:httpd-2.4.7-win64-VC11.zip将其放到自己的安装目录(我的目录D:\phpEnv\Apache24)

步骤阅读

2. 2

2、然后对http.conf(D:\phpEnv\Apache24\conf\http.conf)配置文件进行修改-使用记事本打开就行

(1)修改ServerRoot Apache的根路径:

(37行)ServerRoot"c:/Apache24"改成=>ServerRoot"D:/phpEnv/Apache24"

(2)修改ServerName你的主机名称:

(217行)ServerNamewww.example.com:80将前面的#去掉,该属性在从命令行启动Apache时需要用到。

(3)修改DocumentRoot Apache访问的主文件夹目录,就是php、html代码文件的位置。Apache默认的路径是在htdocs(D:\phpEnv\Apache24\htdocs)下面,里面会有个简单的入口文件index.html。这个路径可以自己进行修改,我这里将其配置在我自己新建的文件夹www(D:\phpEnv\www)下。

(247行) DocumentRoot "c:/Apache24/htdocs"

改为=>

DocumentRoot "D:\phpEnv\www"

(4)修改入口文件配置:DirectoryIndex一般情况下我们都是以index.php、index.html、index.htm作为web项目的入口。Apache默认的入口只有index.html需要添加其他两个的支持,当然这个入口文件的设置可以根据自己的需要增减,如果要求比较严格的话可以只写一个index.php,这样在项目里面的入口就只能是index.php

(274行)

DirectoryIndexindex.html

改为=>

DirectoryIndex index.php index.htmindex.html

(5)设定serverscript的目录:

(358行)ScriptAlias/cgi-bin/ "c:/Apache24/cgi-bin/"改为=> ScriptAlias/cgi-bin/ "D:/phpEnv/Apache24/cgi-bin"

(6)(380行)

AllowOverride None

Options None

Require all granted

改为=>

AllowOverride None

Options None

Require all granted

3. 3

3、接下来就可以启动Apache

开始---运行,输入cmd,打开命令提示符。接着进入D:\phpEnv\Apache24\bin目录下回车httpd回车,如图所示.

没有报错的话就可以测试了(保持该命令窗口为打开的状态)。

把Apache24\htdocs目录下的index.html放到D:\phpEnv\www目录下,用浏览器访问会出现“It works”那么就说明apache已经正确安装并启动了。也可以自己写一个简单的index.html文件也可以打开。

步骤阅读

4. 4

4、将Apache加入到window服务启动项里面并设置成开机启动

先关闭httpd的服务(将命令窗口关闭即可)

重新打开一个新的命令窗口进入到D:\phpEnv\Apache24\bin目录下:

添加HTTP服务的命令是:httpd.exe -kinstall -n "servicename" servicename是服务的名称,我添加的是:httpd.exe -k install -n "Apache24"命令成功后会有成功的提示,此时你可以在window服务启动项中看到Apache24这个服务

然后点击启动就可以了,如果不想设置成开机启动的话也可以将启动类型修改为手动。

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

当然也可以通过D:\phpEnv\Apache24\bin下面的ApacheMonitor.exe来启动Apache这里就不多说了

如此Apache的配置就基本完成了。

步骤阅读

END

方法/步骤2

1. 1

二、安装配置php5.5.10(php-5.5.10-Win32-VC11-x64.zip)

1、将下载的php-5.5.10-Win32-VC11-x64.zip 解压到安装目录下我的是(D:\phpEnv\php)

2、将目录下的php.ini-development文件复制一份并改名为php.ini他是php的配置文件

3、为Apache服务添加php支持

打开Apache的配置文件http.conf在最后加上

# php5 support

LoadModule php5_moduleD:/phpEnv/php/php5apache2_4.dll

AddType application/x-httpd-php .php.html .htm

# configure thepath to php.ini

PHPIniDir "D:/phpEnv/php"

这里我添加在LoadModule下面

添加的时候要保证你的php5apache2_4.dll文件确实存在php5.5的早期版本里面是没有这个文件的,不过高点版本里面已经有了,可以打开php安装目录找下这个文件

PHPIniDir"D:/phpEnv/php"这个就是你的php根目录

步骤阅读

2. 2

4.重启Apache服务器。

5.测试。删除www中其他文件,新建一个index.php,内容为保存,访问出现php的信息就说明php已经成功安装。

备注:

Php的一些常用配置修改:(D:\phpEnv\php\php.ini

时区的设置:date.timezone = Asia/Shanghai

错误报告等级:error_reporting = E_ALL这个在开发模式下可以全部打开。

步骤阅读




方法/步骤3

1. 1

三、安装配置mysql5.6.16(mysql-5.6.16-winx64.zip)

1、安装mysql

64位的mysql暂时没找到msi的安装包,因此直接解压到安装目录下,然后配置相关的环境变量,修改配置文件,添加window服务就行,这里就不详细写了。这里把我的配置文件贴出来给大家参考下:

[mysqld]

loose-default-character-set = utf8

basedir = D:/program/mysql-5.6

datadir = D:/program/mysql-5.6/data

port = 3306

sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES

character_set_server = utf8

[client]

loose-default-character-set = utf8

注:basedir是mysql的根目录,datadir是mysql的数据存储目录。其他的我就不做解释了

安装完mysql是没有图形用户界面的,可以安装个Navicat for MySQL之类的软件,这样看起来会比较方便点。

2. 2

2、安装完成mysql之后,为php添加mysql支持

打开php的配置文件php.ini(D:\phpEnv\php\php.ini)

(1)(721行); extension_dir = "ext",去掉前面的“;”,并改为extension_dir="D:\phpEnv\php\ext"打开php的扩展支持,ext文件夹下有很多php的扩展支持.dll文件,感兴趣的同学可以看一下。

(2)然后就是打开php的mysql扩展了

(875、876行)去掉前面的“;”

extension=php_mysql.dll

extension=php_mysqli.dll

当然也可以打开881行的php_pdo_mysql.dll启用php的pdo支持我一般都用这个。

注:在第863行到第888行有很多扩展选择,你要用到什么,去掉前面的“;”就可以了。当然如果要添加其他的扩展支持如redis支持,php本身可能没有提供相应的dll文件,就需要自己去找到相应版本的dll添加到ext文件夹中,然后在配置文件中添加一个extension=…

完成之后,重启Apache

在访问phpinfo的时候就可以看到

步骤阅读

步骤阅读

步骤阅读

方法/步骤4

1. 1

四、小结:

Php环境的安装网上已经有很多资料了,自己在接触php的时候也是翻天覆地的查,在自己的电脑上也装过不少次了,开始的时候也用集成的软件包,WAMP、AppServ等,后来php版本升级后,发现要想升级集成包的php很麻烦,所以强烈建议自己动手单独配置下环境,更好的了解Apache、php、mysql之间的联系。


注意事项

  • 安装的电脑要支持VC11
  • 涉及到的配置文件行数可能会随着版本的提升或者个人的修改会有些许变动

 

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

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
1 months ago By 尊渡假赌尊渡假赌尊渡假赌
Two Point Museum: All Exhibits And Where To Find Them
1 months 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)

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.

How to operate Zookeeper performance tuning on Debian How to operate Zookeeper performance tuning on Debian Apr 02, 2025 am 07:42 AM

This article describes how to optimize ZooKeeper performance on Debian systems. We will provide advice on hardware, operating system, ZooKeeper configuration and monitoring. 1. Optimize storage media upgrade at the system level: Replacing traditional mechanical hard drives with SSD solid-state drives will significantly improve I/O performance and reduce access latency. Disable swap partitioning: By adjusting kernel parameters, reduce dependence on swap partitions and avoid performance losses caused by frequent memory and disk swaps. Improve file descriptor upper limit: Increase the number of file descriptors allowed to be opened at the same time by the system to avoid resource limitations affecting the processing efficiency of ZooKeeper. 2. ZooKeeper configuration optimization zoo.cfg file configuration

What is the impact of Debian Message on network configuration What is the impact of Debian Message on network configuration Apr 02, 2025 am 07:51 AM

The network configuration of the Debian system is mainly implemented through the /etc/network/interfaces file, which defines network interface parameters, such as IP address, gateway, and DNS server. Debian systems usually use ifup and ifdown commands to start and stop network interfaces. By modifying the ifeline in the interfaces file, you can set a static IP or use DHCP to dynamically obtain the IP address. It should be noted that Debian12 and subsequent versions no longer use NetworkManager by default, so other command-line tools, such as IP commands, may be required to manage network interfaces. You can edit /etc/netwo

How to do Oracle security settings on Debian How to do Oracle security settings on Debian Apr 02, 2025 am 07:48 AM

To strengthen the security of Oracle database on the Debian system, it requires many aspects to start. The following steps provide a framework for secure configuration: 1. Oracle database installation and initial configuration system preparation: Ensure that the Debian system has been updated to the latest version, the network configuration is correct, and all required software packages are installed. It is recommended to refer to official documents or reliable third-party resources for installation. Users and Groups: Create a dedicated Oracle user group (such as oinstall, dba, backupdba) and set appropriate permissions for it. 2. Security restrictions set resource restrictions: Edit /etc/security/limits.d/30-oracle.conf

How to monitor system performance through Debian logs How to monitor system performance through Debian logs Apr 02, 2025 am 08:00 AM

Mastering Debian system log monitoring is the key to efficient operation and maintenance. It can help you understand the system's operating conditions in a timely manner, quickly locate faults, and optimize system performance. This article will introduce several commonly used monitoring methods and tools. Monitoring system resources with the sysstat toolkit The sysstat toolkit provides a series of powerful command line tools for collecting, analyzing and reporting various system resource metrics, including CPU load, memory usage, disk I/O, network throughput, etc. The main tools include: sar: a comprehensive system resource statistics tool, covering CPU, memory, disk, network, etc. iostat: disk and CPU statistics. mpstat: Statistics of multi-core CPUs. pidsta

How to optimize Debian Hadoop How to optimize Debian Hadoop Apr 02, 2025 am 08:54 AM

To improve the performance of DebianHadoop cluster, we need to start from hardware, software, resource management and performance tuning. The following are some key optimization strategies and suggestions: 1. Select hardware and system configurations carefully to select hardware configurations: Select the appropriate CPU, memory and storage devices according to actual application scenarios. SSD accelerated I/O: Use solid state hard drives (SSDs) as much as possible to improve I/O operation speed. Memory expansion: Allocate sufficient memory to NameNode and DataNode nodes to cope with larger data processing and tasks. 2. Software configuration optimization Hadoop configuration file adjustment: core-site.xml: Configure HDFS default file system

How to implement hot reload in Debian How to implement hot reload in Debian Apr 02, 2025 am 07:54 AM

Experience the convenience of Flutter hot reloading on the Debian system, just follow the steps below: Install FlutterSDK: First, you need to install FlutterSDK on the Debian system. Visit Flutter official website to download the latest stable version of SDK and decompress to the specified directory (for example, ~/flutter). After that, add Flutter's bin directory to the system PATH environment variable. Edit the ~/.bashrc or ~/.profile file, add the following code: exportPATH="$PATH:~/flutter/bin" Save the file and execute source~/.bas

Which libraries in Go are developed by large companies or provided by well-known open source projects? Which libraries in Go are developed by large companies or provided by well-known open source projects? Apr 02, 2025 pm 04:12 PM

Which libraries in Go are developed by large companies or well-known open source projects? When programming in Go, developers often encounter some common needs, ...

See all articles