轻松搞定PHP5+apach2+mysql
有个美国客户要改个小网站,要我帮忙。只能拣起荒废多日的PHP,重新看看.
第一关就是配置. 配置这个破东西与JAVA环境一样难伺候..为什么标榜自由的东西,总是那么难搞呢???
是个矛盾. 下面部分东西是抄袭了别人的东西,不要怪我。 打字太累.
mysql-4.1.22-win32
apache_2.0.55-win32-x86-no_ssl
php-5.2.0-Win32
phpMyAdmin-2.6.2-rc1
Zend (客户要求2.6,今天太晚,我没装呢。 明天补上)
以上软件可以到各大下载网站下载.或者直接登陆官方网站下载.而且配置教程也是一大堆,我就不做详细的技术文献了..
php的官方网站 http://www.php.net/?有中文语言服务,你甚至可以找到最新的中文php手册
php的下载页面 http://www.php.net/downloads.php
apache的官方网站 http://www.apache.org/
apache的下载页面 http://archive.apache.org/dist/httpd/
MySQL作为一款数据库软件最大的特点就是免费,当然他也非常高效,有和php相似的特性
MySQL官方网站 http://www.mysql.com/
安装好所有程序后.开始着手配置了.:
首先配置apache2
打开Apache2conf文件夹下面的httpd.conf配置文件
到最后 加入
LoadFile c:/php/php5ts.dll //加载php5ts.dll,这无论是apache还是IIS都必须以来的链接库
LoadModule php5_module c:/php/php5apache2.dll //加载php5的apache模块
AddType application/x-httpd-php .php
''www.111cn.net
查找DocumentRoot,后面是"C:/Apache2/htdocs"可能因安装路径不同而不同,
是web网页的目录所在地,可改成自己需要的地方,注意,是斜杠"/"不是反斜杠"",毕竟这是linux下面移植过来的
查找DirectoryIndex,后面应该是index.html index.html.var
这是默认的首页名称,要再添加index.php index.htm
然后是配置php
把C:php文件夹下的php.ini-recommended改名,改名为php.ini
PHP.ini:出于安全和效率的考虑,建议使用php.ini-recommended作为php.ini的蓝本,而不要使用php.ini-dist。同时PHP.ini的查找路径也不再限于PHP4时代的%SystemRoot%下了,PHP5按照以下路径查找PHP.ini:
* PHPIniDir (Apache 2 module only)
* 注册表键值:HKEY_LOCAL_MACHINESOFTWAREPHPIniFilePath
* 环境变量:%PHPRC%
* PHP5的目录 (for CLI), 或者web服务器目录(for
SAPI modules)
* Windows目录(C:windows or C:winnt)
这五个方案中,配合Apache2时最好使用PHPIniDir,其次是使用%PHPRC%环境变量,另外,NTFS上记得给服务器开PHP.ini的读权限。
打开php.ini,查找extension_dir后面的改为"C:/php/ext",看看那个文件夹就知道是什么东西了
查找Windows Extensions,那下面有一排的;extension=php_***.dll
开始去分号了,去掉就是支持组件
起码把
extension=php_gd2.dll
extension=php_mbstring.dll
extension=php_mysql.dll
前面的分号去掉
php5开始默认不支持mysql了,所以我们要为他添加支持,除了extension=php_mysql.dll去分号之外
在php目录里有个libmysql.dll文件,把它复制到系统的system32文件夹下,复制php.ini到windows目录下
重启动机器 .OK .写了个地球人都知道的. hello word
php
echo ''Hello World!'';
?>
看到没? 看到了就OK,看不到。那没办法,重新CHECK每个步骤.
..没办法,懒啊..

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

PHP 8.4 brings several new features, security improvements, and performance improvements with healthy amounts of feature deprecations and removals. This guide explains how to install PHP 8.4 or upgrade to PHP 8.4 on Ubuntu, Debian, or their derivati

Visual Studio Code, also known as VS Code, is a free source code editor — or integrated development environment (IDE) — available for all major operating systems. With a large collection of extensions for many programming languages, VS Code can be c

One of the major changes introduced in MySQL 8.4 (the latest LTS release as of 2024) is that the "MySQL Native Password" plugin is no longer enabled by default. Further, MySQL 9.0 removes this plugin completely. This change affects PHP and other app

This tutorial demonstrates how to efficiently process XML documents using PHP. XML (eXtensible Markup Language) is a versatile text-based markup language designed for both human readability and machine parsing. It's commonly used for data storage an

A string is a sequence of characters, including letters, numbers, and symbols. This tutorial will learn how to calculate the number of vowels in a given string in PHP using different methods. The vowels in English are a, e, i, o, u, and they can be uppercase or lowercase. What is a vowel? Vowels are alphabetic characters that represent a specific pronunciation. There are five vowels in English, including uppercase and lowercase: a, e, i, o, u Example 1 Input: String = "Tutorialspoint" Output: 6 explain The vowels in the string "Tutorialspoint" are u, o, i, a, o, i. There are 6 yuan in total

CMS stands for Content Management System. It is a software application or platform that enables users to create, manage, and modify digital content without requiring advanced technical knowledge. CMS allows users to easily create and organize content

Arrays are linear data structures used to process data in programming. Sometimes when we are processing arrays we need to add new elements to the existing array. In this article, we will discuss several ways to add elements to the end of an array in PHP, with code examples, output, and time and space complexity analysis for each method. Here are the different ways to add elements to an array: Use square brackets [] In PHP, the way to add elements to the end of an array is to use square brackets []. This syntax only works in cases where we want to add only a single element. The following is the syntax: $array[] = value; Example

The page is blank after PHP connects to MySQL, and the reason why die() function fails. When learning the connection between PHP and MySQL database, you often encounter some confusing things...
