为了装上这整套东东花了我两个晚上,真够要命的,我想说一下安装过程中的心得,首先说安装顺序
1、apache
直接点击安装包直到finish,然后打开浏览器输入http://localhost,进行测试,如果页面显示It works。说明你的apache安装成功,没有问题。
2、php
安装php5,花了我很久的时间,不知道是不是开始下个安装包有问题(这两天也真够背的,上次下个js库也是库有问题害的我耍了半天最后重新下了个才解决了),后来下了个免安装的直接解压(然后有很多扩展程序)。
3、更改apache配置文件
这里主要是需要加载相应的php模块,在#LoadModule的最后一行加上这两句,这里第一句目录改成你相应的目录
LoadModule php5_module D:/phpServer/php5/php5apache2_2.dll
AddType application/x-httpd-php .php
4、将php.ini文件拷贝到系统的windows目录下,我的是c:\windows
5、然后在apache的存放网页目录下建立一个php页面,放入如下测试代码,
<?php
phpinfo();
?>
然后再浏览器中打开此页面,显示出你的版本信息说明php安装成功。
6、安装mysql
7、安装phpmyadmin
这里只需要将phpmyadmin的文件解压到apache的网页目录下,然后需要使得php支持mysql,需要更改开始在c:\windows下php.ini的文件,首先找到 extension_dir= 这一项,后面的目录改成你的php扩展目录,像我的是
extension_dir = "d:\phpserver\php5\ext" ,并把后面extension=php_mysql.dll前面的分号去掉,这里;是注释
然后找到你的phpmyadmin目录,在其中有个config目录需要将这个目录删除并在根目录下建一个以config.inc.php为名字文件,并在其中添加连接mysql配置连接信息,
1
<?php
2
/* vim: set expandtab sw=4 ts=4 sts=4: */
3
/**
4
* phpMyAdmin sample configuration, you can use it as base for
5
* manual configuration. For easier setup you can use scripts/setup.php
6
*
7
* All directives are explained in Documentation.html and on phpMyAdmin
8
* wiki <http://wiki.cihar.com>.
9
*
10
* @version $Id: config.sample.inc.php 10142 2007-03-20 10:32:13Z cybot_tm $
11
*/
12
13
/*
14
* This is needed for cookie based authentication to encrypt password in
15
* cookie
16
*/
17
$cfg['blowfish_secret'] = ''; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */
18
19
/*
20
* Servers configuration
21
*/
22
$i = 0;
23
24
/*
25
* First server
26
*/
27
$i++;
28
/* Authentication type */
29
$cfg['Servers'][$i]['auth_type'] = 'cookie';
30
/* Server parameters */
31
$cfg['Servers'][$i]['host'] = 'localhost';
32
$cfg['Servers'][$i]['port'] = '3306';
33
$cfg['Servers'][$i]['connect_type'] = 'tcp';
34
$cfg['Servers'][$i]['compress'] = false;
35
/* Select mysqli if your server has it */
36
$cfg['Servers'][$i]['extension'] = 'mysql';
37
/* User for advanced features */
38
// $cfg['Servers'][$i]['controluser'] = 'pma';
39
// $cfg['Servers'][$i]['controlpass'] = 'pmapass';
40
/* Advanced phpMyAdmin features */
41
// $cfg['Servers'][$i]['pmadb'] = 'phpmyadmin';
42
// $cfg['Servers'][$i]['bookmarktable'] = 'pma_bookmark';
43
// $cfg['Servers'][$i]['relation'] = 'pma_relation';
44
// $cfg['Servers'][$i]['table_info'] = 'pma_table_info';
45
// $cfg['Servers'][$i]['table_coords'] = 'pma_table_coords';
46
// $cfg['Servers'][$i]['pdf_pages'] = 'pma_pdf_pages';
47
// $cfg['Servers'][$i]['column_info'] = 'pma_column_info';
48
// $cfg['Servers'][$i]['history'] = 'pma_history';
49
// $cfg['Servers'][$i]['designer_coords'] = 'pma_designer_coords';
50
51
/*
52
* End of servers configuration
53
*/
54
55
/*
56
* Directories for saving/loading files from server
57
*/
58
$cfg['UploadDir'] = '';
59
$cfg['SaveDir'] = '';
60
$cfg['blowfish_secret'] = 'yukun';
61
?>
62
然后就可以连接到Mysql中了,对于连接postgresql的配置文件不同,是在其中的conf文件夹里,配置文件
<?php

/**
* Central phpPgAdmin configuration. As a user you may modify the
* settings here for your particular configuration.
*
* $Id: config.inc.php-dist,v 1.49 2006/08/04 20:42:24 xzilla Exp $
*/

// An example server. Create as many of these as you wish,
// indexed from zero upwards.

