MySQL 5.0.51a
PHP 5.2.5
Apache HTTP Server 2.2.8
phpMyAdmin 2.11.4
, Windows XP,
, ,
, -: Apache, MySQL, PHP phpMyAdmin.
2007
, ,
HTML, ,
? , HTML
.
.
? , HTML , ,
. JavaScript, CSS, DHTML XML.
PHP,
. ,
MySQL -.
,
.
,
. , ,
Windows XP, , - Apache,
Unix , ,
.
,
, ,
,
-. .
:
, .
.
"/", "\",
Windows ( Unix
).
MySQL 5.0.51a
: http://www.mysql.com/
: http://dev.mysql.com/downloads/mysql/5.0.html
"Windows ZIP/Setup.EXE (x86)" ,
Setup.exe.
, - .
"Custom".
MySQL.com,
"Create a new free MySQL.com account" ( ). "Skip Sign-Up"
.
MySQL .
- "Detailed Configuration".
"Developer Machine". ? :)
InnoDB.
MySQL. "Decision Support (DSS)/OLAP",
,
.
- "root". . , ,
.
8
"my.ini".
1) [client], :
port=3306
:
character-sets-dir="C:/Program Files/MySQL/MySQL Server 5.0/share/charsets"
2) [mysqld], :
port=3306
, ,
MySQL:
character-sets-dir="C:/Program Files/MySQL/MySQL Server 5.0/share/charsets"
init-connect="SET NAMES cp1251"
3) , :
default-storage-engine=INNODB
:
default-storage-engine=MYISAM
"my.ini".
MySQL .
PHP 5.2.5
: http://www.php.net/
( "PHP 5.2.5 zip package" ): http://www.php.net/downloads.php
.chm,
: http://www.php.net/download-docs.php
( "C:\php").
- "php.ini-recommended"
( ), "php.ini"
.
php.ini
1) ( Off On) :
short_open_tag = On
display_errors = On
register_globals = On
register_long_arrays = On
2) :
post_max_size = 8M
16 POST, :
post_max_size = 16M
3) :
;include_path = ".;c:\php\includes"
, . ( !
):
include_path = ".;c:\php\includes"
"C:\php\includes", .
4) :
extension_dir = "./"
:
extension_dir = "C:/php/ext"
5) :
;upload_tmp_dir =
:
upload_tmp_dir = "C:/php/upload"
"C:\php\upload", HTTP.
10
-
6) :
upload_max_filesize = 2M
16 :
upload_max_filesize = 16M
7) , , :
extension=php_curl.dll
extension=php_gd2.dll
extension=php_mbstring.dll
extension=php_mcrypt.dll
extension=php_mysql.dll
extension=php_mysqli.dll
8) :
;session.save_path = "/tmp"
:
session.save_path = "C:/php/tmp"
"C:\php\tmp" .
php.ini.
PHP PATH
. "Start" ("") -> "Control Panel" (" ") ->
"System" (""), "Advanced" (""), "Environment
Variables" (" "), "System Variables" (" ")
"Path", "Variable Value" (" "),
, PHP, , "C:\php" ( ).
.
PHP
"bin" MySQL. ,
.
Path:
%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\php;C:\Program
Files\MySQL\MySQL Server 5.0\bin
PHP .
:
php_curl.dll ,
, -.
php_gd2.dll , .
PHP HTML ? ! PHP ,
.
php_mbstring.dll - ,
(, , ), (UTF-8)
.
php_mcrypt.dll
, DES, TripleDES, Blowfish .
php_mysql.dll -
MySQL.
php_mysqli.dll
PHP MySQL 4.1.3 .
PHP. ,
, ,
, ,
PHP.
11
, .
12
"Typical" .
.
, , ,
, Apache. , . :)
13
-
"Open Services".
"Apache2.2" ,
"General" ("") - "Startup type: Manual"
(" : "). ,
. , -,
, , ,
.
"apache" -
(), "error.log" ( ,
), "access.log" ( ).
"apache" - "localhost", , ,
"www", . ,
,
Unix, .
, , Apache,
"conf\httpd.conf", Apache.
. , .
, . :)
"httpd.conf"
1) mod_rewrite (
"#") :
LoadModule rewrite_module modules/mod_rewrite.so
2) PHP , :
LoadModule php5_module "C:/php/php5apache2_2.dll"
3) PHP, :
PHPIniDir "C:/php"
4) :
DocumentRoot "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs"
( ):
DocumentRoot "C:/apache"
5) :
<Directory />
Options FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
</Directory>
:
<Directory />
Options Includes Indexes FollowSymLinks
AllowOverride All
Allow from all
</Directory>
14
-
6) (
), :
<Directory "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
7) :
<IfModule dir_module>
DirectoryIndex index.html
</IfModule>
:
<IfModule dir_module>
DirectoryIndex index.html index.htm index.shtml index.php
</IfModule>
8) :
ErrorLog "logs/error.log"
(
):
ErrorLog "C:/apache/error.log"
9) :
CustomLog "logs/access.log" common
:
CustomLog "C:/apache/access.log" common
10) SSI ( ) ,
<IfModule mime_module>, :
AddType text/html .shtml
AddOutputFilter INCLUDES .shtml
11) , <IfModule mime_module>, :
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
12) , , :
Include conf/extra/httpd-autoindex.conf
Include conf/extra/httpd-vhosts.conf
Include conf/extra/httpd-manual.conf
Include conf/extra/httpd-default.conf
"httpd.conf"
"httpd-vhosts.conf", "conf\extra",
:
, ,
:
<VirtualHost *:80>
DocumentRoot "C:/apache/localhost/www"
ServerName localhost
ErrorLog "C:/apache/localhost/error.log"
CustomLog "C:/apache/localhost/access.log" common
</VirtualHost>
15
-
:
"httpd-vhosts.conf", , , :
<VirtualHost *:80>
# , .
DocumentRoot "C:/apache/test.ru/www"
# .
ServerName test.ru
# ( ) .
ServerAlias www.test.ru
# , .
ErrorLog "C:/apache/test.ru/error.log"
# .
CustomLog "C:/apache/test.ru/access.log" common
</VirtualHost>
"apache", "test.ru" ( , ), , ,
"www".
C:\WINDOWS\system32\drivers\etc\hosts .
:
127.0.0.1 test.ru
127.0.0.1 www.test.ru
Apache "Restart", "Start" (""),
, "test.ru" "www.test.ru"
. ,
("www.test.ru", ),
: "127.0.0.1 www.test.ru", "hosts".
Apache, , "http://localhost/manual/".
- Apache .
, "hosts" ,
, Apache, MySQL,
"hosts" : ,
.
"C:\apache" :
"vhosts-off.txt" "hosts" "vhosts-on.txt"
. ,
"vhosts-on.txt", C:\WINDOWS\system32\drivers\etc\hosts.
.
"vhosts-off.txt" ( ):
127.0.0.1
localhost
localhost
www.test.ru
test.ru
16
-
"C:\apache", : "start-webserver.bat"
"hosts", "stop-webserver.bat"
"hosts".
, "start-webserver.bat":
@echo off
echo.
if not exist C:\apache\vhosts-on.txt goto no_vhosts
echo Create virtual hosts:
copy /v /y C:\apache\vhosts-on.txt C:\WINDOWS\system32\drivers\etc\hosts
echo.
:no_vhosts
NET start Apache2.2
NET start MySQL
, "stop-webserver.bat":
@echo off
echo.
if not exist C:\apache\vhosts-off.txt goto no_vhosts
echo Restore hosts file:
copy /v /y C:\apache\vhosts-off.txt C:\WINDOWS\system32\drivers\etc\hosts
echo.
:no_vhosts
NET stop Apache2.2
NET stop MySQL
,
"C:\apache" "vhosts-on.txt" "vhosts-off.txt".
Apache Motinor,
Apache, "start-webservermonitor.bat", "start-webserver.bat"
:
start "" "C:\Program Files\Apache Software
Foundation\Apache2.2\bin\ApacheMonitor.exe"
"start-webservermonitor.bat", "start-webserver.bat", "stop-webserver.bat".
, "C:\apache",
, , .
17
phpMyAdmin 2.11.4
: http://phpmyadmin.net/
( all-languages.zip ): http://phpmyadmin.net/home_page/downloads.php
: http://php-myadmin.ru/
, phpMyAdmin
MySQL. ,
. ,
, . :)
Apache "Stop" "Start" (""),
"stop-webserver.bat".
"C:\apache\localhost\www\". , ,
"phpmyadmin". , "C:\apache\localhost\www\phpmyadmin" "config.inc.php"
( "root",
MySQL):
<?php
$i = 0;
$i++;
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['compress'] = false;
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = ''; // root
?>
, phpMyAdmin,
"mysqli", MySQL 5, PHP 5,
.
, "httpd.conf" :
<IfModule alias_module>
:
Alias /pma "C:/apache/localhost/www/phpmyadmin"
"start-webserver.bat"
"localhost/phpmyadmin". phpMyAdmin
MySQL.
Apache ( ), phpMyAdmin ,
:
" /pma". : "http://www.test.ru/pma".
phpMyAdmin,
, ,
.
18
-
"phpmyadmin"
, "Import"
(""), , "File to import" (" ")
"Browse..." ("..."), "create_tables_mysql_4_1_2+.sql",
"scripts", "Go" ("OK").
"pma"
, "Privileges" (""),
"Add a new User" (" "), "Login Information"
(" ") :
User name ( ): pma
Host (): localhost
Password ():
"Go" ("OK").
, "Database-specific privileges" (" ")
"Add privileges on the following database:" ("
") "phpmyadmin". , "Databasespecific privileges" (" "), "Data" (""),
: SELECT, INSERT, UPDATE, DELETE "Go" ("OK").
phpMyAdmin
"config.inc.php" .
:
<?php
$i = 0;
$i++;
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['compress'] = false;
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = ''; // root.
$cfg['Servers'][$i]['controluser'] = 'pma'; //
.
$cfg['Servers'][$i]['controlpass'] = ''; // .
$cfg['Servers'][$i]['pmadb'] = 'phpmyadmin';
$cfg['Servers'][$i]['bookmarktable'] = 'pma_bookmark';
$cfg['Servers'][$i]['relation'] = 'pma_relation';
$cfg['Servers'][$i]['table_info'] = 'pma_table_info';
$cfg['Servers'][$i]['table_coords'] = 'pma_table_coords';
$cfg['Servers'][$i]['pdf_pages'] = 'pma_pdf_pages';
$cfg['Servers'][$i]['column_info'] = 'pma_column_info';
$cfg['Servers'][$i]['history'] = 'pma_history';
$cfg['Servers'][$i]['designer_coords'] = 'pma_designer_coords';
?>
phpMyAdmin.
. phpMyAdmin ,
- . . - . :)
19
, ,
. - .
, .
- . !
PHP Expert Editor - http://www.ankord.com/
PHP ( ).
PSPad http://www.pspad.com/
.
htmlbook.ru - http://htmlbook.ru/
HTML CSS, .
INTUIT.ru - http://www.intuit.ru/
. ""
-
.
PHP Inside - http://phpinside.ru/
-.
,
http://php-myadmin.ru - .
.
20