net start apache2.2
net stop apache2.2
如果你的电脑里还装有老版本的 Apache 的话,Monitor Apache Servers 也会监测到它。
开启服务后,在浏览器中键入:localhost,如果显示“It Works!”的话 则安装成功。 > PHP
官网:http://windows.php.net/download/
在下载的时候注意看右方的 Which version do I choose?
If you are using PHP with Apache 1 or Apache2 from apache.org you need to use the VC6 versions of PHP
If you are using PHP with IIS you should use the VC9 versions of PHP
VC6 Versions are compiled with the legacy Visual Studio 6 compiler
VC9 Versions are compiled with the Visual Studio 2008 compiler and have improvements in performance and stability. The VC9 versions require you to have the Microsoft 2008 C++ Runtime (x86) or the Microsoft 2008 C++ Runtime (x64) installed
Do NOT use VC9 version with apache.org binaries
VC9 versions of Apache can be fetched at Apache Lounge. We use their binaries to build the Apache SAPIs.
它告诉你应该选择什么版本的 PHP,因为使用的是 Apache, 故选择:VC6 x86 Thread Safe
其实上方还有一个:VC6 x86 Non Thread Safe 版本,我们最好选择第一个版本(线程安全版本),网上的资料是:
LoadModule php5_module D:/newVersionPhp/php-5.3.5/php5apache2_2.dll
AddType application/x-httpd-php .php3 .php
AddType application/x-httpd-php-source .phps
AddType application/x-httpd-php .po .py .pl .hu
# PHPIniDir
PHPIniDir "D:\newVersionPhp\php-5.3.5"
上面的 PHPIniDir 规定了php.ini 配置文件的搜索目录,这样就不用把 php.ini 放入 C:/windows 中了。
配置好了以后使用 phpinfo() 函数来检测是否安装成功。 > MySQL
官网:http://dev.mysql.com/downloads/
我下载的是:
MySQL Community Server(Current Generally Available Release: 5.5.9)MySQL Community Server is a freely downloadable version of the world's most popular open source database that is supported by an active community of open source developers and enthusiasts.DOWNLOAD
下载的话貌似需要免费注册一个帐号,注册吧!别犹豫!全名:Mysql-5.5.9.msi
提供了傻瓜式的安装。
之后启动服务和关闭服务类似于 Apache:
net start mysql
net stop mysql > 配置 PHP 支持 MySQL
我们使用 $php_path 来表明你的 PHP 的安装目录:
1) 将 $php_path\libmysql.dll 拷入 windows 的 system32 目录中;
2) 将 $php_path\ext\php_mysql.dl l 拷到 $php_path\ 下;
3) 重命名:$php_path\php.ini-production 为 php.ini ,这样的话 php.ini 才投入使用。
4) 设置 php.ini 的 extension_dir :
; Directory in which the loadable extensions (modules) reside.
; http://php.net/extension-dir
; extension_dir = "./"
; On windows:
; extension_dir = "ext"
extension_dir = "D:/newVersionPhp/php-5.3.5/ext"
5) 去掉 948 行之后每一行 extension 之前的分号。 > 测试 MySQL
可以写一个简单的脚本来测试是否已经配置好 PHP 和 MySQL:
<?php
$db_host = 'localhost';
$db_database = 'test';
$db_username = 'root';
$db_password = '123';
$connection = mysql_connect($db_host, $db_username, $db_password);
if (!$connection){
die ("Could not connect to the database: <br />". mysql_error());
}
else{
echo "connected successfully!";
}
?> > 安装 PEAR 扩展
刚开始使用的可能是老版本的 go-pear.php 来安装的,安装一直出错,最后在一个论坛上找到了原因:
QUOTE(Ric @ Jan 26 2011, 08:41 AM)
It looks as if go-pear.php v1.1.2 remains the latest version (as per Pear web-site).
However core and other elements have been updated while go-pear has been neglected.
Solution is to edit file:
UniServer\home\admin\www\plugins\pear\go_pear.php
Locate this section:
CODE
'PEAR.php' => 'http://svn.php.net/viewvc/pear/pear-core/branches/PEAR_1_4/PEAR.php?view=co',
'Archive/Tar.php' => 'http://svn.php.net/viewvc/pear/packages/Archive_Tar/tags/RELEASE_1_3_2/Archive/Tar.php?view=co',
'Console/Getopt.php' => 'http://svn.php.net/viewvc/pear/pear-core/branches/PEAR_1_4/Console/Getopt.php?view=co',
Change as shown below:
CODE
'PEAR.php' => 'http://svn.php.net/viewvc/pear/pear-core/branches/PEAR_1_6/PEAR.php?view=co',
'Archive/Tar.php' => 'http://svn.php.net/viewvc/pear/packages/Archive_Tar/tags/RELEASE_1_3_3/Archive/Tar.php?view=co',
'Console/Getopt.php' => 'http://svn.php.net/viewvc/pear/pear-core/branches/PEAR_1_6/Console/Getopt.php?view=co',
经过修改后的 go_pear.php 没有问题了,安装成功:
Starting installation ...
Loading zlib: ok
Bootstrapping Installer...................
Bootstrapping PEAR.php............(remote) ok
Bootstrapping Archive/Tar.php............(remote) ok
Bootstrapping Console/Getopt.php............(remote) ok
Extracting installer..................
Downloading package: PEAR.............ok
Downloading package: Structures_Graph....ok
Preparing installer..................
Updating channel "doc.php.net"
Update of Channel "doc.php.net" succeeded
Updating channel "pear.php.net"
Channel "pear.php.net" is up to date
Updating channel "pecl.php.net"
Update of Channel "pecl.php.net" succeeded
Installing selected packages..................
Downloading and installing package: PEAR.............ok
Installing bootstrap package: Structures_Graph.......ok
Downloading and installing package: Archive_Tar-stable.......ok
Downloading and installing package: Console_Getopt-stable.......ok
Downloading and installing package: PEAR_Frontend_Web-beta.......ok
Writing WebFrontend file ... ok
Installation Completed !
Note: To use PEAR without any problems you need to add your
PEAR Installation path (D:\newVersionPhp\PEAR/PEAR)
to your include_path.
Using a .htaccess file or directly edit httpd.conf would be working solutions
for Apache running servers, too.
For more information about PEAR, see:
PEAR FAQ
PEAR Manual
Thanks for using go-pear!
文件下载链接:http://files.cnblogs.com/catprayer/go-pear_new.rar
直接解压放入根目录运行即可,按照提示来安装。