// Display name for the server on the login screen
$conf['servers'][0]['desc'] = 'PostgreSQL';

// Hostname or IP address for server. Use '' for UNIX domain socket.
// use 'localhost' for TCP/IP connection on this computer
$conf['servers'][0]['host'] = 'localhost';

// Database port on server (5432 is the PostgreSQL default)
$conf['servers'][0]['port'] = 5432;

// Database SSL mode
// Possible options: disable, allow, prefer, require
$conf['servers'][0]['sslmode'] = 'allow';

// Change the default database only if you cannot connect to template1.
// For a PostgreSQL 8.1 server, you need to set this to 'postgres'.
$conf['servers'][0]['defaultdb'] = 'template1';

// Specify the path to the database dump utilities for this server.
// You can set these to '' if no dumper is available.
$conf['servers'][0]['pg_dump_path'] = '/usr/bin/pg_dump';
$conf['servers'][0]['pg_dumpall_path'] = '/usr/bin/pg_dumpall';

// Slony (www.slony.info) support?
$conf['servers'][0]['slony_support'] = false;
// Specify the path to the Slony SQL scripts (where slony1_base.sql is located, etc.)
// No trailing slash.
$conf['servers'][0]['slony_sql'] = '/usr/share/pgsql';

// Example for a second server (PostgreSQL for Windows)
//$conf['servers'][1]['desc'] = 'Test Server';
//$conf['servers'][1]['host'] = '127.0.0.1';
//$conf['servers'][1]['port'] = 5432;
//$conf['servers'][1]['sslmode'] = 'allow';
//$conf['servers'][1]['defaultdb'] = 'template1';
//$conf['servers'][1]['pg_dump_path'] = 'C:\\Program Files\\PostgreSQL\\8.0\\bin\\pg_dump.exe';
//$conf['servers'][1]['pg_dumpall_path'] = 'C:\\Program Files\\PostgreSQL\\8.0\\bin\\pg_dumpall.exe';
//$conf['servers'][1]['slony_support'] = false;
//$conf['servers'][1]['slony_sql'] = 'C:\\Program Files\\PostgreSQL\\8.0\\share';

// Default language. Eg: 'english', 'polish', etc. See lang/ directory
// for all possibilities. If you specify 'auto' (the default) it will use
// your browser preference.
$conf['default_lang'] = 'auto';

// AutoComplete uses ajaxy interaction to list FK options on insert fields
// It currently only works on single column foreign keys. You can control
// it's behavior with the following settings.
// 'default on' enables AutoComplete and turns it on by default.
// 'default off' enables AutoComplete but turns it off by default.
// 'disable' disables AutoComplete.
$conf['autocomplete'] = 'default on';
// If extra login security is true, then logins via phpPgAdmin with no
// password or certain usernames (pgsql, postgres, root, administrator)
// will be denied. Only set this false once you have read the FAQ and
// understand how to change PostgreSQL's pg_hba.conf to enable
// passworded local connections.
$conf['extra_login_security'] = true;

// Only show owned databases?
// Note: This will simply hide other databases in the list - this does
// not in any way prevent your users from seeing other database by
// other means. (eg. Run 'SELECT * FROM pg_database' in the SQL area.)
$conf['owned_only'] = false;

// Display comments on objects? Comments are a good way of documenting
// a database, but they do take up space in the interface.
$conf['show_comments'] = true;

// Display "advanced" objects? Setting this to true will show types,
// operators conversions, languages and casts in phpPgAdmin. These
// objects are rarely administered and can clutter the interface.
$conf['show_advanced'] = false;

// Display "system" objects?
$conf['show_system'] = false;

// Display reports feature? For this feature to work, you must
// install the reports database as explained in the INSTALL file.
$conf['show_reports'] = true;

// Only show owned reports?
// Note: This does not prevent people from accessing other reports by
// other means.
$conf['owned_reports_only'] = false;

// Minimum length users can set their password to.
$conf['min_password_length'] = 1;

// Width of the left frame in pixels (object browser)
$conf['left_width'] = 200;
// Which look & feel theme to use
$conf['theme'] = 'default';
// Show OIDs when browsing tables?
$conf['show_oids'] = false;
// Max rows to show on a page when browsing record sets
$conf['max_rows'] = 30;

// Max chars of each field to display by default in browse mode
$conf['max_chars'] = 50;

// Send XHTML headers? Unless debugging, it's best to leave this off
$conf['use_xhtml'] = false;

// Base URL for PostgreSQL documentation.
// '%s', if present, will be replaced with the PostgreSQL version
// (7, 7.1, 7.2, 7.3, 7.4, or 8.0)
$conf['help_base'] = 'http://www.postgresql.org/docs/%s/interactive/';
/*****************************************
* Don't modify anything below this line *
*****************************************/

$conf['version'] = 17;

?>
