466
для профессионалов ДЛЯ ПРОФЕССИОНАЛОВ РАЗРАБОТКА И ДИЗАЙН САЙТОВ Б. Уильямс Д.Дэмстра X. Стэрн @

Уильямс Б., Дэмстра Д., Стэрн Х. - WordPress Для Профессионалов (Для Профессионалов) - 2014

Embed Size (px)

DESCRIPTION

Уильямс Б., Дэмстра Д., Стэрн Х. - WordPress Для Профессионалов (Для Профессионалов) - 2014

Citation preview

  • . . X. @

  • ^

  • PROFESSIONAL

    WordPress9DESIGN AND DEVELOPMENT

    Second Edition

    Brad Williams

    David Damstra Hal Stern

    WILEY

    John Wiley & Sons, Inc.

  • WordPress

    . . X.

    ^

    - --

    2014

  • 32.988.02-018 004.738.5 36

    ., ., X.36 WordPress . .: , 2014. 464 .: . (

    ).ISBN 978-5-496-00948-5

    , , WordPress. WordPress CMS- , WordPress, - . WordPress , .

    CMS, , . -, , , . , .

    : , WordPress, , .

    12+ ( 29 2010 . 436-.)

    32.988.02-018 004.738.5

    Wrox Press Inc. . .

    , , , . , , , .

    ISBN 978-1118442272 . Copyright 2013 by John Wiley & Sons, Inc., Indianapolis, IndianaISBN 978-5-496-00948-5 , 2014

    , , 2014

  • .................................................................................................. 18

    ............................ 19

    ............................................................................................................ 20

    1. ........................................................................26

    2. ...........................................................................................50

    3. WordPress ......................................................72

    4. .......................................................................................... 90

    5. (Loop)....................................................................................... 108

    6. .......................................................................140

    7. , .............................................................. 156

    8. .................................................................. ....182

    9. ................................................................................. 255

  • 10. Multisite.................... 311

    11. ...................................................................... 342

    12. .............................................. 368

    13. , , ...............404

    14. WordPress ........................440

    6

  • .......................................................................................................... 18

    ............. 19

    ............................................................................................... 20

    .......................................................................................................20 .................................................................................... 21 ................................................................................................21 .................................................................................. 24.............................................................................................................. 24 ..............................................................................................................25.................................................................................................................... 25

    1. ........................................................... .....26

    WordPress?..................................................................................... 26 WordPress............................................................................................. 28

    ........................................... 28 ............... 30WordPress GPL.................................................................................................... 30

    ................................................................................................ 32WordPress ....................................................... 32 ............................................................................................ 34

    ............................................................................................................34 ............................................................................................35

  • 8

    ............................................................................................. 37 WordPress........................................................................ 37 ........................................................................... 40

    ................................................................................................................ 46 ............................................................................... 46 ....................................................................................................... 48

    ....................................................................................................................... 49

    2. .......................................................................................... 50

    ..................................................................................................................... 50 ................................................................................................... 50 .............................................................................................. 51 ......................................................................................................... 51

    .......................................................................................... 52 WordPress.................................................................................................. 53

    wp-config.php................................................................................................ 54 wp-config........................................................................ 56.htaccess................................................................................................................ 62 .maintenance................................................................................................. 67

    wp-content..................................................................... 68................................................................................................................68..................................................................................................................... 69 ..................................................................... 69 Upgrade.............................................................................................. 70 ............................................................ 70

    ....................................................................................................................... 71

    3. WordPress ......................................................72

    ............................................................................. 72 ................. 73 ?..................................................................................... 74

    .................................................... 75 ............................................................... 75 WordPress ...................................................... 77

    ....................................................................................................... 78 -......................................................... 78 ...................................................................................... 81 ......................................................... 83 .................................................. 83 ..................................................................... 86

  • 9

    ............................................................................... 87....................................................................................................................... 89

    4. .......................................................... 90

    ?....................................................................... 90 ......................................................................... 92

    ..................................................................................... 92 ...................................................................................................... 93 ..................................................................................................... 96 ..................... 99

    WordPress ............................................................................100 ?................................................................................................100 ........................................................................................100 .....................................................................................102API WordPress.......................................................................................................103 ....................................................................................................105

    !...............................................................................................105 ?.........................................................................................................106 .........................................................................106

    ......................................................................................................... 107

    \

    5. (Loop)................. 108

    .................................................................................................109 SQL...............................................................................110 WordPress.........................................................................112 ................................................................................112 ......................................................................................................114

    ............................................................................................................116 .......................................................................117 ..................................................................................................118

    ..............................................................................118 WP_Query........................................................................119 ......................................................................120 ...........................................................................123 query_posts() ...............................................................................124 get_posts() ..................................................................................126 ................................................................. 127 .........................................................................................129 .................................................................................................130

    ............................................................................................131 .....................................................................................................132

  • 10

    .............................................................. .....................................133 ...........................................................................................134 ......................................................................................................134 ?........................................................136

    .......................................................................................................136......................................................................................................................139

    6. ........... 140

    ....................................................................................................140 ............................................................... 142

    WordPress....................................................... 143 WordPress............................................................................144

    WordPress....................................................................................146 .............................................................................146 ......................................................................147 ...............................................................................................149

    .............................................................................151......................................................................................................................155

    7. , .............................................................................156

    WordPress.................................................................................156 ?..............................................................157 ......................................................157 .......................................................................163 .........................................................164 ...................................................165 ...............................................................................166

    WordPress...............................................................................................168 ...........................................................................168 ..............................................................................169 .................................................................169

    .........................................................................170 ................................................... 170 .................................................................170 ...........................................174 ......................................................175

    ...............................................................................................................177 ?........................................................................................177 .......................................................................... 178 ............................................................. 179

  • 11

    ..........................................................................................179 .................................................. 180

    .................................................................................. 181

    8. .................................................. 182

    ..................................................................................................183 ............................................................................. 183 .................................................................................184 ................................................................................................184 .......................................................................185..........................................................................................186 ..............................................................................................189

    ................................................................................................190 (Nonces)..............................................................................191 ................................................................................192

    : ....................................................................195 .............................................................................................196 -.................................................... 197 -.............................................................................199

    .................................................. ;................................................ 201 ................................................. 201 ..............................................................................................202 ......................................................................203 ............................................................................206

    WordPress.............................................................................................214 ............................................................................................. 214 ...............................................................................................218 ................................................................................................219 ............................................................................224 ............................................................................225 ........................................................................................227

    .................................................................................228 .................................................... 247

    ........................................................................................................247 ..................................................................................................247 readme.txt..................................................................................248 SVN......................................................................................................251 ........................................... 253 ................................................................... 253

    ............................................................................................................ 254

  • 12

    9. ............................................... 255

    ?........................................................................................ 255 .......................................................................................... 256

    FTP..................................................................................................257 .................................................................................................257

    ?.........................................................................................................258 ....................................................................................................258CSS.......................................................................................................................258 ........................................................................................259...............................................................................................................259

    ......................................................................................259 .......................................................................260 ................................................................................ 261

    . ....................................................................................262 : Style.css......................................................................................262 : Index.php............................................................................264 : index.php................................... 265

    : DRY........................................................................................266header.php............................................................................................................266footer, php..............................................................................................................268

    ... sidebar.php.......................................................................................................... 268 : .................................................... 269

    : ............................................................270 : front-page.php...................................... 271 : archive.php............................................................273 : category.php.......................................................... 275 : tag.php...............................................................277 .................................................................................. 278 : single.php.......................................................... 278 : page.php................................................................ 280 : attachment.php............................................280 ..............................................................................................281

    : .............................................. 282 404: 404.php...................................................................282author, php.............................................................................................................284comments.php............................................................................... 285 : functions.php................................... 286search.php............................................................................ ...............................289searchform.php .............................................................................................290 ......................................................................................................291

  • 13

    ..........................................................................292 .......................................... 292 .............................................. 293 Twenty Eleven........................................................................294

    ...........................................................................................295 ............................................................................................... 295 ............................................................ 298 ................................................................ 299 ................................................................................................. 300 .....................................................................................301

    .................................................................................301 ..........................................................306

    Bones...........................................................................................................307 Carrington.....................................................................................................308 Genesis.........................................................................................................308 Hybrid Core...................................................................................................308Roots....................................................................................................................309 StartBox.......................................................................................................309 Thematic......................................................................................................309

    ......................................................................................................................310

    10. Multisite........................................................................................... 311

    Multisite?....................................................................................................311 Multisite.........................................................................................312...............................................................................................................312 Multisite.........................................................................................313 Multisite...............................................................................................313

    .............................................................................................................315 ..............................................................................315 ....................................................... 315 ..................................... 317 ....................................................................................................317............................................................................................................318 ............................ 318

    Multisite.................................................. ,......................................319 ...........................................................................................319 ....................................................................................................319 .........................................................................................323 ..................................................................................327 Multisite............................................................................. 329 .............................................................................................335

  • 14

    ..........................................................................................338 .....................................................................................................339

    Multisite.......................................................................................339 Multisite........................................................................ 340 .......................................................................... 340

    ......................................................................................................................341

    11. ................................................. 342

    ............................................................................................. 343 .................................................................................... 345 ........................................................................... 346, ?.......................................................................347

    .......................................................................... 348 ........................................................................................... 349

    YouTube................................................................................ 350 Twitter................................................................................................351Google Maps......................................................................................................... 354 Facebook........................................................................................... 355 XML................................................................................ 355 ............................................................................................ 358

    .....................................................................................................................360 ........................................................................... 361 .......................................................................................... 362

    ........................................................................................... 365......................................................................................................................367

    12. .............................................. 368

    ............................................................... 369 .................................................................................................369 .................................................. 372 ................................................................................ 373 ...........................................................................................374 JavaScript......................................................................................376

    .....................................................................377 .................................................................................379 ................. ...:............................381

    ........................................................................................383 .................................................................................385 ........................................................................386

    - .............................................387 HTML .....................................................................................387

  • 15

    HTML....................................................................................................389............................................................................................. 390HTML5..................................................................................................................393CSS3.....................................................................................................................395

    ..............................................................................................396 .................................................................396 ...................................................................398

    -......................................... 399 .............................................................................................400 ..............................................................400 ............................................................................................. 401

    ......................................................................................................................403

    13. , , ............. 404

    ................................................................................................. 404AWStats............................................................................................................... 405Google Analytics................................................................................................... 408 WordPress JetPack....................., ..............................................................410

    .................................................................................................... 412 WordPress............................................................................. 413 -............................................... 414 WordPress............................................... 417 ................................................................................................... 418 MySQL............................................................................................419

    WordPress........................................................ 420 .......................................................................................................422

    .................................................................. 423 ............................................................ 424

    WordPress............................................................. 425........................................ ................................................................425 WordPress.......................................................... 426 .............................................. 427 ...................................................................... 427 ............................................ ;................................428 ......................................................................428 ....................... >........................................428 .........................................................429 SSL . 430 Apache....................................................................... 430 MySQL.......................................................................431 ................................. 431

  • 16 *

    \/155............................................................................ 435: .................. 436: .................................................................................................... 436: ......................................................................................................... 436: .................................................................................................... 437: ........................................................................................... 437: .................................................................................. 437 .........................................................................................................437 ......................................................................................... 439

    ......................................................................................................................439

    14. ........................440

    ............................................................................................. 440 .......................................................................... 442

    ............................................................ 443 ................................................................................................. 444

    .........................................................................................446 ................................................................................. 447 ............................................................................................ 449 ............................................................................ 450 .............................................................................................. 453

    .................................................................................. 457................................................................................................................457..................................................................................................................457 ...................................................................................... 458

    .................................................................... 459 \/155 ......................................................................................... 459 \/155.................................................................. 460

    ......................................................................................................................461

  • , , . , . , .

    , . .

    , .

    / iStock.ph.oto

  • WebDevStudios.com, WP Late Night, Professional WordPress (WordPress ) Professional WordPress Plugin Development ( WordPress). - 15 , 5 , WordPress. WordCamp WordPress WordCamp . http://strangework.com (@williamsba).

    - CU* Answers, , . , - - . , , WordPress -. Zend 5. http://ws.cuanswers.com, , -, -, . http://mirmillo.com, .

    - , , , . , Sun Microsystems, WordPress, , , - 5 . WordPress, , URL . , WordCamp. http://snowmanonfire.com (@freeholdhal).

    http://strangework.comhttp://ws.cuanswers.comhttp://mirmillo.comhttp://snowmanonfire.com

  • , , , , . , . WordPress , , .

    , , , , , , . , , ( ). .

  • ! , . WordPress -, . GPL MySQL. , , WordPress, , . WordPress, , , HTML .

    , , WordPress -, . WordPress , , ; - , CNN. , , - . , , , WordPress : , HTML?

    * WordPress. , , . , - , , . , , , , , WordPress , , .

    , WordPress ,

  • 21

    , , . , , , , WordPress. , , WordPress , WordPress, , , .

    , : , WordPress, , . WordPress . , , , , . WordPress, , , , , WordPress, .

    . 1-4 WordPress, , , WordPress . 5-9 WordPress, . , WordPress . , 10-14, .

    , .

    1 WordPress; ; , , ; WordPress.

    2 WordPress . URL

  • 22

    , HTML. , .

    3 WordPress WordPress . Microsoft Windows Apple. , , , , .

    4 , WordPress. , , . , .

    5 (Loop) , . WordPress MySQL, , , , . , , , MySQL. , , , WordPress.

    6 5 MySQL. , MySQL , WordPress. , MySQL, , , WordPress.

    7 , WordPress. WordPress. . , WordPress.

    8 , (hooks), (actions) (filters),

  • 23

    WordPress. , , . . , ; . WordPress WordPress.

    9 8, . , , CSS . , , , , , , , . .

    10 Multisite WordPress Multisite. Multisite, , , , . Multisite , .

    11 WordPress . - -, . -, WordPress API, WordPress , WordPress Facebook.

    12 WordPress, . , WordPress , - , Google. 11 WordPress, , . , WordPress.

    13 , , . WordPress , . , . , ,

  • 24

    , .

    14 WordPress , , WordPress , .

    HTML (CSS), . , , . , MySQL, , , , .

    HTML. ( , , vi ). , , WordPress , , , , .

    : , - WordPress. 1 WordPress, WordPress .

    , , WordPress , WordPress: . , ( ); , , .

    - Wrox:

    www.wrox.com/remtitle.cgi?isbn=9781118442272

    , .

    http://www.wrox.com/remtitle.cgi?isbn=9781118442272

  • 25

    --------------------------------------------------------------------------, , , , .

    -------------------------------------------------------------------------- , , , .

    :

    .

    : pers istence .properties.

    : .

    .

    , , , . , , www.wrox.com. :

    www.wrox.com/remtitle.cgi?isbn=9781118442272

    www.wrox.com .ZIP, .RAR , . , , .

    , . , . , , . , .

    , :

    www. wrox.com/remtitle.cgi?isbn=9781118442272

    Errata. .

    http://www.wrox.comhttp://www.wrox.com/remtitle.cgi?isbn=9781118442272http://www.wrox.com

  • :

    WordPress

    WordPress

    , WordPress

    , ! , -. WordPress, WordPress. , , .

    , , . , , WordPress, 2 .

    WordPress?

    WordPress , , . TypePad, Moveable Type, Google's Blogger Apache Roller, WordPress

  • WordPress? 27

    , () ().

    , , MySQL, , , , , . WordPress , URL. , , . WordPress, .

    WordPress : , GPL. b2/cafelog . WordPress , . WordPress 2003 MySQL ( ) . , .

    , , WordPress , , , , . WordPress , . , WordPress , .

    WordPress , . WordPress zedl.com () . Automattic - wordpress.com, , Akismet, WordPress Multisite Gravatar. Akismet , Automattic, . WordPress MU, WordPress Multisite wordpress.com WordPress. Gravatar , , . ,

  • 28 1.

    .

    WordPress . BuddyPress , WordPress , , , , WordPress. bbPress MySQL, ( ), WordPress, .

    WordPress WordPress 3.5, . WordPress , ( (Dashboard)); , , . WordPress, . . WordPress?

    WordPress . . 3 WordPress . . , . Automattic 2011 100 WordPress (http://en.wordpress.com/ stats/). , WordPress , , , , , WordPress. WordPress . Automattic 74 WordPress , wordpress.com (http://en.wordpress.com/stats/). 5 . 2008 WordPress 6300 , 2007 . 19 (http:// wordpress.org/news/2012/05/plugins-refreshed/). WordPress 1500 , , .

    , ,

    http://en.wordpress.com/http://en.wordpress.com/stats/

  • WordPress 29

    , . , . , , WordPress, .

    2011 WordPress, WordCamp -. WordPress WordPress , . -, , , WordPress. , WordPress :

    15 % 1 - WordPress.

    22 100 WordPress.

    200 .

    18 000 170 000 .

    wordpress.tv.

    WordPress , CNN, Wall Street Journal's All Things D, Reuters, Forbes , www.icanhazcheeseburger. com. WordPress 500 , GM, UPS Sony. . , WordPress, , . WordPress (http://en.wordpress.com/notable-users/).

    WordPress , , , - . WordPress , . WordPress . , . WordPress .

    ? wordpress.org : . wordpress.org/extend, , , .

    wordpress.org , . wordpress.org/hosting , ,

    http://www.icanhazcheeseburgerhttp://en.wordpress.com/notable-users/

  • 30 1.

    WordPress ( ).

    WordPress , . : .

    WordCamp , . . WordCamp wordcamp.org, WordCamp . WordCamp , , , , , . WordCamp WordPress. wordcamp.org, , WordCamp.

    , , WordCamp, WordPress Meetup ( WordPress), 200 ( 40, ) . meetup.com, , , wordpress.meetup.com, , .

    codex. wordpress.org. WordPress, , , WordPress, . WordPress, , , WordPress. , - .

    , , , ( ). : codex.wordpress.org/mailing_lists. : wp-docs , , wp-hackers , WordPress .

    WordPress GPL

    WordPress GNU (GPL), 2, licence.txt . WordPress .

  • WordPress 3 1

    - GPL , . .

    , , , . , , WordPress . , . : WordPress CNN Wall Street Journal, , , , , .

    GPL , GPL. GPL, , . GPL . , . WordPress, , , GPL . , WordPress , , .

    , WordPress .

    - . WordPress, , WordPress -- . wordpress.com, Google Linux-. WordPress - MySQL, , Apache WordPress; WordPress.

    ( , , - ), . .

  • 32 1.

    , . , - WordPress, . , , . , WordPress.

    GPL , WordPress. , , WordPress, WordPress. , . WordPress GPL, . , , , , . : , , . , GPL, , , , , , .

    , WordPress , , . WordPress , .

    , , , . , , , , WordPress . . , , . . ? ? : , ?

    WordPress

    : , (,

  • 33

    ), - . , , , , , , , .

    (CMS) , , , () () . CMS , , . WordPress .

    WordPress .

    Drupal Joomla . Drupal Joomla , , , . WordPress , , . . , . 14.

    WordPress . -- - (Model-View-Controller), . WordPress : 1) MySQL ;2) ;3) , . , WordPress , WordPress API. , , , HTML-, . , WordPress, (), (), , . WordPress, , 6.

    WordPress , , ( WordPress ).

  • 34 1.

    , .

    CMS . , . , , . , . , , , . , , , .

    . , ( , )? Twitter , WordPress Twitter. : Twitter WordPress, . Facebook, , Facebook . - , Google , . 11 WordPress , 12 , WordPress.

    , , ( WordPress , WordPress , , ). , :

    . . , .

  • 35

    . MySQL, , WordPress, ? SQL MySQL , , - .

    . - Apache , MySQL WordPress . , - , - . , , (, -), .

    , WordPress , WordPress MySQL - .

    WordPress, . wordpress.com, , Automattic multi-site- WordPress ( WordPress MU). , , . , MySQL WordPress . URL wordpress.com, URL, , , . , , .

    - www. word press, org, wordpress.com. WordPress MySQL -. . , .

    WordPress - , URL () MySQL. Apache WordPress, mod_php URL mod_rewrite. lighttpd (Lighty) Apache, URL . , IIS 7.0 Microsoft

  • 36 1.

    - URL_rew rite . URL - WordPress , URL, , , . URL MySQL, WordPress WordPress, 5. - , WordPress HTML , . htaccess, URL , . URL WordPress, , URL . 2, , WordPress.

    MySQL , MySQL , . MySQL, WordPress, MySQL. MySQL, . , -, - MySQL -. MySQL, , , . WordPress MySQL, , , WordPress MySQL . WordPress .

    . ( -) MySQL , , . MySQL , , MySQL , MySQL MySQL.

    WordPress , MySQL , WordPress , MySQL MySQL. , , .

  • 37

    . -, WordPress MySQL, , : , .

    WordPress , . , , , WordPress MySQL.

    ( , - MySQL ): WordPress -, URL . () .

    WordPress , , , . Mac OS X - Apache ( URL); MySQL www.mysql.conn , (www.mamp.info, phpMyAdmin), . , (www.apachefriends.org) , Windows, MacOS Linux. , . WordPress 3.

    WordPress

    WordPress www.wordpress.org, zip ( tarball), wordpress. WordPress -; , , . , , URL h ttp : / / example.com/wordpress , . , , WordPress , .

    , WordPress. -, -, ,

    http://www.mysql.connhttp://www.mamp.infohttp://www.apachefriends.orghttp://www.wordpress.org

  • 38 1.

    , public_html . , , , , (, , , !). - FTP-, , . zip wordpress, , WordPress http://example.com, http://example.com/ wordpress, , . , WordPress , , WordPress . .

    WordPress , - . 1.1 index. php wp-config- sample. php. WordPress, - .

    IS :\Useis\Sony\Downloads\woidprcss-3.5-ru__RU\woidpcess J g l xj Sony Downloads wordpress-3 5-fu. .RU wordpress

    -- . . w. - - -r-.~ --- ----- -

    ^ j : wordpress

    1 * j | J

    | wp-admin 26.11.2013 15:41

    *4

    I wp-content

    |\ wp-includes

    26.11.2013 15:41

    26.11.2013 15:41

    index.php 08.01.2012 17:01 "" 1

    4 license.txt 06.05.2012 7:28 20

    readme.html 11.12.2012 16:45 Chrome HTML Doc... 14 % wp-activate.php 17.11.2012 15:11 "" 5

    wp-blog-header.php 08.01.2012 17:01 "PHP" 1

    wp-comments-post. php 10.04.2012 17:21 "" 4

    wp-config-sample, php 11.12.2012 16:45 "" 5

    wp-cron.php 23.09.2012 16:57 "" 3

    wp-links-opml.php 23.10.2010 12:17 " 2

    wp-load.php 26.10.2012 19:40 "" 3

    wp-login.php 30.11.2012 13:41 "" 29

    wp-maH.php 25.09.2012 5:26 "" 8

    wp-settings.php 22.11.2012 9:52 "" 10

    wp-signup.php 11.09.2012 12:27 "" 18

    wp-tiackback.php 08.01.2012 17:01 "" 4

    xmlrpc.php 11.09.2012 20:11 " 3

    : 19

    : 19 . ...................

    . 1.1. , WordPress

    http://example.comhttp://example.com/

  • 39

    , wp- conf i g . php, WordPress . , WordPress , , , . 1.2 1.3, . MySQL, ,

    - conf ig . php . .

    ?

    wp-conf ig . php -,

    !

    . 1.2. WordPress wp-config,

    , -.

    wp_halstern , WP.

    wp_user1 MySQL

    foobar ... MySQL

    localhost lo ca lh o s t , -

    wp_hs WordPress , .

    . 1.3.

  • 40 1.

    WordPress ( wp_ ). , . , , , , WordPress , MySQL , .

    , HTML WordPress ? , , , , , . WordPress , , , WordPress. WordPress , in d e x .h tm l, . : in d e x .h tm l WordPress, index.php in d e x . html, Directory Index - . , , . , , , , WordPress . WordPress , URL , WordPress.

    - wp-config. php , URL , WordPress , -- WordPress , . 1.4. , - admin.

    , . 1.5, , .

    MySQL WordPress , , SQL . , .

    - MySQL , wp-config.php,

  • 41

    . MySQL, , , MySQL . , , . , , , .

    MySQL WordPress . , MySQL , MySQL WordPress, ,

    Wo r d Pr ess

    ! . , !

    , , , .

    jPork Roll and Friends

    , ,

    e-mail

    I WordPress |

    * , , , , 01.

    *. , !* 7 3 4 * 3 ).

    [email protected]

    ,

    .

    . 1.4. -

    mailto:[email protected]

  • 42 1.

    ( ^ I W o r d P r e s s

    WordPress ? , )

    halbstem

    .

    j

    . 1.5.

    WordPress. MySQL phpMyAdmin Chive, , MySQL , ( -) . MySQL , root Unix, root- Unix. MySQL MySQL, , MySQL. MySQL, , , , MySQL, MySQL (http://dev.mysql.com/doc/) , MySQL.

    WordPress . - , , MySQL. : , ( ) MySQL, MySQL. , . 1.3, wp_ , , , WordPress.

    WordPress MySQL? . , .

    1. - MySQL. MySQL wp- config. php , -

    http://dev.mysql.com/doc/

  • 43

    MySQL - . . MySQL MacOS MySQL /tm p/m ysq l.sock , - WordPress /v a r/m y sq l/m y sq l. sock PHP- MySQL. :# In -s /tmp/mysql.sock /var/mysql/mysql.sock

    MySQL ; . , , , . , , p r in t f ().

    w p-in c lu des/w p -db .php , , WordPress. (Error establishing database connection) , echo (m ysq l_ e rro r() ) , , . 1.6:

    if (!$this->dbh) { echo(mysql_error());

    $this->bail(sprintf(/*WP_I18N_DB_C0NN_ERR0R*/"Error establishing a database connection

    c.

    , -conf ig . php , loca lhost. ,

    , ?

    , ?

    , ?

    , , -. WordPress.

    . 1.6. mysql_error( )

    m ysq l_erro r( ) , , MySQL.

    2. WordPress MySQL, . MySQL, , -.

  • 44 1.

    , wp-config.php. MySQL 4.1 MySQL 5.0 , . MySQL 4.0. OLD_PASSWORD() WordPress , . SQL ( MySQL SQL ):

    SET PASSWORD FOR user@host = 0LD_PASSW0RD(password') ;

    user@host WordPress , a password () , .

    3. WordPress MySQL, . , - WordPress, , , . , mysql_error () wp-dp. php, :function select($db) {

    if (!@mysql_select_db({db, $this->dbh)) {$this->ready = false;

    echo(mysql_error());{this- >bail(sprintf(/*WP_I18N_DB_SELECT_DB*/'... Can't select database

    mysql_error(), , . 1.7, MySQL , . , MySQL, :% /usr/local/mysql/bin/mysql -u wp_userl -Enter password:Welcome to the MySQL monitor. Commands end with; or \g.Your MySQL connection id is 174Server version: 5.1.37 MySQL Community Server (GPL)mysql> show databases;------------------

    | Database------------------

    | information_schema |1 test jH------------------

    2 rows in set (0.00 sec)

    , MySQL, MySQL, , root- MySQL MySQL WordPress . -

  • 45

    ( , ), wp_halsternl

    , ?

    wp_useri wp_halsterni?

    , - usemamejvordpress. , ?

    , , - , WordPress.

    . 1.7. MySQL

    MySQL MySQL, , :

    mysql> create database wp_halstern;Query OK, 1 row affected (0.00 sec)

    : , MySQL WordPress. MySQL , . WordPress WordPress, . , WordPress.

    WordPress, , , wp-config.php. : , MySQL:mysql> use wp_halstern; show tables;Database changed-i------------------ h| Tables_in_wp_halstern |------------------+| wp_hs_comments *| wp_hs_links || wp_hs_options | wp_hs_postmeta | wp_hs_posts| wp_hs_term_relationships || wp_hs_term_taxonomy | wp_hs_terms| wp_hs_usermeta j| wp_hs_users------------------+10 rows in set (0.00 sec)

  • 46 1.

    wp_hs_; WordPress, , , . WordPress 6. , MySQL, .

    MySQL . , - WordPress. .

    , , . 1.4, WordPress, . 1.8.

    Pyrk d'ld Fnemb 1 + :, ha! stern

    (}

    &

    (

    @

    $

    1[$

    . 1.8.

    (Log In) URL , ,

    \/5$ 3.5 ! / 3.5 ,

    - . , .

    -

    /

  • 47

    wp-admin (exam ple. com/wp-admin), , . WordPress, .

    , , . , , WordPress, (Update), . WordPress ( w p-adm in/inc ludes/update .php , ).

    , MySQL, ro o t@ lo c a lh o s t , * - . , , . 11. w p -co n fig .php . , WordPress . URL : -, , . 1.8. MySQL, .

    , , URL WordPress, (Settings) (General), , WordPress. URL WordPress, , in d ex .p hp , , WordPress.

    , , , , , . , . .

    , , , .

  • 48 1.

    WordPress , . , QuickPress ( ) (, ) (Posts) (Add New), WordPress. . 1.9 . .

    Pottf Well and Friends rt V /

    * 'V *

    9 yj-j : iN U n L j lb

    g* e W o rd P re s s ! .

    5g) > :

    {1 '

    i l v " ' re *

    iMaJ2WC-iO&t.SWti $

    - & cpft 1)^..*ft.fi JteoCtftli

    $|

    Iff!

    . m u e 1

    1

    1 *

    1

    0 5 !

    A * 0 . noesi

    +.

    Twenty Twelve,

    ; ! ; :

    WordPress 3.5

    -

    WordPress , ! *

    W 1 . , WordPress

    ,\0> ! ! "?! { The B

  • 49

    , , (Writing options).

    (Publish), , , : , ! , , HTML. . .

    , WordPress , . WordPress . WordPress , , .

  • :

    WordPress

    wp-config.php .htaccess

    wp-content

    WordPress

    WordPress , , . , , WordPress .

    , WordPress , WordPress, wp-config. php . htaccess. , WordPress.

    WordPress , WordPress. .

    W ordPress WordPress.org, http://wordpress.org/download/.

    http://wordpress.org/download/

  • 51

    WordPress WordPress, (Updates), . (Download), WordPress .

    WordPress Subversion (SVN). Subversion . WordPress Subversion , . WordPress, http:// core.svn.wordpress.org/trunk/.

    SVN WordPress. . .

    SVN , WordPress. SVN () WordPress.

    WordPress zip la te s t . zip. WordPress tar la test.ta r .g z . , .

    zip tar :

    http://wordpress.org/latest.zip

    http://wordpress.org/latest.tar.gz

    . WordPress . , WordPress, wordpress- 3.5. zip. , WordPress .

    WordPress.org WordPress. WordPress 0.71. http://wordpress.org/download/release-archive/.

    , WordPress, , , , , . , ,

    http://wordpress.org/latest.ziphttp://wordpress.org/latest.tar.gzhttp://wordpress.org/download/release-archive/

  • 52 2.

    , . , WordPress.

    WordPress . , WordPress , , , . - WordPress. , WordPress .

    , WordPress, . WordPress WordPress , .

    WordPress , JavaScript CSS. . , , , , WordPress. WordPress WordPress.

    WordPress WordPress, . 2.1.

    W ordPress : w p-adm in , w p -c o n te n t w p-in c ludes . wp-admin wp- in c lu d e s , WordPress. wp-content , , . , WordPress. HTML- WordPress, , MySQL , , 6.

    WordPress . , , WordPress, . WordPress, . , WordPress , WordPress , , , , . -

  • WordPress 53

    jfc wp-admin 26.11.2013 15:41

    L wp-content 26.11.2013 15:41

    1, wp-indudes 26.11.2013 15:41

    j fndex.php 08.01.2012 17:01 "*'

    license.txt 06.05.2012 7:28

    readme.html 11.12.2012 16:45 Chrome HTML Document

    J] wp-activate.php 17.11.2012 15:11 ""J wp-blog-header.php 08.01.2012 17:01 ""

    J wp-comments-post.php 10.04.2012 17:21 ""

    J wp-conflg-sample.php 11.12.2012 16:45 ""

    3 wp-cron.php 23.09.2012 16:57 ""

    3 wp-links-opml.php 23.10.2010 12:17 ""

    J wp-load.php 26.10.2012 19:40 ""

    3 wp-logln.php 30.11.2012 13:41 ""

    j wp-mail.php 25.09.2012 5:26 ""

    3 wp-settings.php 22.11.2012 9:52 ""

    J wp-signup.php 11.09.2012 12:27 ""3 wp-trackback.php 08.01.2012 17:01 ""

    3 xmlrpcphp 11.09.2012 20:11 ""

    . 2.1. WordPress

    WordPress , .

    WordPress, wp- admin, wp-includes , , . , 4: !

    WordPress

    WordPress , . WordPress. , .

    , FTP, wp-config. php. . htaccess, , .

  • 54 2.

    wp-config.php

    WordPress wp-config.php. , , MySQL. . wp-config.php wp-config-sample.php. wp-config. php WordPress.

    wp-config. php WordPress. wp-config . WordPress :/public_html/my_website/wp-config.php

    :

    /public_html/wp-config.php

    WordPress wp-config , , , . , .

    -------------------------------------------------------------------------- w p -con fig .php WordPress , .

    WordPress , wp-config. php. :define( 1OPTION_NAME1, 'value' );

    OPTION_NAME , ; va lu e , . wp-config. php :

    /* , . ! */(/* That's all, stop editing! Happy blogging. */)

    \55* , , . (Error establishing a database connection), , DB_NAME, DB USER DB_PASSWORD . , DBJHOST . localhost, WordPress - MySQL , MySQL.

  • WordPress 55

    - , .

    (ch a rse t) , DB_CHARSET. u tf8 (Unicode UTF-8). .

    WordPress 2.2 DB_COLLATE , . ( , . , .) . , , . WordPress. WordPress.

    WordPress , w p -co n f ig . php . , () . WordPress, .

    w p -co n f ig .p h p WordPress.org (https://api. wordpress.org/secret-key/1.1/salt/), . 2.2. (put your unique phrase here). , 100 % .

    1 h t t p v /.'a p i.w o (d p r .o r g .T ( * \ *( + , > * / f 4 % - F t 5 ,

    t ; (3 https://api.wordpress.Org/secret-key/l.l/salt/

    d e f i n e ( * ADTH J Y ', ixPgiM K ) (_Uu3 ' DV, JuSXUD] 1 0I887w X fdF eK . o p l a ~ / S l g l _ M 6 Z | nO*TVs3S ) sd e f i n e ( SEC0RE_AUTH_XE Y * , x ~ -) '4 1 ) ;d e f i n e ( LOGGED~IN_KY', ( {OEv. G) D z JrU 8 d -h * 0 J L iS a H ln + I ! AsJW 8ascF ?S Y gez*cS 024?U -B , - T - /'R> ) ;d e f i n e ( *N0NCE_KEY , ' VndGE 9H dt + t o * z - / 1 m H M 5 6 (c 0 7 0 * iE q a p i< S t:< x i< z 'x + n /-y h -X e c ( O h .S B ');d e f i n e ( , AOTH_SA,T\ 8++at)cT lc)fd3RO kIO PfV +!G Y bU JO f0#|+lSG X 8K a Q p S .a f ) >8; q t> z < ) d e f i n e ( SECORE_ATH_SALT , / 7 J ZH 8JS!p< | SusR19)OOcOG7J9SDpchpIc3kM(CS_icNCUS 7RGw

  • 56 2.

    , SQL-, , , , SQL-. WordPress . WordPress, W P Security Scan (http://wordpress.org/extend/plugins/wp-security-scan/). , , .

    wp-config WordPress. W ordPress . WPLANG WordPress . , wp-content/languages ( ). ( ), WordPress . GNU gettext, - WordPress. , :

    WordPress (in Your Language) http:// codex.wordpress.org/WordPress_in_Your_Language

    WordPress (Language File Repository) http://svn.automattic.com/wordpress-il8n/

    WordPress , WP_DEBUG. , WP_DEBUG WordPress , . WP_DEBUG, true:

    define( 'WP_DEBUG', true );

    WordPress wp-config false . , fa lse . , , . WordPress WP_DEBUG , , .

    wp-config

    wp-config . , .

    WordPress , :

    define( 'WP_SITEURL', 'http://example.com/wordpress' ); define( WPHOME1, 'http://example.com/wordpress' );

    http://wordpress.org/extend/plugins/wp-security-scan/http://svn.automattic.com/wordpress-il8n/http://example.com/wordpress'http://example.com/wordpress'

  • WordPress 57

    WP_SITEURL URL WordPress. s i t e u r l , . WordPress s i t e u r l . WP_HOME , WordPress. URL, h t t p : // .

    -------------------------------------------------------------------------- , WordPress URL, new.example.com. , WordPress URL.

    2.6 , wp-content. :

    define( 'WP_C0NTENT_DIR', $_SERVER['DOCUMENT_ROOT] .'/wordpress/blog/wp-content' );

    define( 'WP_CONTENT_URL', 'http://domain.com/wordpress/blog/wp-content);

    WP_CONTENT_DIR w p-conten t. WP_CONTENT_URL URI . :

    define( 'WP_PLUGIN_DIR', $ SERVER['DOCUMENT_ROOT'] . '/blog/wp-content/plugins );define( 'WP_PLUGIN_URL', 'http://example/blog/wp-content/plugins');

    WP_PLUGIN_DIR WP_PLUGIN_URL , . , , wp-content. w p-content .

    WordPress . (Save) (Publish) WordPress . , 10 . 100 , 1.000 . , , , . , WordPress WP_POST_REVISIONS. fa ls e , , , . :

    define( 1WP_POST_REVISIONS', false ); define( 'WP_POST_REVISIONS1, 5 );

    http://domain.com/wordpress/blog/wp-content%e2%80%99http://example/blog/wp-content/plugins'

  • 58 2.

    , AUT0SAVE_INTERVAL. WordPress AJAX. 60 . wp-config. 5 , :define( 'AUTOSAVE_INTERVAL', 300 );

    SAVEQUERIES. , . , , WordPress . , , WordPress . , true :

    define( 'SAVEQUERIES', true );

    , :

    if ( current_user_can( 'manage_options' ) ) { global $wpdb;print_r( $wpdb->queries );

    >

    , . , . 9 .

    () wp-config. , php_error. log WordPress. log_errors :

    @ini_set( *log_errors','On' );@ini_set( 'display_errors','Off' );@ini_set( 'error_log','/public_html/wordpress/php_error.log' );

    , , WP_DEBUG, . d isp la y_e rro r s Off, , , . , . , e r ro r_ lo g -, WordPress.

    , WordPress, WP_MEM0RY_LIMIT.

  • WordPress 59

    WordPress , (Allowed memory size of xxxxx bytes exhausted). . :define( ' WP_NIEMORY_LIMIT', '32' );

    , . . , , - , .

    WordPress, , . , php_value m em ory_ lim it p h p .in i. , , , , , , .

    WordPress . WordPress , , . WPLANG WordPress :

    define ( WPLANG', 'en-GB' );

    , , ISO-639, ISO-3166. , en-GB (). . . .

    LANGDIR. , .. . WordPress w p-content/languages. , LANGDIR:

    define( 'LANGDIR', '/wp-content/bury/my/languages' );

    W ordPress .mo .

    CUSTOM_USER_TABLE CUSTOM_USER_META_TABLE . , WordPress . WordPress.

    define( 'CUSTOM_USER_TABLE', 'joined_users ); define( 'CUSTOM_USER_META_TABLE', 'joined_usermeta' );

    WordPress . , , ,

  • 60 2.

    , . . WordPress, .

    , WordPress, - , CUSTOM_USER_META_TABLE. , , , ( , . .).

    , C00KIE_D0MAIN, C00KIEPATH SITEC00KIEPATH. WordPress Multisite, . , :define( 'C00KIE_D0MAIN', .domain.com' ); define( 'COOKIEPATH', '/' ); define( 'SITECOOKIEPATH1, '/' );

    , , .

    , FTP wp-config. , , , WordPress FTP.

    FTP WordPress, wp-config :

    d e f i n e ( ' FTP_USER' , 'u se rnam e ' ); d e f i n e ( ' FTP_PASS' , 'p a s sw o rd ' ); d e f i n e ( 1FTP_HOST' , ' f t p . e xam p le .com :21 ' ) ;

    FTP, ! WordPress FTP .

    FTP/SSH :

    // : "direct", "ssh", "ftpext", "ftpsockets" define( 'FS_METHOD', 'ftpext' );// , WordPressabsolute path to root installation directorydefine( FTP_BASE', '/public_html/wordpress/' );// wp-contentdefine( 'FTP_CONTENT_DIR', '/public_html/wordpress/wp-content/ );// wp-pluginsdefine( 'FTP_PLUGIN_DIR ', '/ public_html /wordpress/wp-content/plugins/' );// SSHdefine( 'FTP_PUBKEY', '/home/username/.ssh/id_rsa.pub' );

  • WordPress 61

    // SSH define( 'FTP_PRIVKEY', '/home/username/.ssh/id_rsa' );// SSL- FTP, define( 1FTP_SSL', false )j

    , WordPress , FS_CHMOD_FILE FS_CHM0D_DIR:

    define( 'FS_CHMOD_FILE',0644 ); dfine( 'FS_CHMOD_DIR',0755 );

    (User), (Group) (World), -. WordPress , http://codex.wordpress.org/Changing_File_Permissions.

    , . , WordPress .

    WP_CACHE -. wp-content/advanced -cache, php. , :

    define( 'WP_CACHE', true );

    WordPress , . , , :

    print_r( @get_defined_constants() );

    WordPress. HTTPS, , , . SSL, F0RCE_SSL_L0GIN :

    define( 'FORCE_SSL_LOGIN', true );

    SSL. F0RCE_SSL_ADMIN:

    define( 'FORCE_SSL_ADMIN1, true );

    (/wp-adm in) SSL. , , , WordPress, SSL. , SSL. https, https://example.com. , SSL .

    http://codex.wordpress.org/Changing_File_Permissionshttps://example.com

  • 62 2.

    SSL WordPress . , WordPress, , WordPress.

    2.9 WordPress . , , , . , WordPress. 30 . . , EMPTY_TRASH_DAYS:

    define( 'EMPTY_TRASH_DAYS', 7 );

    7 . , 0. (Delete Permanently). , WordPress .

    WordPress cron. Cron WordPress . WordPress, . WordPress cron, wp - con f ig:

    define( 1DISABLE_WP_CRON', true );

    w p-config . WordPress . : http://codex. wordpress.org/Editing_wp-config.php.

    .htaccess . htaccess URL . WordPress , , , , http://example.com/?p=45. URL , . , WordPress URL , , .

    , WordPress, . 2.3. , , (Save Changes).

    http://codexhttp://example.com/?p=45

  • WordPress 63

    , WordPress . h taccess . WordPress , . WordPress . htaccess, , . 2.4.

    '' , ,

    h ttp :/ / lo c a lh o s t/tru n lc /? p 1 2 3

    h t tp : / / lo c a lh o s t /214/1/231*-p o s t/

    h t tp - . / / lo c a lh o s t/ t ru n k /2e iV e i/s e J* p le -p o s t/

    h t tp :/ / lo c e lh o s t / t ru n lc /e re h lv e s / l2 J

    h t tp : / / l o c a l h o s t / t runlc/sam ple-post/

    h t tp : / / lo c a lh o s t / t r u n k

    , - , .

    . 2.3. WordPress

    .h t a c c e s s .

    .h t a c c e s s c t r l + * .

    RewriteEngine On RewriteBase IRewriteRule NndexVphpS - [Li RewrtteCond %{REQUEST_FILENAME} !4 RewriteCond %{REQUEST_FILENAHE) !-d

    . 2.4. .htaccess

    , , ,

    /%year%/%monthnum%/%postname%/

    :

    http://example.com/2012/10/halloween-party/

    http://localhost/trunlc/?p%c2%ab123http://localhosthttp://locelhost/trunlc/erehlves/l2Jhttp://localhost/trunkhttp://example.com/2012/10/halloween-party/

  • 64 2.

    , :

    (SEO). URL SEO. .

    . , (WordPress, Drupal, Joomla!), .

    . URL, , . , .

    . - . URL .

    .htaccess

    - URL, , , HTML, . WordPress, w p -lo g in . php, . , example. com /2012/travel/ haddonf ie ld , - WordPress, URL , Haddonfield Travel. , , WordPress . .

    WordPress , .h ta c ce ss :

    RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [ L]

    . URL, , , . ! -f ! -d ; . h taccess , URL - . URL , WordPress, w p - lo g in . php, - (

  • WordPress 65

    ). , URL, , index. php, WordPress. , URL MySQL, 5.

    -------------------------------------------------------------------------- , , WordPress, , WordPress. , , wp-content: example.com/wp-content example.com/images. WordPress, . , URL , ? .htaccess , , WordPress. 404 URL. WordPress, WordPress (example.com/wordpress), .htaccess , URL -:

    RewriteRule Aimages/(.*) images/$l [L]

    , : URL, images, -. [L] : , , . , WordPress, .

    .htaccess URL. (About) http://example.com/about http://example. com/about-me, , , 404. URL , . URL , .

    301 :

    redirect 301 /about http://example.com/about-me

    WordPress URL , 5.

    .htaccess

    . htaccess , , URL. , . htaccess,

    http://example.com/abouthttp://examplehttp://example.com/about-me

  • 66 2.

    . , , :

    php_value memory_limit 64

    64 . :

    php_value upload_max_filesize 20 php_value post_max_size 20M

    , , 20 . 2 , . . htaccess, .

    .h ta cce ss . .h ta c ce ss 1-, , . IP-, .h ta cce ss :

    AuthllserFile /dev/null AuthGroupFile /dev/null AuthName "Access Control"AuthType Basicorder deny,allowdeny from all#IP address to whitelistallow from xxx.xxx.xxx.xxx

    xxx. xxx. xxx. xxx IP-, . a llo w from , , IP-, . IP-, .

    wp-admin. URL IP-, WordPress . , . htaccess wp-admin.

    , - , IP - . , . htaccess, IP-, . , , wp-admin.

  • WordPress 67

    IP-, . , 123.123.123. * , IP- , . , 123.123.123.110-230 IP- 123.123.123.110 123.123.123.230.

    .h ta c c e s s . p h p -e r ro r s . lo g WordPress. . h taccess , :

    php_flag display_startup_errors off php_flag display_errors off php_flag html_errors off php_flag log_ernors onphp_value error_log /public_html/php-errors.log

    , - . , , .

    .maintenance WordPress , .m aintenance. .maintenance WordPress . - WordPress. , .m aintenance :

    WordPress, . , : - . (Briefly unavailable for scheduled maintenance. Check back in a minute). time( ) UNIX.

    , m aintenance. php wp-content. WordPress . .

    W ordPress. .m a in te n a n c e ,

  • 68 2.

    \VordPress . , .

    wp-content

    wp-content WordPress. , WordPress .

    wp-content index.php. :

    ? . wp-contents. index.php , - , http://example.com/wp-contents, . , . , , WordPress , .

    WordPress , , wp-content.

    wp-content/plugins. . /p lug in s WordPress, , W ordPress. , .

    --------------------------------------------------------------------------, /plugins. - , WordPress , .

    http://example.com/wp-contents

  • wp-content 69

    w p-content /m u-p lug ins. (must-use plugins) , WordPress . , , . , , . , http:// codex.wordpress.org/Must_Use_Plugins.

    8 .

    wp-content/themes. -, WordPress , . index.php s t y le .c s s , , .

    WordPress , . . 9.

    WordPress w p -co n te n t/u p lo a d s . WordPress . WordPress.

    WordPress . , :

    /wp-content/uploads/2012/06/image.png

    - WordPress, /wp-content. WordPress /up loads . , /w p-content , 755. , FTP WordPress. uploads, (, NextGen Gallery, ), .

    WordPress Multisite . Multisite b lo g s . d i r . , (ID).

  • 70 2.

    , . Multisite . 10. , WordPress Multisite :

    /blogs.dir/1/files/

    .

    Upgrade w p-content/upgrade WordPress . WordPress WordPress, WordPress.org. WordPress . , . , WordPress .

    , , wp-content.

    Super Cache (http://wordpress.org/extend/plugins/wp-super-cache/) /w p-con ten t/cache . , HTML. , , - HTML. WordPress , , .

    Super Cache wp-content: advanced- cache.php w p-cache-con fig .php . Super Cache. , . , . Super Cache wp-content.

    NextGen Gallery (http:// wordpress.org/extend/plugins/nextgen-gallery/) /w p -co n te n t/ g a l le r y , NextGen. / g a l le r y . .

    http://wordpress.org/extend/plugins/wp-super-cache/

  • 71

    WP-DB Backup (http://wordpress.org/extend/plugins/wp-db-backup/) /w p-content/backup-b l58b ( 158 ), . (Save to Server), . , , .

    WordPress. WordPress: w p-con fig .php .h taccess, . , wp-content WordPress .

    WordPress , , .

    http://wordpress.org/extend/plugins/wp-db-backup/

  • WordPress

    :

    , , WordPress , , WordPress - , . 1, WordPress -. WordPress.

    (sandbox), , , , . WordPress . WordPress .

    . -, ,

  • 73

    , . , .

    ? , WordPress, , . .

    , , , . , , . . , : , . , , WordPress.

    , . , ( ) . . , , . , . , , Linux, , Microsoft Exchange, Windows.

    : . , . , . , , - , Windows, Mac OS X Linux. , , . WordPress .

    , , . ( ) , - . , .

  • 74 3. WordPress

    ?

    , , , , , . , .

    -, , , . , . , . - -.

    -, . , , , . , . -, , .

    . , WordPress, . , - , , . , - , , , , , , . , , , .

    . , . . , , . . FTP.

    , , . , , , , , . WordPress. , , , , . . .

  • 75

    WordPress. , WordPress. WordPress , . , WordPress, WordPress, - . WordPress, .

    . : , . , : . , .

    WordPress . - MySQL. .

    , WordPress, . WordPress -. , -. WordPress , . , - . ( ) Apache, , Microsoft IIS Nginx. WordPress 3.2 5.2.4. -, URL, . Apache mod_rewrite.

    WordPress . WordPress MySQL, 3.2 MySQL 5.0 . , MySQL . .

    . WordPress , , WordPress . LAMP (Linux, Apache, MySQL PHP). -,

  • 76 3. WordPress

    Facebook. WordPress. WordPress .

    , LAMP, L Linux. Linux , LAMP, Linux. , Debian , ap t-g e t i n s t a l l apache, - Apache. phpMyAdmin MySQL, ap t-g e t i n s t a l l phpmyadmin. phpMyAdmin -, Apache, MySQL. MySQL, , MySQL

    , Linux . , , . . , , , LAMP . .

    Mac OS X, . , , : Macintosh, Apache, MySQL . http://www.mamp.info.

    , . (Applications), . , . , , , Apache. - 80, , - 80 . 8888. , , -, http://localhost:8888. , 80.

    Windows, , WAMP PP. WAMP Windows http://wampserver.com. WAMP Windows, Apache, MySQL . Windows, - . http://www.apachefriends.org. X , , PERL, . .

    W Windows. Windows (Windows system tray) WAMPSERVER, .

    , , ,

    http://www.mamp.infohttp://localhost:8888http://wampserver.comhttp://www.apachefriends.org

  • 77

    -, WordPress. WAMP , . , . .

    WordPress , , WordPress. , , , . WordPress? , ? WordPress Multisite ? . WordPress.

    WordPress, Git Subversion, 2. http://wordpress.org.

    , WordPress, -. (Preferences) Apache. , . (Sites).

    WAMP c:\wamp\www. , www d ir e c to r y WAMPSERVER.

    WordPress .

    - http://localhost. , , . , WordPress , URL , http://localhost/ddamstra/Documents/www.

    - , WordPress , WordPress, . 3.1.

    WordPress, . WAMP, phpMyAdmin MySQL. WAMP , phpMyAdmin .

    http://wordpress.orghttp://localhosthttp://localhost/ddamstra/Documents/www

  • 78 3. WordPress

    , wp-config.php . .

    ? .

    wp-config. php -, . .

    I j

    . 3.1. WordPress

    , 5- WordPress, 1.

    , , . , , , , WordPress .

    , . , . , . LAMP.

    . , -, .

    -

    Apache . .

    , Apache : \www. . , , . :

  • 79

    : \ Users\ddamstra\Documents\www, Documents.

    . , , , . . WAMP Apache. h t tp d . conf, WAMPSERVER Apache.

    (DocumentRoot), , . 3.2.

    165

    16167168

    169

    h ttp d .c o n f (C : \w a m p \b in \a p K h f\A p c h e 2 .2 .H \< o n f) - GV1M

    fi le d rt T ools S yntax g o ffe rs W in d o w H elp

    a a &&:&&&! t ? * ServerNome gives the no me and port thot' the server uses to identify itself

    n T h is con often be determined automaticalty, but we recommend you specify 2 it explicitly to prevent problems during startup.

    2 If your host doesn't have a registered DNS name, enter its IP address here

    1 7 %

    171172173174175176177178179180 181 102 1S3 1844$___httpd.conf

    Serve rN am e lo c a lh o s t : 8

    2 DocumentRoot: The directory out of which you will serve your 2 documents . By default, alt requests are taken from t h i s directory, but 2 symbolic links and aliases may be used to point to other locations .

    2DocumentRoot "c:fwomp/wwwf ,Docum entRoo t " C : \ U s e r 5 \d d a m s tra \D 0cum ents\www"

    4 Each directory to which Apache has access can be configured with respect # to which services and features are allowed and/or disabled in that 2 directory (and its subdirectories).

    a, a- 1

    . 3.2. Apache

    , , . 3.3.

    WAMP Apache ( ), . , , .

    , , . . ,

  • 80 3. WordPress

    t g httpd.conf ,C:\amp\bcn\apache\Apache2.2.11\conf) - GVIM

    j f i le d it X ools S yntax gutters

    a o ' Q f i ! Deny fro m a l l

    / D ir e c to r y

    Window Help& S.

    ' Note that from this point forward you m ust specifically allow ' particular features to be enabled - so if something's net working os you might expect, make sure that you have specifically enobled i t below.

    4 This should be changed to whatever you set DocumentRoot to.

    D ir e c t o r y "C :\U se rs\ddam stra \D ocum en ts \w w w ">

    4 Possible values for the Options directive are "None", "Alt",4 or any combination of :4 Indexes Includes FoLLowSymLinks SymLinksifOwner,Natch ExecCGI NultiVi

    4 Note that "MultiViews" must be named *explicitly* - - - "Options All" 4 doesn't give it to you.

    2 3 4 ,4 6

    . 3.3. Apache

    ... _c ,.f :I File dit Io o ls Syntax gutters W indow Plugin Help

    ja S Q ,6h t tp d .c o n f [

    11; I n c lu d e " c : /w a m p /a l ia s /* "3 D ir e c t o r y ~ " . * \ . s v n *>

    O rd e r a l lo w ,d e n y Deny fro m a l l S a t i s f y A l l

    I .j< /D ire c tc rry>

    D ir e c to r y - s q l* * O rd e r a l l o w , deny Deny from a l l S a t i s f y A l l

    ;< /D ire c to ry

    i< D ir e c to r y K a tc h A/ .* / \ _ n o t e s / " > O rde r d e n y ,a l lo w Deny from a l l

    1 / D ir e c to r y K a t c h

    j< F i 1 e sM a tch ,,\ . s t e S ' ,>i h t t p d . c o n f i m 96K

    . 3.4. .svn Apache

    . ? , Git Hub, , wp - conf ig . php . , ,

  • 81

    , . , Subversion, , . , Apache. Apache , . svn, , . 3.4, httpd.conf.

    . . , .

    1, , . . , , , .

    php. ini. WAMP, WAMP, . E_ALL E_STRICT, . 3.5.

    1 php.in i * {C:\wamp\bin\php\php5.2.9 2) GVIm I j H99'

    * d it Tools Syntax Suffers W indow Help

    a i [ & & ? ?

    340341

    - Show alt e r r o r s , except for notices and coding standards warnings * 1

    342 - 34 3

    ;errarreparting * E^ALL 8, ~ENOTICE

    1344

    345

    Show alL e r r o r s , except for notices

    346 ;errcrreporting = E_ALL & ~ENOTICE { E_STRICT

    1 347u s

    348 1 349

    - Shew only errors

    350 351

    e r r o r , report ing = E_CPIL E_ ERROR / E_ RECOVERABL EERROR / E_ ERROR / ECORE ERROR

    352: 353

    Show alL errors, except coding stohdords warnings

    354 ! 355

    ir-crreport ing E_ALL ! E_STRICT

    ! 356 Print out errors (as a part of the output). For production web sites,} 357 you're strongly encouraged to turn this feature off, and u s e error leggir

    j 358 instead (see below). Keeping dispLoyerrors enabCed on a production web site

    359 may reveal security informt ion to end users, such os file paths on ycur :eb

    . 3.5.

  • 82 3. WordPress

    5.4 E_ALL. , , , . : Apache, .

    , , API. , php $_SERVER[] Windows Linux. Windows , Linux. , . , .

    WordPress. , WordPress . -.

    WordPress,