Home php教程 php手册 在window7上实践通过php5.2.17+Apache2.2+Mysql5.5的基本配置

在window7上实践通过php5.2.17+Apache2.2+Mysql5.5的基本配置

Jun 06, 2016 pm 07:52 PM
practice pass

刚刚开始学习php,配置运行环境花了好几天,现在将自己最后总结的配置方法贴出来。 Apache基本配置 1.httpd.conf文件加入以下内容(一般直接放在文件末尾) LoadModule php5_module E:/PHP/php5apache2_2.dll PHPIniDir E:/PHP/php.ini AddType application/

刚刚开始学习php,配置运行环境花了好几天,现在将自己最后总结的配置方法贴出来。


Apache基本配置
1.httpd.conf文件加入以下内容(一般直接放在文件末尾)
  LoadModule php5_module "E:/PHP/php5apache2_2.dll"
  PHPIniDir "E:/PHP/php.ini"
  AddType application/x-httpd-php .php
  AddType application/x-httpd-php .htm


  其中,PHP文件在E盘下,目录名为PHP,这里是指定这两个必须文件的路径。
2.httpd.conf文件中搜索以下内容
 
    Options FollowSymLinks
    AllowOverride None
    Order deny,allow
    #Deny from all
    Allow from all
 
  
  注意,默认的Deny from all已经注释掉了,如果未注释,则php文件不能访问
3.http.conf文件中搜索以下内容
  DocumentRoot "D:/Program Files/Apache Software Foundation/Apache2.2/htdocs"
  这里是指定web文件的目录,这里建议不要放在Apache目录下,应该用一个专有目录替换
  如:  DocumentRoot "E:/myproject/webContent"




php基本配置:


1.复制php5ts.dll和libmysql.dll到系统盘windows/system32下
2.将php的根目录加到系统环境变量path中
3.php.ini文件中以下三行取消注释(删除前面的;号)
  extension=php_gd2.dll
  extension=php_mbstring.dll、
  extension=php_mysql.dll
  
  修改这一行
  extension_dir = "E:/PHP/ext" 后面的目录以自己php的目录为准
  还有这一行
  doc_root = "E:/myproject/webContent" 后面的目录是Apache中设定的web文件的路径
  找到这一行
  ;session.save_path = "/tmp" ,将';'去掉,设置你保存session的目录,如session.save_path = "E:/PHP/session_temp"
可能以上的配置不上最简化的,但是配好以后确实可以访问php文件并且可以通过php连接mysql数据库了。

现在,可以在"E:/myproject/webContent"这个目录下创建php文件测试了。

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 尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
4 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)

How to stop Outlook from automatically adding events to my calendar How to stop Outlook from automatically adding events to my calendar Feb 26, 2024 am 09:49 AM

As an email manager application, Microsoft Outlook allows us to schedule events and appointments. It enables us to stay organized by providing tools to create, manage and track these activities (also called events) in the Outlook application. However, sometimes unwanted events are added to the calendar in Outlook, which creates confusion for users and spams the calendar. In this article, we will explore various scenarios and steps that can help us prevent Outlook from automatically adding events to my calendar. Outlook Events – A brief overview Outlook events serve multiple purposes and have many useful features as follows: Calendar Integration: In Outlook

Dreamweaver CMS station group practice sharing Dreamweaver CMS station group practice sharing Mar 18, 2024 am 10:18 AM

Dream Weaver CMS Station Group Practice Sharing In recent years, with the rapid development of the Internet, website construction has become more and more important. When building multiple websites, site group technology has become a very effective method. Among the many website construction tools, Dreamweaver CMS has become the first choice of many website enthusiasts due to its flexibility and ease of use. This article will share some practical experience about Dreamweaver CMS station group, as well as some specific code examples, hoping to provide some help to readers who are exploring station group technology. 1. What is Dreamweaver CMS station group? Dream Weaver CMS

In-depth discussion of the principles and practices of the Struts framework In-depth discussion of the principles and practices of the Struts framework Feb 18, 2024 pm 06:10 PM

Principle analysis and practical exploration of the Struts framework. As a commonly used MVC framework in JavaWeb development, the Struts framework has good design patterns and scalability and is widely used in enterprise-level application development. This article will analyze the principles of the Struts framework and explore it with actual code examples to help readers better understand and apply the framework. 1. Analysis of the principles of the Struts framework 1. MVC architecture The Struts framework is based on MVC (Model-View-Con

PHP Coding Practices: Refusing Alternatives to Goto Statements PHP Coding Practices: Refusing Alternatives to Goto Statements Mar 28, 2024 pm 09:24 PM

PHP Coding Practices: Refusal to Use Alternatives to Goto Statements In recent years, with the continuous updating and iteration of programming languages, programmers have begun to pay more attention to coding specifications and best practices. In PHP programming, the goto statement has existed as a control flow statement for a long time, but in practical applications it often leads to a decrease in the readability and maintainability of the code. This article will share some alternatives to help developers refuse to use goto statements and improve code quality. 1. Why refuse to use goto statement? First, let's think about why

C++ Reflection Mechanism Practice: Implementing Flexible Runtime Type Information C++ Reflection Mechanism Practice: Implementing Flexible Runtime Type Information Nov 27, 2023 pm 01:11 PM

C++ Reflection Mechanism Practice: Implementing Flexible Runtime Type Information Introduction: C++ is a strongly typed language and does not directly provide a reflection mechanism to obtain class type information like other languages. However, with some tricks and technical means, we can also achieve similar reflection functions in C++. This article describes how to leverage template metaprogramming and macro definitions to achieve flexible runtime type information. 1. What is the reflection mechanism? The reflection mechanism refers to obtaining the type information of a class at runtime, such as the class name, member functions, member variables and other attributes.

Practical tutorial: Vue3+Django4 new technical practice Practical tutorial: Vue3+Django4 new technical practice Sep 09, 2023 am 08:52 AM

Practical tutorial: Vue3+Django4 new technical practice Introduction: With the continuous development of front-end technology, Vue.js has become one of the most popular front-end frameworks. As a powerful and flexible Python Web framework, Django is also favored by developers. This article will lead you to explore how to combine Vue3 and Django4 to achieve a new technical practice. 1. Environment setup: First, we need to set up a development environment. Make sure your computer has the latest version of N installed

Best Practices for Traffic Management with Golang Best Practices for Traffic Management with Golang Mar 07, 2024 am 08:27 AM

Golang is a powerful and efficient programming language that is widely used to build web services and applications. In network services, traffic management is a crucial part. It can help us control and optimize data transmission on the network and ensure the stability and performance of services. This article will introduce the best practices for traffic management using Golang and provide specific code examples. 1. Use Golang’s net package for basic traffic management. Golang’s net package provides a way to handle network data.

A practical guide to remote development using PyCharm A practical guide to remote development using PyCharm Feb 25, 2024 pm 07:18 PM

Using PyCharm for remote development is an efficient way that allows developers to easily edit, debug and run code on the remote server in the local environment. This article will introduce how to use PyCharm for remote development practice, and combine it with specific code examples to help readers better understand and apply this technology. What is PyCharmPyCharm is a Python integrated development environment (IDE) developed by JetBrains, which provides a wealth of functions and tools to help

See all articles