Table of Contents
VC9 x86 Thread Safe (2013-Jun-05 22:49:25)
Home Backend Development PHP Tutorial Winodws 装配 PHP开发环境

Winodws 装配 PHP开发环境

Jun 13, 2016 pm 12:43 PM
apache http php windows

Winodws 安装 PHP开发环境

安装环境:Windows7 64位

目标PHP运行环境: PHP5.4和Apache2.4

1,打开PHP windows的官方网站:http://windows.php.net/download/#php-5.5

2,选择Apache作为服务器,PHP5.4 线程安全版。

VC9 x86 Thread Safe (2013-Jun-05 22:49:25)

因为笔者机器上安装了VC9和10没有安装11所以没有选择5.5. php5.5需要安装VC10.可以去添加删除程序里面看你目前安装的Microsoft Visual C++ 20xx Redistributable的版本。如果安装了11可以下载PHP5.5. 或者你自己手动去下载安装个。

?

下载和配置Apache2.4

3,因为我们选择的是PHP5.4所以我们不能使用Apache.org官网的apache,那个只支持VC++ 9.不支持VC++11。另外在你的机器上确定安装了Visual C++ Redistributable for Visual Studio 2012?x86 or x64?

所以我们去http://www.apachelounge.com/download/现在32位或者62位的。笔者是64位win7系统,但是我使用了32位。说明32位兼容64位操作系统。

4,都是免安装版的。直接解压就可以了。

5,启动Apache2前需要配置ServerRoot和DocumentRoot的地址。否则会启动不了。

ServerRoot配置到你的Apache的解压目录。 DocumentRoot配置你的网站地址,或者随便配置个地址,复制Apahce目录/htdocs/index.html文件到配置的那个地址。

6,打开localhost,就可以看到It Works了。

?

配置PHP和Apache

可以参考http://us1.php.net/manual/zh/install.windows.apache2.php

和http://www.cnblogs.com/pharen/archive/2012/02/06/2340628.html

?

1,解析PHP,

LoadModule php5_module "D:/Develop/PHP/php5apache2_4.dll"

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

?

2,添加PHP初始化目录。也就是你解压PHP压缩包之后的那个目录PHPIniDir "D:/Develop/PHP"

?

3,添加首页支持PHP文件

DirectoryIndex index.html

      改为

        DirectoryIndex?index.php?index.html

?

PHP部分:

4, 设置PHP扩展包的具体目录,找到

        ; On windows:
        ; extension_dir = "ext"

      改为 (值是ext文件夹的目录)

        ; On windows:
        ? extension_dir = "D:/Develop/PHP/ext"

?

5,开启相应的库功能。

;extension=php_mysql.dll去掉前面的分号(注释),即改为

extension=php_mysql.dll

?

6,设置时区

;date.timezone =

        改为

        date.timezone = Asia/Shanghai

?

PHP文档手册:

http://www.php.net/manual/zh/

?

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 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)

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.

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's Purpose: Building Dynamic Websites PHP's Purpose: Building Dynamic Websites Apr 15, 2025 am 12:18 AM

PHP is used to build dynamic websites, and its core functions include: 1. Generate dynamic content and generate web pages in real time by connecting with the database; 2. Process user interaction and form submissions, verify inputs and respond to operations; 3. Manage sessions and user authentication to provide a personalized experience; 4. Optimize performance and follow best practices to improve website efficiency and security.

PHP: Handling Databases and Server-Side Logic PHP: Handling Databases and Server-Side Logic Apr 15, 2025 am 12:15 AM

PHP uses MySQLi and PDO extensions to interact in database operations and server-side logic processing, and processes server-side logic through functions such as session management. 1) Use MySQLi or PDO to connect to the database and execute SQL queries. 2) Handle HTTP requests and user status through session management and other functions. 3) Use transactions to ensure the atomicity of database operations. 4) Prevent SQL injection, use exception handling and closing connections for debugging. 5) Optimize performance through indexing and cache, write highly readable code and perform error handling.

PHP and Python: Code Examples and Comparison PHP and Python: Code Examples and Comparison Apr 15, 2025 am 12:07 AM

PHP and Python have their own advantages and disadvantages, and the choice depends on project needs and personal preferences. 1.PHP is suitable for rapid development and maintenance of large-scale web applications. 2. Python dominates the field of data science and machine learning.

PHP: Creating Interactive Web Content with Ease PHP: Creating Interactive Web Content with Ease Apr 14, 2025 am 12:15 AM

PHP makes it easy to create interactive web content. 1) Dynamically generate content by embedding HTML and display it in real time based on user input or database data. 2) Process form submission and generate dynamic output to ensure that htmlspecialchars is used to prevent XSS. 3) Use MySQL to create a user registration system, and use password_hash and preprocessing statements to enhance security. Mastering these techniques will improve the efficiency of web development.

How to build a Zookeeper cluster in CentOS How to build a Zookeeper cluster in CentOS Apr 14, 2025 pm 02:09 PM

Deploying a ZooKeeper cluster on a CentOS system requires the following steps: The environment is ready to install the Java runtime environment: Use the following command to install the Java 8 development kit: sudoyumininstalljava-1.8.0-openjdk-devel Download ZooKeeper: Download the version for CentOS (such as ZooKeeper3.8.x) from the official ApacheZooKeeper website. Use the wget command to download and replace zookeeper-3.8.x with the actual version number: wgethttps://downloads.apache.or

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.

See all articles