Вы находитесь на странице: 1из 506

1-:


....................................................................................................................... 6
1.

................................................................................ 7

..............................................................................................................................7
............................................................................................................. 12

2.

.......................................................................... 21

...................................................................................................... 21
................................................................21
.
.............................................................................................................................................................25

............................................................................................................ 27
..................................................................................................................................27

W INDOWS- ............................................... 29
.............................................................................................................29
...............................................................................................................................31
............................................................................................................................38

: - .................................................................. 40
.............................................................................................................40
- .....................................................................................................42
: - .................................................................................51

1-: ................................................. 54
.............................................................................................................54

1-: .................................................... 55
.........................................................................................................................................55
..........................................................................................................................................56
..........................................................................................................................................57
....................................................................................................................................60
...........................................................................................................................................62
.........................................................................................................................................68
.......................................................................................................................................68
........................................................................................................................................70
........................................................................................................................................73
........................................................................................................................................74

- ....................................................................... 75
1C-: ................................................. 81
MARKETPLACE ............................................................ 93
.......................................................................................................................93
.................................................................................................................99

BITRIXSETUP ................................................................. 104


: - ..... 107
...................................................................................................... 108
............................................................................................109
(DEMO) ............................................................................112
- ........................................................................114

........................................................................................................ 116
...............................................................................................................................116
.....................................................................................................119
.............................................................................................................120
.........................................................................................122
..............................................................................................................123
.............................................................................................................................124
.............................................................................................................................125

IIS ...................................................................... 126


PHP ............................................................................................................126

PHP .................................................................................................................................132
FastCGI ..............................................................................................................133
PHP ...................................................................................................................................133

............................................................................................................. 135
.............................................................................................................................137
........................................................................................141

............................................................................................... 145
.....................................................................................................................145

........................................................................................................... 146
........................................................................................146
.htaccess ...................................................................................................150

, ........................................................ 152
..............................................................................................................153
.....................................................................................................................154
500 - Internal Server Error .................................................................................................................157

........................................................................................................ 158
...........................................................................................................................................159
BitrixVM ............................................................................................161
.........................................................................................................167
..................................................................................168

3.

............................................................. 169

...................................................................................................... 169
................................................................................................................................170
............................................................................................................................173
.......................................................................................175

.............................................................................. 177
..............................................................177
................................................................................180
.........................................................................................................184
.................................................................................................................187
...........................................................................................189

....................................................................................................... 191
............................................................................................191
.................................................................................................191
.....................................................................................196
............................................................................................199
................................................................................................202

................................................................................... 203
...................................................................203
.....................................................................................................208
php- .....................................................................................................................215

......................................................................................................... 217
...................................................................................................................................................217
.....................................................................219
.................................................................................221

........................................................................................... 229
.........................................................................................................................229
...................................................................................................................................233
.....................................................................................................................235
.............................................................................................................................239
......................................................................................240

..................................................................................................... 241
CSV- ...........................................................................................241
LDAP-directory ......................................................................................250

....................................................................................................... 255
.................................................................................................................................255
.............................................................................................................................260
.........................................................................................................262

...............................................................................................................................269
.....................................................................................273
.......................................................................................284

................................................................................................. 287
...........................................................................................................................287
........................................................................................................................290
..............................................................................................................292
...........................................................................................295
...........................................................................................300

.................................................................................................. 309
.................................................................................................................................309
..............................................................................................................................313
PHP .................................................................................................................................315
SQL ........................................................................................................................................316
PHP ....................................................................................................................316
...............................................................................................................................................317
...................................................................................................................318
.....................................................................................................................................327
...............................................................................................................................329
...............................................................................................................................329
.............................................................................................................................330

............................................................................................................. 337
..................................................................................................................337
......................................................................................................................345
CAPTCHA ..........................................................................................................................................346

............................................................................................. 352
.................................................................................................................353

4.

...................................................................................................... 355

.............................................................................................................356
.........................................................................................................................360
.......................................................................................................................................364
.........................................................................................................................367
..................................................................................................................370
........................................................................................................................................371
.....................................................................................................................372
.....................................................................................................................................373
Google Sitemap .................................................................................................................................377
.............................................................................................................................379
.............................................................................................................................382

5.

................................................. 384

........................................................................................................... 384
...............................................................387

/ ...................................................................................... 388
RSS ..................................................................................................................................388
RSS ..........................................................................................................391
CSV .....................................................................................................393
CSV......................................................................................................395
XML .....................................................................................................397
XML......................................................................................................398

............................................................................................................ 400
.......................................................................................400
................................................................................................402
CSV ...................................................................................404
.........................................................................................................407
.........................................................................................................424

6.

- .......... 425
4

- ........................................................................................ 426
PHP- ..............................................................................................................................426
.....................................................................................................................................427
? ....................................................................................430

? .................................................................................................. 430
...............................................................................................................431
PHP, .......................................................................434
..........................................................................................................435

- FRONT-END BACK-END .............................. 436


Front-end ............................................................................................................................................436
Back-end ..............................................................................................439
Back-end .........................................................441
PHP................................................................................................................444
................................................................................................................................445
...........................................446
..................................................................................................................447

............................................................ 448
- Apache ......................................................................................................448
: - ..........................................................................................449
Front-end NGINX ............................................................................................................450
NGINX .................................................................................................454

............................................................................................... 455
.........................................................................................................................455
.......................................................................................456
MySQL ......................................................................................................456
Oracle .......................................................................................................460
- .........................................................................................................................461

........................................................................................ 463
............................................................................................................................463
.................................................................................................................464
............................................................................................468
..........................................................................................................................................469
...................................................................................................................................................470
.......................................................................................................................................473
SQL .....................................................................................................................................474
...................................................................................................................475
PHP .................................................................................................................................479
.........................................................................................................................................479
PHP......................................................................................................................................480
................................................................................................................481
.......................................................490
.......................................................................................................................493

7.

.............................................................................. 494

........................................................................ 494
Unix ....................................................................................................................................................494
Windows .............................................................................................................................................499

IIS 6 ............................................................................................. 502


PHP ..................................................................................................................................502
, .....................................................................................................505


,
, 1-: .
,
, -.
,
:

- .

:
:


Windows;

WWW -.

*NIX-

1.

,
. ,
, .


1C-:
- . -
1C-:
HTML-.
1C-:
.
-.
.
1C-: .

: , , ,
, ,
, ..
: 1C-

.
.
.
1C-
.
:
, 1C.
, , .
. :



, ..


( > > )
:

,
, :

,
,
.
.
,
( ).
,
.

.

- -;


.

.

,
. :

: > >
> _;


,
.
, ()
.

10

,
,

.
1-.

!
.

11

, :
1C-: ,

, ,
.

,

( , -, , , )
, ,
, .
( >
> > ).

12

,
, .
HTML-, , ,
.
, .

13

, .

,
, , ,
.

API (SDK)

.
API .

14


.
,
.

, .

15

SiteUpdate :

1- -
.
( /bitrix/modules/, /bitrix/tools/, /bitrix/admin/
/bitrix/components/bitrix/). ,
.
:

,
.
.

1C-:
.

16

,
:

..


.
.
.

17

, ()

.

( > > )
.

,
(,

).
( > >
).

18


. ( ),

(, ),
.

.

19

(
) .
, .

20

2.

: -;

1-

;

, .

, - (Apache, IIS) ,

.



1-: 100 ,

. , Bitrix Framework
.

, ,
1C-:

.
.


-, PHP
Apache () Apache 1.3..
Apache 2.x.
IIS (Internet Information Server)( ) IIS 5,
IIS 6 IIS 7. .
Eserv ( ) .

21

PHP
PHP 5.x.. PHP-
, -,
PHP .
PHP,
, PHP, .
PHP:

GD ,
, , .
CAPTCHA.

PHP XML .
PHP. Windows .

FreeType CAPTCHA.

(POSIX Perl-compatible)
.

Zlib compression

.


MySQL
MySQL 4.1.11 . MySQL 5 , 4.1.6 1-

: .
, 5.0..
MySQL MySQL PHP.
Oracle Oracle XE Oracle.
Oracle 10g
Oracle XE.
, Oracle ,
XE. .
Oracle,
, .
Oracle Oracle PHP.
, PHP
: php_oci8.dll.

!

php_oci8.dll
(

php.ini),
, Oracle.

22

MSSQL MSSQL.
MSSQL 9.0 (2005)
MSSQL 2005 XE.
, MSSQL ,
XE. .
MSSQL,
, .
! MSSQL ODBC
Native Client. Native Client
"" PHP. ,
MSSQL .
.
, .
PHP
PHP:
1. memory_limit = 64M; ,
PHP ( 64
).
:
o

php.ini;

: ini_set("memory_limit", "64M");
:

/bitrix/php_interface/dbconn.php ,
;

.htaccess
memory_limit 64M

httpd.conf : php_admin_value
memory_limit 64M

php_value

: PHP .htaccess
:
o

- Apache ;

.htaccess -, .. (httpd.conf) : AllowOverride All


, None;

PHP Apache ( , PHP CGI,


PHP)

23

2. file_uploads = On;
.

:
o

upload_tmp_dir = < >

! , ,
, .
o

upload_max_filesize = < >

3. , PHP.
.
, session.save_path
php.ini, /tmp.
URL PHPSESSID=...,
:
o

php.ini : session.use_trans_sid = 0

.htaccess : php_flag session.use_trans_sid off


, ,
.

! C
.

24

.

1-:
:
HTML/XHTML ,
HTML/XHTML.
JavaScript JavaScript
, .
AJAX , 2.0,

.
AJAX
.
CSS
.

(, , , ).
,
.
Flash Macromedia ( Adobe) Flash.
Flash :

, ;

RSS RSS 0.92 2.0. RSS


,
.
CommerceML CommerceML 1.0.
1C-:

1C: 7.7 8..


CSV CSV
.

.
. .
:

25

API HTML ,
XHTML, ,
<!DOCTYPE>.

26


1C-:
. ,
, .
.



Windows- ,
().



BitrixSetup.
.tar.gz .zip.

27



, ,
.

28

Windows-
Windows- ,
(***_encode_php5.exe), (***_source.exe), ***
.
30 .

:

Windows 98/ME/NT/2000/XP/Vista/Server 2003/2008/7;

80-140 M
.


1-:
:

bitrix.ru/download/cms.php,
bitrix.ru/support/customers/sources.php.

:
:

http://www.1chttp://www.1c-

. .

.
(UAC) Windows Vista Windows 7.

Windows .
Windows 7 UAC

29

,
.
:

1-

: -.

1-: .

.
.
.
.

30


( )


, .
.
1-: .
( )

31


. :
.
, .
( - UTF-8)

: - , :
": ".
bitrix_env.exe : -

(. ": -"),
: MySQL 5.1.51,
Apache 2.2.15, PHP 5.3.2, Catdoc, xpdf, msmtp.
: - ,
bitrix_env.exe,
bitrix_env.exe ,
, .
! :
-
,
.
, 1-:

.
32


, UTF-8 (
UTF-8).
.
: -,
:
" -".
: -

1-:

.
33

,
.
, .
.

34

( )

. .

, .
": -",
- (.
": -").
.

35

( )
1-: .
.

36

( )

1-:

.
,
"1- ".
.

37

1-: :

: -,
( )
.

: , .

.

(: > > - >


- 2.0);

BitrixEnv.exe,
(: C:\Program Files\Bitrix Environment\).



- 2.0:

,
. .
.

38

: ( )
;

: 1;

: , ,
- 2.0;

: -
2.0 ;

: : - 2.0.

39

: -
: -
.
:

MySQL 5.1.51

Apache 2.2.15

PHP 5.3.2

Catdoc

xpdf

msmtp


: -,
:
http://www.1c-bitrix.ru/products/env/.
.

.
bitrix_env.exe.
. -.
.
c (UAC) Windows Vista
Windows 7.

40

Windows . Windows 7
UAC

41

-
: -,
.
5 .
.
.
.
.
( )


, .
. .

42

( )

.
,
, :
.
.

43

( )

, .
: -
C:/Program Files/Bitrix Environment/. ,
,
.
.

44

( )

,
. . ,
, .
.

45

( )

,
Create a desktop icon.
.

46

( -)

, -
Apache.
6448.
(, 6447) ,
(, IIS).
: : -

.
.

47

( )

: -.
.
. .

48

, .
( )

: -

.
, -.
.
: : -
Windows- -
. 1-

: .

49

: -

50

: -
: -, :

...

51

Apache:
o

, -;

SSL, - (SSL) .

:
o

MySQL MySQL;

, MySQL-;

XMPP XMPP-
, Jabber;

SMTP SMTP-.

:
o

- ,
SMTP-, ;

(SMTP) ;

,
;

-
.
: -
SMTP- (MSMTP).
MSMTP (
-),
php.ini (C:/Program Files/Bitrix Environment/apache2/zendserver/etc/).


XMPP-
Apache .

- Windows ( )
- Windows,
.

,
bitrixenv.ini , : -

(, C:/Program Files/Bitrix Environment/).


[Parameters]
ApachePortSSL=443 ; SSL
StartApacheSSL=0 ; SSL-
MySQLPort=31006 ; MySQL-
StartMySQL=1 ; MySQL-
StartXMPP=1 ; XMPP-
StartSMTP=1 ; SMTP-

52

StartAgents=1 ; Apache
StartMSMTP=0 ; SMTP- (MSMTP)
ServiceName=BitrixEnv ; Windows
MSMTPAuth=0 ; MSMTP
MSMTPServer=localhost ; SMTP-
(MSMTP)
MSMTPAuthPassword=123456 ; SMTP-
(MSMTP)
MSMTPAuthLogin=admin ; SMTP-
(MSMTP)
ApachePort=6448 ; - Apache
MSMTPFrom=support@server.local ;

53

1-:
,
,
.
,
.


1-: .zip .tar.gz
PHP 5.
1C-:

( ).
.
60120
.
.
!
.

:
a) Apache 1.3 ,
MS IIS 5.0 , PHP 5.0.0 .
4. , (MySQL 4.1.11 , Oracle 10g
MSSQL 9.0 (2005) ).
5. Oracle-
Oracle 10g ( ) .
6. ,
.
7. , 10
.
:
http://<_>/index.php ,
<_> .
.

54

1-:
1-:

,
-.
:
.

: c clear_db=Y (,
http://localhost/?clear_db=Y),
.
!
.


: : , .
( )

55


: : -

, .
( )

.
,
.
.

56


( )
,
, .


.
:

,
. ,
-:

57

,
. , -,
- -
( . (DEMO) ).
,
.
! Oracle MSSQL
.
.
, MSSQL
,
ODBC SQL Server Native Client ().
Oracle OCI8 ( php_oci8.dll).
,
MSSQL Oracle .
! : , MySQL
.
Oracle MySQL UTF-8.
UTF-8.
UTF , PHP mbstring.
PHP, php.ini, :
mbstring.func_overload=2
mbstring.internal_encoding=UTF-8


UTF-8.
UTF-8 ( . Unicode Transformation Format )
, , 8 .
HTML- WIN-1251 UTF-8.
WIN-1251 MySQL (
4.), UTF-8.
MySQL.

58

UTF-8 ,
. UTF-8
, Internet Explorer 4.

UTF-8.
.

59


: : -

, .
( )

, ,
.

,
, .
.
.
! UTF-8
mbstring.func_overload 2.
.

60

UTF-8,
mbstring.func_overload
mbstring.internal_encoding. php.ini,
, :
mbstring.func_overload 2
mbstring.internal_encoding UTF-8
PHP 5.2.8,
overload .htaccess.
. cp-1251,
overload 2.
cp1251 encoding.

,
.
.
( ,
).
.

61


: : -

, .

( )

.
.
.
MySQL:

.
1-:
(Apache,
PHP, MySQL) : -,
:

: , (),
MySQL.

62

localhost , MySQL,
localhost:[_].
MySQL.
! : -
localhost:31006.

: ;

: ()
.

: .

: .

: . ,
.

: .
:
o

. MySQL MyISAM,
.
MyISAM, , ,

.

. 2 4 . MylSAM
-.

.

Innodb. InnoDB MySQL ,



, .
InnoDB ,
SELECT.
.
, .. ,
.

.
InnoDB
.

.

. :
.

63

root.
.
,

:

: ,
().

: ,

.

: () .

: .

: :
.

: , .

:
.

! .
, , -,
MySQL InnoDB.
!
,
. ,
. ,
.
.

64

Oracle:

: -:
NLS_LANG CP1251 (
NLS_LANG=ENGLISH.CP1251)
"." - NLS_NUMERIC_CHARACTERS=.
:

:
Oracle (instance), tnsnames.ora,
.
Oracle:
(DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL =
TCP)(HOST = 000.000.0.00)(PORT = 0000)))(CONNECT_DATA =
(SERVICE_NAME = BX))).

: ,

.

: Oracle.

: .

!
,

65

.

. .
! -
Oracle, RunTime.
MSSQL:

DSN: ,
().
,
.
, .
:

DSN
( ).
( ,
) localhost.

: ,

.

: ()
.

66

: ;

: ,
.

: , .

!
,
.

. .
:
( ).

: , .
- .
0644;

: , .
- .
0755.

: (
)
/bitrix/php_interface/dbconn.php.
.
.

67


( )
,
. .

.


( )
()
,
.
.

, *, .

68

: ()
. .
.

:
. .
!
6 .

:
.

E-Mail: (e-mail).

: .

: .

:
.
.
.

69


( )

70

71

- .

1-: ,
: , , ..

,
.

1-: ,
.

- ,
.

Marketplace,
.

72


( )
: ,
Marketplace.

( )
Marketplace.

73


( )
:
Marketplace .
,
().

74

-
:
- .

- .
:
, -. ,
. .
,
.

75


.
, ,
.

.
.


.
.

76

.
.


, .

.
:
, .

.
! 1,5
, : GIF, JPG, PNG.
.

77


, .
.

, .
: ,
, .

, .
,
.
.

78

.
-.
.
.
- CSV IP
. -
( > > >
-).
,
.htaccess
php_flag session.use_trans_sid off.
Apache.
,
.htaccess :
ExpiresActive on
ExpiresByType image/jpeg "access plus 3 day"
ExpiresByType image/gif "access plus 3 day"

79


Apache.
:
.

80

1C-:
!
.
1C-:
- ( -).
:
- 1: .
( )
.
. ,
.

.
.

81

( )

.
.

.
.

82

( )
.

, ,
, , , .
.

83

( )
.

E-mail, , ,
.
.

84

( )
.

, .
.

85

( )
.

,
.
.

86

( )
, .
.
.

87

( )

.

- .

88


1. .
.

89

2. .
- , , .

90

3. .
.

91

4. .
-.

92

Marketplace
MarketPlace
1C-: , .


!
.
Marketplace
, (
).

: ,
Marketplace .

93

( )
.
. ,
.

.
.

94

( )

.
.

.
.

95

( )
.

.
.

96

( )
, .
.
.

97

( )

98


Marketplace 1C-:
:
1.
:


.
2. ( > Marketplace
> ):

Marketplace,
:

99

:
o

Marketplace,
;

- - ,
;

Marketplace
- .

Marketplace
(
).

100


( > Marketplace
> ). ,
, .

( >
> ),
.

101

Marketplace

( > Marketplace > ):


, :

102

Marketplace
,
,
1C-.

:

, - .

103

BitrixSetup
1-:
FTP
BitrixSetup.
FTP
. FTP-
-,
.
,
FTP Apache
BitrixSetup.
BitrixSetup
www.1c-bitrix.ru ,
. ,

SSH .
http://www.1c-bitrix.ru/download/cms.php
.
BitrixSetup.

.
.
bitrixsetup.php.
FTP ,
.
bitrixsetup.php
.
!
.
http://< >/bitrixsetup.php ,
< > .
.

104

! , -
.

, .
, :
.
,
.
:
. ,
1-, .
. .

105

BitrixSetup
1C-.
,
, .
,
(, ).
! bitrixsetup.php
.

106

:
: - 2.0
1-:

(, ) ,
- Apache.
:
-, , C:\Program
Files\Bitrix Environment\. .

_.conf
(C:\Program
Environment\apache2\conf\sites\) :

Files\Bitrix

#Bitrix Env replace()


Listen 6449
<VirtualHost _default_:6449>
DocumentRoot "C:/Program Files/Bitrix Environment/_"
ErrorLog "logs/error.log"
CustomLog "logs/access.log" common
</VirtualHost>
#/Bitrix Env replace()
6449 . : Listen
VirtualHost.
1 - 65535.
: - 2.0.
:
: - 2.0.
! ,
.
_.conf .
http://:,
( localhost), (
6449).

107

!
.
- 2.0.


1C-
. ,
. .
1C-
Zend Optimizer,
Zend Optimizer .
,
, ,
PHP .
! 9.1 1C- 30 -
PHP ,
1C-,
. -
.

.

( ),
.
- , .

108


! 1C . 1C-
()
, /
(
). 1C
.
1C-.
,
, 1 1 , ,
, .
, ,
,
.
:
.
> .
.
:

109

.
:

, *, .
:
o

-
: ,
. ,
.

, ,
"1-: ": ,

.

:
.

E-mail
:
, , , 1 .

,
: .

E-mail :
.

: .

:
: ,
, ..

110

www.1-bitrix.ru, :

1-, .

.
,
1-,
.

: ,
www.1-bitrix.ru .

. ,
.

- ,
.

111

(DEMO)
,
( > ) ,
.

: -
. -:

1C-.
.

112

, *, .
:
o

: ;

: ;

E-mail: (e-mail).
, ;

: ;

: ;

: web-,
;

: ;

. .

.
, ,
, :
.
( >
> > ).
.
.
- 30-
.
:

113

,
,
. ,
30 .

-
-
.
:
.
:
a) ( > ),

114

b)
( > > > )

,
.
,
.

115


, ,
.
.
: - ,
, .



() . :

(
);

, ;

(
);


).

>


/bitrix/modules/ (
, ).
.
/bitrix/,
/bitrix/modules/ (.. ) /bitrix/updates/.
(,
b_event_type).
/bitrix/updates/.

.
, ,
, .
,
.

116

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

.
,
.

www.1c-bitrix.ru

www.bitrixsoft.com).

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

, .
,
(,
).

. , ,
, .
,
.
, .

1-.


.

117

,
( ), :

,

;

,
.
.

.

,
,
.
.
,
, .
.

,
:

, .

(.. ).
,
.

,
.

- .

. 20
,
.

118



( > >
> )

.
,
.

,
. .

-
.

,

119

.
.


-.

( > Marketplace >


).


.
: , ,
.

-

.

() -

.

: - ,
, .



. , ,
, .

1-.
!
, .
,
.

:

, ,
.

120


.
,

.
,
. ,
, .
,
. ,
,

.
! ,
, .
! .
,
.

121



. :

.
.
.
.
.
:
.

122


-
.

,
( > Marketplace > ).
1-.
,
.
!
, ,
.

123


1-:
() ,
.
.
,
.

( ).
( ) . ,

() .
,

.
, ,
,
.
.
, :
( > Marketplace >
).
.

124


"
: [110] Connection timed out."
,
www.bitrixsoft.ru 80. :

, , fsockopen();

80 ;

, .
: [SITE_LICENSE_VIOLATION]

, ,
.
,

: > > >
.

[ERROR_WRONG_CODE]
""
. ,
,
.
.
,
: ( ),
. ,
.
, .
,
: , ( ).
:
, ,
, DNS.

125

IIS
Microsoft IIS 7.
. "1-" 1-
Windows Server 2008.
IIS 7.
: IIS 6
IIS 6 .

PHP
PHP,
PHP 5 http://windows.php.net/download/ (Microsoft Nonthread-safe (NTS)).
.
( )


.
Next.
( )

126

.
, I accept the terms in the License Agreement.
Next.
( )

, ,
Next.

127

( -)

- IIS FastCGI Next


.

128

( )

Extensions ( PHP),
:

GD2;

LDAP ( LDAP-);

Multi-Byte String ( ,
1-: UTF-8);

MySQL;

OpenSSL;

zip.

:
extension=__.dll php.ini ,
PHP. : extension=php_win32scheduler.dll.
Next.

129

()

Install, :

, .

130

( )

PHP .
Finish .

131

PHP
PHP :
, PHP.
php.ini .
:
fastcgi.impersonate = 1
cgi.fix_pathinfo = 1
cgi.force_redirect = 0
short_open_tag = On
extension_dir = "C:\<__>\PHP\ext"
upload_tmp_dir="C:\inetpub\temp"
session.save_path="C:\inetpub\temp"
allow_call_time_pass_reference = On
display_errors = On
: 1-: <?
<?php.
: inetpub , .
.
PHP :
> ;
: cmd;
PHP
: cd C:\<__>\PHP\;
php info.
, (php.ini).

132

FastCGI
, php-
FastCGI. :
Administration Pack for IIS 7.0
(http://www.iis.net/downloads/default.aspx?tabid=34&i=1683&g=6).

, .
- IIS Manager.
FastCGI Settings:

: php.ini fastcgi.logging
1, , .
PHP.

PHP
PHP :
C:/inetpub/wwwroot phpinfo.php, :
<? phpinfo(); ?>
http://_/phpinfo.php.
, ,
PHP:

133

134


Bitrix Framework

.
1
. ( , ,
.)

, ,
PHP .
128 , PHP,
(, -).

.


.
- ( NGINX), .

Apache .

. ,
.

PHP FTP/SSH .
FTP/SFTP-.
,
PHP.

.


.

,
, 1-.
.
,
:

Apache 1.3.0 ;

.htaccess;

PHP 5;

safe_mode (
);

short_open_tag ;

135

memory_limit 32 "", 64
"";

: Zlib ( -
), GD lib ( ), Free Type (
CAPTCHA);

MySQL : 4.1.11, 5.0 ;

PHP (APC, eAccelerator


);

PHP Apache (CGI


, FastCGI)


bitrix_server_test.php, .


,
"1-".

136


(
)
, :

( .tar.gz);

, ;

,
;

( .tar.gz);

!
MySQL.


restore.php, :

:
o

(0644 0744 )
, Apache (PHP).

- .
( > >
). . .
.
:

, .
,
. .

137


restore.php.
! ( ,
), 1-:
.
restore.php,
. .
http://_/restore.php.
.

138


,
.

,
.

139


:
o

/restore.php

/ ( .tar.gz)

/bitrix/backup/ ( .sql)

140



Bitrix Framework
/.
, "1-: "
,
. -
.
,
.
:
1. - .
:
o

-;

.
: , ,
,
.
.

777 ( Unix )
PHP .

2. ftp/ssh , . -
.
, ,
dbconn.php,
Bitrix Framework .
define("BX_FILE_PERMISSIONS", 0666);
define("BX_DIR_PERMISSIONS", 0777);
, ftp/ssh,
. , ,
umask.

141

PHP
- PHP:

: PHP
, ftp/ssh .
, ,
, -
.

:
PHP -,
.
500,
-.
: , PHP CGI,
.
, PHP
.
, dbconn.php.

.
,
.
:
- .
,
.

utf-8 . ,
( mbstring
pgp: mbstring.func_overload=2).

, .

.

Bitrix Framework
,
. ( Bitrix Framework)
.
.

.

.

142



. :

-
( > > >
).
:
- ,
. ,
-.

(FTP/SSH),
.access.
, ,
.
1: .access :
<?

$PERM["/"]["*"]="R"; ?>

2:
(
) .

, ,
WinRar , , .
: , tar .
GNU tar, tar Linux. WinRar tar,
.
restore.php,
. ,
.
ERROR 1062 (23000)
: ERROR 1062 (23000) at line
1247: Duplicate entry '2-?' for key 2.
: , , ,
.

143


/bitrix/php_interface/after_connect.php, :
<?
$DB->Query("SET NAMES 'utf8'");
?>
. utf8.

character_set_server SQL-:

show variables where Variable_name = 'character_set_server';


:


character_set_server , .
!
.

:
SET NAMES `utf8`;
.
!
( ).

144


:
, ,
.

> > >


- >

> > - > Uninstall


-.

145


: ,
.htaccess .


- ,
/ ,
- Apache.

/ . ,
FTP , ,
FTP, .
, -
.

nobody:. , ,
Apache. , ,
- ,
.
( FTP-).
:
, .
, , CGI-.
Apache, nobody,
. ,
- -,
. , .

1-: ,
().
CHMOD
( ), /bitrix/php_interface/dbconn.php
:
define("BX_FILE_PERMISSIONS", 0644);
define("BX_DIR_PERMISSIONS", 0755);

146

. -
, .
, CHMOD
.
, :
chmod -R 644 *
:
find . -type d -exec chmod 0755 {} ';'
, :
<?php
define("BX_FILE_PERMISSIONS", 0644);
define("BX_DIR_PERMISSIONS", 0755);

function chmod_R($path) {
$handle = opendir($path);
while ( false !== ($file = readdir($handle)) ) {
if ( ($file !== ".") && ($file !== "..") ) {
if ( is_file($path."/".$file) ) {
chmod($path . "/" . $file, BX_FILE_PERMISSIONS);
}
else {
chmod($path . "/" . $file, BX_DIR_PERMISSIONS);
chmod_R($path . "/" . $file);
}
}
}
closedir($handle);
}
$path=dirname(__FILE__);

147

umask(0);
chmod_R($path);
echo $path;
?>

FTP . , FlashFXP 3..
FlashFXP ,
.
:
Separately set File and Folder attributes (
);
Apply changes to all subfolders and files (
)
:

!
, .

148


,
( *NIX).

149

.htaccess
.htaccess ( . hypertext access) - -
Apache.
-
httd.conf.
.htaccess httpd.conf ,
, , . .htaccess
.
,
.htaccess. ,
.htaccess ,
httpd.conf ( AllowOverride
All). .
.htaccess .
.htaccess ,
. ,
-.
!
.htaccess.
.htaccess
:
Options -Indexes
ErrorDocument 404 /404.php
#php_flag allow_call_time_pass_reference 1
#php_flag session.use_trans_sid off
#php_value display_errors 1
php_value mbstring.func_overload 2
php_value mbstring.internal_encoding UTF-8
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !/bitrix/urlrewrite.php$
RewriteRule ^(.*)$ /bitrix/urlrewrite.php [L]
AddType application/x-httpd-php .ico

150

DirectoryIndex index.php index.html


ExpiresActive on
ExpiresByType image/jpeg "access plus 3 day"
ExpiresByType image/gif "access plus 3 day"
! PHP
(#) . Apache
PHP-,
(500).
, #.
PHP , (#),
Apache .
.
1. PHP
php_flag
session.use_trans_sid
off
.

2. PHP php_value display_errors 1, ,


.
php_value error_reporting ,
.
PHP .
3.
php_value
mbstring.func_overload
2

mbstring.internal_encoding UTF-8
mbstring.
4.
mod_rewrite.

IfModule

mod_rewrite.c

php_value

5. AddType application/x-httpd-php .ico


ico php-.
6.
ExpiresActive
on

,
.
ExpiresByType image/jpeg "access plus
3 day"
ExpiresByType image/gif "access plus 3 day", ,
,
. ,
.jpeg .gif 3 .
! , .htaccess
UNIX- ( FAR UNIX-).
CGI

151

1.
php CGI.
HTTP php. ,
phpinfo() Server API: CGI.
, ,
.htaccess mod_rewrite. :

.htaccess :
RewriteEngine on
RewriteRule .* - [E=REMOTE_USER:%{HTTP:Authorization},L]

bitrix/admin/.htaccess,
mod_rewrite:
#<ifmodule mod_rewrite.c="">
# RewriteEngine Off
#</ifmodule>

bitrix/php_interface/dbconn.php :
$remote_user = $_SERVER["REMOTE_USER"]
? $_SERVER["REMOTE_USER"] : $_SERVER["REDIRECT_REMOTE_USER"];
$strTmp = base64_decode(substr($remote_user,6));
if ($strTmp)

list($_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW']) =
explode(':', $strTmp);
HTTP- .
! .
HTTP- ,
- .

,

.

152

/bitrix/php_interface/dbconn.php);

/bitrix/modules/main/include/dbconn_error.php:

<br>
<table cellpadding="1" cellspacing="0" width="35%" bgcolor="#9C9A9C">
<tr>
<td><table cellpadding="5" cellspacing="0" width="100%">
<tr>
<td bgcolor="#FFFFFF" align="center"><FONT
face="Verdana, Arial, Helvetica, sans-serif" size="-1">
<font color="#FF0000"><b><?echo "Error connecting
to database."?></b></font><br>Please try again.</font></td>
</tr>
</table></td>
</tr>
</table>
<br><br><br>
, , MySQLGUI Windows,
http://www.mysql.ru/download/.

153

/bitrix/php_interface/dbquery_error.php.

, ,

bitrix/php_interface/dbconn.php, ,
$DBDebug = true;
<?
define("DBPersistent", true);
$DBType = "mysql";
$DBHost = "localhost:31006";
$DBLogin = "root";
$DBPassword = "";
$DBName = "bsm_demo";
$DBDebug = true;
$DBDebugToFile = false;
set_time_limit(60);
define("BX_FILE_PERMISSIONS", 0644);
define("BX_DIR_PERMISSIONS", 0755);
@ini_set("memory_limit", "64M");
?>
, , ,
.

154

perror.exe ( perror.exe
mysql/bin) :

: 28 :

,
.

,
.

.
:


MySQL MyISAM.


> > :

155

,
,
?no_keep_statistic_LICENSE-KEY=Y.
.


.

: (login) (password) . :
http://www.mysite.ru/bitrix/admin/repair_db.php?login=DB_Login&password=DB_Passw
ord.
/bitrix/php_interface/dbconn.php.

:
:
MySQL Query Error: .. [Out of memory restart server and try again (needed 65528 bytes)]
:
MySQL.

MySQL my.cnf:

MySQL,

key_buffer = 128K
max_allowed_packet = 16M
table_cache = 4
sort_buffer_size = 128K
read_buffer_size = 128K
read_rnd_buffer_size = 128K
net_buffer_length = 128K
thread_stack = 128K
MySQL.

156

500 - Internal Server Error


,
. 1-:
. -
.

error.log. .


.
, ,
(, 0755,
0711).


php-;



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

, PHP CGI, 500


PHP.
.

- Apache CGI, ,
.

, .
, PHP
php.ini.
.
,
(, ).
1-
, .
.

157


1C-: ,
, ,

1-, PHP-. Windows
Unix .


1-.
1-,

BitrixVM.
, ..

BitrixVM.
VMWare Player .
VMWare.
1-,
. BitrixVM

"1-".

158

1C-:
1-:
!
1-, ,
.

1C-: VMWare Studio


VMWare Virtual Appliance VMWare:

VMWare Server 1.0 ;

VMWare ESX 3.0 ;

VMWare ESXi 3.5 ;

VMWare Workstation 6.0 ;

VMWare Player 2.0 ;

VMWare Fusion 1.1 .

1-: .
, -,
, firewall, , ,
, -.
, .
.
BitrixVM .
"1-".
root bitrix,
bitrix bitrix.
:
!

BitrixVM VMWare Player



:

: Windows XP, Vista, 7, Server 2003, Server 2008 (x86/x64); Linux (x86/x64);

VMWare Player;

: 2 ;

: 160 ;

159

: 256 .

160

BitrixVM
VMWare Player ,
Windows Linux.
: VMWare Player
.
VMWare.
BitrixVM.
, , :\VMBitrix\BitrixVM\.
VMWare Player. Open a Virtual Machine
BitrixVM.vmx, :\VMBitrix\BitrixVM\.
.
Play Virtual
Machine:

,
. :

161

:
o

Login;

Configure Network;

, , Set
Timezone.

Login.
: root bitrix.
.

162

localhost.localdom login Password


(root bitrix ) Enter.
(current) UNIX password (bitrix) Enter.
Enter new UNIX password Enter.
Retype new UNIX password
Enter.
: Change root
password .

163

Available actions:

0. Virtual appliance information


;

1. Mail sending system parameters


;

2. Disable/Enable HTTP access (HTTPS only) /


HTTPS;

3. Enable/Disable ZendServerCE control panel /


ZendServerCE;

4. Change root password ;

5. Change bitrix password bitrix;

6. Virtual server reboot ;

7. Virtual server shutdown ;

8. Set PHP timezone from Operating System setting


;

9. Create master mode - -;

10. Add slave node - (


-);

11. Make slave node a master node -


( -);

12. Add additional site -


;

13. NTLM authentication - NTLM .

164

( 0 8)
Enter. , 7
(Virtual server shutdown) Enter.
: VMWare Player
(Virtual Machine > Removable
Devices > Network Adapter > Settings...), (Bridged, NAT, Hostonly):

, 6 Enter.
, Ctrl+Alt.
IP- (
http://192.168.0.175 https://192.168.0.175).
:

165

,
,
1C-. ,
BitrixSetup.

,
(
). ,
.

166


:
Type a number and press ENTER 1 (Mail sending
system parameters) Enter:

Mail sending subsystem settings,


:

SMTP server name .

SMTP port . , 25 -
465 - ( SSL).
Enter, (25).

Default sender address


.

SMTP , SMTP authorization


required Yes, No.

167

SMTP-

Save changes Yes.


BitrixEnv ( Linux) BitrixVM,
.
,
(/bitrix/home/www) /home/bitrix/backup/archive.
, 2:30.
/etc/crontab/.
:
wget http://repos.1c-bitrix.ru/ext/start_site_backup.sh
chmod +x start_site_backup.sh
./start_site_backup.sh

.

168

3.

, ,
, 1-: ,
.
-.
,
-.


,
-.
.
,
.

169



. 1-:
:

. , ,
.

170


( >
> > ):

171

:
.

,
.
:

. , ,
..
,

-.
,
,

. ,
,
, ,
,
- .

,

, .

-.

.
.
:
.
. ,
.

:
.

.

172



.
,
,
. html-, ,
, .
, .

.
,
. , :

..


( : >
> > ).

173

:
.
.

.
!
.
. ()
,
. ,
.
:

: PHP,
API- .

174



. , .
.
( >
> ).

.
:

175

.

( > >
).

.
: ,
.
,
.
! .
. ,
, (2 ),
.

176


,
.
, .
.




.

,
.

.

.
.
:

177


, , META:
(keywords) (description) . ,
.

, ,
, (..
, ).

178

, ()
,
.

179

HTML-
:

180



,
,
:

181


, ,
.
( > >
> ):

( ) .

;

.
.

182

: .
:

183



,
.
.
.
:

184

185


, .

186



.

:

187

.
, .
:
2 .
, php.ini
upload_max_filesize.
!
, , .
: \ / ? * < > " ' ".

188



(). , .
.

, .
(
). :
,
.
: ****.
.
.
,
: , , .

.

189

,

.
:
.
. ,
.

. ,
, .
.

.
: , ,
, .

190


,
.


HTML-,
.

! , -
, /
/bitrix/admin. , HTML-.
.



( > > >
) .

,
HTML ,
styles.css:

191

,
. .
,
HTML
:

192

193

,
HTML-.


Microsoft Word, .
php - pSpell.
,
aSpell
(http://aspell.net/),

pSpell
(http://www.php.net/manual/en/book.pspell.php).
pSpell,
:

: :
MS Word, pSpell,
pSpell, .. pSpell
, MS Word .
pSpell
,

194

,
,
, .
, ,
, .
pSpell :

.
(, ru,
en s1) , (
/bitrix/modules/fileman/u_dics/_). ,
,
ID (183, ),
custom.pws .
, custom.pws,
, /bitrix/modules/fileman/u_dics/_/.

195



.
.
.
/
,
:

, , ,
:

196

:
- -
HTML ( IE 5.0 FireFox 1.0 ):

197

: ,
, , .

198



, ,
.
. :
( >
> > ).

.
: , .
, ,
. ,
, .
: news.*. ,
, .
.
,
.
,
bitrix.
www\bitrix\components\... ( -),
.
,
,
.

.

199


( >
> > ).

2.0 .


,
<p>#COMPONENT0001#</p>.

200


,
.

:
"SCREENSHOT" ( .description.php
\www\bitrix\components\<_>)
-. .
.
...
$arComponentDescription = array(
"NAME" => GetMessage("T_IBLOCK_DESC_LIST"),
"DESCRIPTION" => GetMessage("T_IBLOCK_DESC_LIST_DESC"),
"ICON" => "/images/news_list.gif",
"SORT" => 20,
"SCREENSHOT" => array(
"/images/news_list.png",
),

201

"CACHE_PATH" => "Y",


...

-.


-,
.
/snippets/
(.default), :

.content.php - .
(title) (description).
<?if(!defined("B_PROLOG_INCLUDED") ||
B_PROLOG_INCLUDED!==true)die();?>
<?
$SNIPPETS = Array();
$SNIPPETS["snippet0001.snp"] = Array("title"=>"",
"description"=>"");
?>

.htaccess - ;

( *.snp). .

, /snippets/images/
, .
. ,
/test1/table.snp.
/images/test1/table.png ( ).

202



, .

,
, ,
..
,
/ .


, ,
- ,
.
.
,
:

, :

.
. .

, ..
:

203

:
sect_inc.php
[_]_inc.php.
, index.php
index_inc.php.


.

... ,
. ,
, .
.

204

, .
:

,
. ,
, .
.

205

,
.
.

.
.

206

. ,
:

.
:
.

207


.
,
,
. HTML-,
, , .
,
.
!
: .
!
.
:

( > > >
):


:

.

208

( > >
> ).
.

209

210

.



.
.



(<head>)
:

211

: ,
.
, ,
.

Work Area
Work Area #WORK_AREA#
.
, ,
.
.

212

: Work Area .


, .. ,
. .


php- .
html- php-. ,
:
<a href="<? echo 'www.oursite.ru';?>" title="
">OurSite</a>
, ( img).

213

,
<a> : href, title, class, style

<img> : src, alt, class, style


.. <? ...... ?>
php-:
<table >
<? ........ ?>
<tr>
<? ........ ?>
<td>
</td>
<? ........ ?>
</tr>
<? ........ ?>
</table>
,
, SITE_TEMPLATE_PATH:
<img height="4" alt=""
src="<?=SITE_TEMPLATE_PATH?>/images/left_top_corner.gif" width="4"
border="0" />
,
php . .. :
<img src="<?=SITE_TEMPLATE_PATH?>/images/<?='image.gif';?>" width="2"
height="17" alt="" class="search-left" />

214

php-
: php-
.
HTML- php- :

php-
.
,
;

php-,
.

, php-
:

! html- php-.
, :
<a href="<? echo 'www.oursite.ru';?>" title="
">OurSite</a>
, ( img).
, :
<a> : href, title, class, style
<img> : src, alt, class, style
.. <? ...... ?>
php-:
<table >
<? ........ ?>
<tr>
<? ........ ?>
<td>
</td>
<? ........ ?>
</tr>

215

<? ........ ?>


</table>
, php- .
,
:
<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/header.php");
$APPLICATION->SetPageProperty("title", "
1-: 6.0");
$APPLICATION->SetPageProperty("NOT_SHOW_NAV_CHAIN", "Y");
$APPLICATION->SetTitle(" -");
?>
, footer.php, HTML-:
<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/footer.php");?>

216


,
,
, .

1-:
:


, :
o

URL (, http://www.site.ru)

DocumentRoot 2,

()

,
,
,
, .. .

1C-:
,
( , ,
).
, ,
.
:

.
- Apache.

217


, :

/home/www/allsites/s1/

/home/www/allsites/s2/

.
- Apache -.
.

:
.
: , ,
. ,
, .

218



( > > >
):

, ,
.
,
.
:
.

:

219

: , ,
-
. .
, ( )
, .

220

(, , ..);

().

( ),
/ ( > > >
).

221

. 11 .



.
(
, ..), :

222

-;

..

,
, .
,
.
, .
.
: windows1251. : win-1251.
, ,
.


1C-:
, . ,
,
.

, ,
( > > ):

223

,
, .
( >
> ):

224


.
:


. :

..

225

:

.

:

: ,
.


, ,
, .
.

:

, ,
.

226

,
.
, .


( ) .

:
.

227

,
(bitrix:main.site.selector).
, ,

.
( ) , .. .

228


1C-
.

, ( ..
).


. ..

, .
:

(, , ..);


(, );

( ).

1: ;

2: .


.

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

229


, :

230

,
.
, ,
, :


, , .

, .
, ,
:

,
;

, ,
:

231

, ,
,
, :

, , ,
. , ,
, .
.

232



( > > ):

:
( ),
.


:

233

:
.
, .
- ,
( ).
:

:
.

234



( > > ):

:
.
,
;


.

235

:
.
:
:


,
( );

,
( ,
).

(, ,
),
.

/ :

236

: ,
,
/
( > > ).

( > > ):

237

: ,

( > > ),
.
:
. ,
,
.

. ,
.
,
.


. .
( PHP) , ,
. .
,
,
- . ,

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

-
, .
.
o

238


/bitrix/admin/ ( );

,
.

( ) .
, dbconn.php, init.php
after_connect.php, bitrix/php_interface,
"".

, PHP ,
.

/bitrix/php_interface/dbconn.php
:
//@umask(~BX_DIR_PERMISSIONS);

,
.
().

php.ini
Environment\Apache2\zendserver\etc): session.gc_maxlifetime.

(Bitrix


. , , 255.255.255.255,
, IP , .

session.cookie_domain php.ini .
, URL .
session.cookie_domain www.site.ru,
URL site.ru, , ,
, .

PHP
session.cookie_domain.

239


:
<?
require($_SERVER['DOCUMENT_ROOT']."/bitrix/header.php");
echo $USER->Update(1,array("PASSWORD"=>'Bitrix*123456'));
echo $USER->LAST_ERROR;
require($_SERVER['DOCUMENT_ROOT']."/bitrix/footer.php");
?>
FTP .
ID=1 ( ) : Bitrix*123456
.
! !

240


CSV-

( > >
).
! CSV- .
/ ( >
> > ).
CSV
CSV- . :

.
, . ,
, .
( , ) (delimiter).
:
LAST_NAME;PERSONAL_PHOTO;NAME;SECOND_NAME;WORK_POSITION;EMAIL;PERSONAL
_BIRTHDAY;PERSONAL_GENDER;WORK_PHONE;UF_1C_PHONE_INNER;PERSONAL_MOBILE
;PERSONAL_ICQ;LOGIN;IBLOCK_SECTION_NAME_1;IBLOCK_SECTION_NAME_2;IBLOCK
_SECTION_NAME_3;IBLOCK_SECTION_NAME_4
.
, ,
.
, :
LAST_NAME;PERSONAL_PHOTO;NAME;SECOND_NAME;WORK_POSITION;
- , , 2, 4 5,
:
;;;;
, , .

241

CSV- :

(delimiter) : (,), (;),


. .
, ,
.

(:
),
",,".

,
. , "" CSV-
: """".

CSV- .

, , .

: Y ; N
.

,
, . ,
10 , 12 ,
2 .

, ,
.

. :
MM/DD/YYYY HH:MI:SS ( ), DD.MM.YYYY HH:MI:SS
( ).

1-:
1-: ,
:
( > >
).
Excel, .
CSV-. :
o


, ;


, . (,
M F, ).

242

ACTIVE

,
boolean

()
()

string
()

(. 3 )

PASSWORD

string
()

(. 6
)

NAME

string
()

LAST_NAME

string
()

SECOND_NAME

string
()

string
()

,

e-mail

DATE_REGISTER

date ()

LID

string
()

ID

ADMIN_NOTES

string
()

EXTERNAL_AUTH_ID

string
()

XML_ID

string
()

ID

(,
ID

LOGIN

EMAIL

243

-mail

-
)

PERSONAL_GENDER

string
()

. M .; F- .

PERSONAL_BIRTHDAY

date ()

PERSONAL_ ITY

string
()

PERSONAL_STATE

string
()

PERSONAL_ZIP

string
()

PERSONAL_WWW

string
()

PERSON L_PROFESSION

string
()

PERSONAL_NOTES

string
()

PERSONAL_ICQ

string
()

ICQ

PERSONAL_PHONE

string
()

PERSONAL_PHOTO

string
()

.
,


(

),

,

PERSONAL_FAX

string
()

PERSONAL_MOB LE

string
()

244

PERSONAL_PAGER

string
()

PERSONAL_STREET

string
()

PERSONAL_MAILBOX

string
()

WORK_COMPANY

string
()

WORK_DEPARTMENT

string
()

WORK_POSITION

string
()

WORK_WWW

string
()

WORK_PHONE

string
()

WORK_FAX

string
()

WORK_PAGER

string
()

WORK_STREET

string
()

WORK_MAILBOX

string
()

WORK CITY

string
()

WORK_STATE

string
()

WORK_ZIP

string
()

WORK_PROFI E

string
()

.
,


(

WORK_LO O

string
()

245


),

,

WORK_N TES

string
()

UF_*

string
()

IBLOCK_SECTION_NAME_*

string
()

: UF_* ,
.
.
: IBLOCK_SECTION_NAME_*
. 5 .

! CSV-
- (NAME) (LAST_NAME).
CSV-:
LAST_NAME,NAME,LOGIN,PASSWORD,EMAIL
,,vivanov,Password1,vivanov@company.ru
,,vkuznetsov,Password2,vkuznetsov@company.ru
,,oromanova,Password3,oromanova@company.ru
,,esinitsyna,Password4,esinitsyna@company.ru
,,itihomirov,Password5,itihomirov@company.ru
,,kbasmanov,81QE1RO98M,kbasmanov@company.ru
,,egalkina,D0O4IAYOX0,egalkina@company.ru
,,mkorolev,CDUEND3SMX,mkorolev@company.ru
,,imatveeva,GCH425XAM6,imatveeva@company.ru
,,korlov,ZD3PZHP2E7,korlov@company.ru

246

, ,
, .
, CSV- MS Excel, :

, ,
, 6 .

, 3 .

: CSV- MS Excel.
, MS
Excel.
CSV- .


CSV-
.

( ):

247

CSV-.

, .

( Ctrl),
.

,
PERSONAL_PHOTO
WORK_LOGO. , PERSONAL_PHOTO WORK_LOGO
.


, ,
IBLOCK_SECTION_NAME_* .

248

: .
,
.

LDAP-
, .
:
.

, e-mail
, CSV-
e-mail.

,
, ,
.

.
.
.



( > >
). .
, , CSV .

249

LDAP-directory

( > >
).
Active Directory / LDAP,
:

Active Directory / LDAP .

( )
, :

: , .
.
.
,
:

250

. .
,
.


,
, ,
AD/LDAP ( > AD/LDAP).
: ,
. , AD/LDAP
, .

251

:
.
, .
,
.
.
, :

252

, AD LDAP
.
AD (LDAP)
. ,
....
LDAP- ,
E-mail , , , ..
( Active Directory).
.
,
AD (LDAP) ,
, 1-: . ,
- ,
.
,
, , ,
.

253


AD.
.

:
, .

,

.
,
,
, .
.
, :
o


. , .

, .

LDAP
.

254


.
.
(, ,
) .
,
.
.
, . ,
/ ,
, .
,
.
PHP-
PHP
.
,
, , ,
.
.

( > > ):

255

:
. ,
.
, .

.

256


.
, .

:
o

/
.


. ,
, :

257


( > > > )

( >
> ).

258


, ( ).

259


( > > ):

( > >
):

260


(. ).
, ,

.
,
:

,
, ,
.
.
, ,
. ,
, .
, , :

,
;

(
);

,
, .

:
.

261


.

!
. ,
.

( > . > . >
<_>).

, -
,
-
:

"!
", ,

262

,
.

. ,
.
: ,
, ..
.
,
:

,
.


. :

263

.
, /
.

, :

264

,
.

-
-
- ( -):

( > - > )

265

:
-.
-
( > > ):

266

267

,
- .

268


, , ,
.
: /
, , , Apache.

/ . ,
FTP, .
, -
: 777 ( ),
Apache
, ..
-.

Unix/Linux - , ,
.
.
FTP -
(ftp -) .
,
( ,
ftp -, ).
! ,
.
, :

ftp
-
ftp. :

<?
function chmod_R($path, $perm)
{
if (is_dir($path))

269

{
chmod($path."/".$file, $perm);
$handle = opendir($path);
if (!$handle)
{
echo "Error: ".$path;
return;
}
while (false !== ($file = readdir($handle)))
{
if ($file == "." || $file == ".." || $file == '.htaccess')
continue;
chmod_R($path."/".$file, $perm);
}
closedir($handle);
return true;
}
elseif(is_file($path))
{
$file_perm = $perm ^ 0111;
return chmod($path, $file_perm);
}
return;
}
$path = $_GET["path"];
if (!trim($path))
{
?>
<form method=get>
: <input name=path
value='<?=dirname($_SERVER['SCRIPT_NAME'])?>'><br>
: <input name=perm value='0777'><br>
<input type=submit value='OK'>
</form>
<?
}
else
{
$path = realpath($_SERVER["DOCUMENT_ROOT"] . "/" . $path);
if (intval($_GET['perm']))
$perm = octdec(intval($_GET['perm']));
else
$perm = 0777;
if (chmod_R($path, $perm))
echo "OK: ".$path;
}
?>
,
. "x" . ,

270

$file_perm = $perm ^ 0111;

$file_perm = $perm;

ftp, 1-:

ftp , , .
ssh, ,
PuTTY.
:

: , , ,
.
, cd:
cd /path/to/dir
: /path/to/dir .
chmod:
chmod -R xxxx .

-R - , ,
xxxx - (, 0771),
. - .
: chmod
PHP.
: ftp
. , ,
100
100 ( ).
.
.

271

-
BitrixSetup.
, -
1-: ;

ftp ssh
, ftp,
ssh;

. ,
1-:
, .
ftp/ssh. ;


, .

1-:

, ,
/bitrix/php_interface/dbconn.php:
define("BX_FILE_PERMISSIONS", 0755);
define("BX_DIR_PERMISSIONS", 0755);

272



. :

- ,

; ,
. ., ,
;

- ,
, (
): .


( > >
> ) "
" " "
:

" " " ".

( >
> > ).
-
DOCUMENT_ROOT.

(DOCUMENT_ROOT)
.
.


( > ).
,
,
:

273

"-"

, :

274

( > >
)
;

:

275

:
;

:
;

:
;

:
;

:
,
;

:
, .

[],
, .
, (
, ).
:
(, ) ,
:

276


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

9.5 ()
.
! (
)
,
.
,
( /content/).
(). :
3.
:

277

4. , /content/ ( ),

[]:

278

5.
/content/ ( ) :

279

6. /content/
[].

,
(/content/).
! , -
, /
/bitrix/admin. , HTML-.
.

280


:
.
:

281

:
/bitrix/admin/:

,
.
:
, /bitrix/admin/.

/ ,
:

282

:
, ..
, .
.
-.

283


1-:
,
.


, , ,
.
( >
> > ):



.
(
):

284

, ,
, .


.
, .
.



, .

285

,
.
Ctrl.

, .

286


1C-:
,
.
, ,
,
.


1C-:
.
(,
), .
:

287

:
. ,

.
.
,
,
(..
).
( > > > ):

288


.
,
, ,
.
.
:

9.5

9.5 ("")

! , ,
, .

289



( > > ):

,
: , ,
, ..
,
.

.
, , :

,
;

!
,
.

,
ua. ,
,
ua.
.
! ,
() .

290

,
Windows-1251.
:
UTF-8. ,
UTF-8.


. :
1. ( ).

2.
:

291

3.
:

4. .
.



.
/
( > ):

292

(
);

(
).
.
.


.
: ,
( ).

293


.
:
( > ).

, :

294


,
,
.
, .
, :

, ;

,
( > ):

295

,
, . ,
, ,
:
: ,

:

296

: ,
.

, ( ,
).
show_lang_files=Y:

,
:

,
, .

297

,
.
,
:

OK:

, :

298

:
.

.

299


1C-:
,
.
,
: .

.
:
:

( -)

( ) ( -)

( . )


.

,
:

300


.
" ".

( > >
);

, (
);

,
( ).


,
.

301


( > > ):

,
:

:
o

,
;
:
/bitrix/themes/<_>.

/ ( );

:
+ Ctrl.

"" :

302

/
;

/
;

,
:

/ ,
.

, :
,
.

,

, .

303


,
, :

Ctrl + - :

,
, ;

Shift +
.

304


:
1.
( > ).
.


, , .

305

2. ,
. ..
.
,
:
o

/bitrix/admin/
( > > > bitrix > admin).

[left] .



:
SEPARATOR = Y
SECTION_ID = <>
SORT = 1000
:

SEPARATOR ,
;

SECTION_ID
my_menu;

SORT
;

306

<?
// ""
$aMenuLinks = Array(
Array(
"",
"",
Array(),
Array(
"SECTION_ID"=>"my_reports",
"SEPARATOR" => "Y",
"SORT" => 1400
),
""
)
);
?>
o


, ,
,
. :
SECTION_ID = catalog

307

, SECTION_ID
.

.
:

<?
// " "
". " (iblock)
$aMenuLinks = Array(
Array(
" ",
"/bitrix/admin/equipment_import.php?lang=ru",
Array(),
Array(
"ALT" => " dbf ",
"SECTION_ID" => "iblock",
"SORT" => "100"
)
)
);
?>

:
.

308


,
,
, ..

.



, 1-:

,
.
( > >
):


- .
, ,
.
.
.
: .
.

309

.
.
:

310



, .
, , ,
.
:

1-:
.

1: .

,
.

311


-
1-.
, .
,
,

.


(

).

site_checker_debug.php

/bitrix.

http://you_site.ru/bitrix/admin/site_checker.php.
!
, . (
- .)

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

312

,
. ,
.
.


( > > )
.

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


. Zlib,
.

313


(tar.gz).

-
.
( ,
10 ), () (
), .


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

314

PHP
PHP ( > > PHP)
PHP.
phpinfo().

315

SQL
SQL ( > > SQL )
SQL .
SQL.

! SQL ,
UPDATE, DELETE, DROP
..

PHP
PHP- ( > > PHP-)
PHP-, .

316


, PHP
() .
, ,
- .
:
.
PHP ,
cron,
.

( > > ):

,
.
:
.

317


1-:
,
:

( tar.gz);

, ;

,
;

( tar.gz);


1.

!
MySQL.

( > > ):
:

( )

:
o

( );

VPS ( );

( : ,
).

318

(
), (
MySQL),
.
:
,
.

( )
.

319


restore.php ,
<_>/restore.php .
: restore.php , ,
.
:
.



.

Bitrix Framework ,
.
,
.
,
.
:
1.

,
(cron);

2.

Unix
unix- (Linux, Freebsd ..)
cron. unix tar bzip
, MySQL mysqldump.

( )
( Bitrix Framework).
:
mysqldump -hhost -uuser -ppass dbname > dump.sql

320

:
tar -czf archive.tar.gz
, :
#!/bin/sh
###### Config ######
doc_root=/home/denis/www/test
host=localhost
username=username
password=secret
database=sitemanager_demo_start
charset=cp1251
###################
cd $doc_root &&
mysqldump -h$host -u$username -p$password --default-characterset=$charset $database > $doc_root/bitrix/backup/archive.sql &&
tar -czf $doc_root/bitrix/backup/archive.tar.gz . &&
echo OK
, :

( DOCUMENT_ROOT phpinfo),

. UTF-8 utf8,
.

: , ,
.
, ,
, bitrix/backup/ .
&& (,
).

321

, , , ,
, , , .
.


--exclude bitrix/backup/,
, , .
, Bitrix Framework, ,
bitrix/php_interface/dbconn.php.
.
#!/bin/sh
doc_root=$1
name=$2
if [ -z $doc_root ]; then
echo Usage: $0 /path/to/document/root [backup_name]
exit
fi
if [ -z $name ]; then
name=backup
fi
dbconn=$doc_root/bitrix/php_interface/dbconn.php
readcfg() {
grep $1 $dbconn | sed 's/.*"\(.*\)".*/\1/'
}
host=`readcfg DBHost`
username=`readcfg DBLogin`
password=`readcfg DBPassword`
database=`readcfg DBName`
utf=`grep 'BX_UTF' $dbconn | grep true`
if [ -z "$utf" ]; then
charset=cp1251
else
charset=utf8

322

fi
backup_dir=$doc_root/bitrix/backup
if [ ! -e $backup_dir ]; then
mkdir $backup_dir
fi
cd $doc_root &&
mysqldump -h$host -u$username -p$password --default-characterset=$charset $database > $backup_dir/$name.sql &&
tar -cf $backup_dir/$name.tar $backup_dir/$name.sql &&
rm $backup_dir/$name.sql &&
tar -rf $backup_dir/$name.tar --exclude '*bitrix/tmp/*' --exclude
'*bitrix/updates/*' --exclude '*bitrix/backup/*' --exclude
'*bitrix/*cache/*' . &&
gzip -f -9 $backup_dir/$name.tar &&
echo OK && exit
echo Error
dbconn.php, ,
. . .
bitrix/backup/.
:
( , backup).
, Error.


, - .
, . ,
:

echo OK && exit

find $backup_dir -ctime +7 -exec rm {} \; && echo OK && exit


323

.
- . -
. .
.

mysqldump -h$host -u$username -p$password --default-characterset=$charset $database > $backup_dir/$name.sql

mysql -h$host -u$username -p$password --default-characterset=$charset $database < $backup_dir/$name.sql


.
!
.

?
,
, backup.sh, :
chmod +x backup.sh
:
./backup.sh
OK, bitrix/backup backup.tar.gz.
,
: http://portal.ru/bitrix/backup/backup.tar.gz. :
/home/denis/bin/backup.sh /var/www/test f43tg245g2_backup
cron.
, :
crontab -e

324

0 1 * * * /home/denis/bin/backup.sh /var/www/test
f43tg245g2_backup
, ,
:
0 1 * * * /home/denis/bin/backup.sh /var/www/test
f43tg245g2_backup_`date +\%Y\%m\%d`
cron (
),
.

Windows
, shell- .
, PHP.
mysqldump, ,
( ).
tar.gz Bitrix Framework ( ,
). : -
, - .
, : -,
E:\WEB. :
e:\web\apache\php e:\web\www\test\backup.php e:\web\www\test
:
$backup_dir/$name.sql");
require($_SERVER['DOCUMENT_ROOT'].'/bitrix/modules/main/classes/gener
al/tar_gz.php');
function getmicrotime()
{
list($usec, $sec) = explode(" ", microtime());
return ((float)$usec + (float)$sec);
}

function Store($path)

325

{
global $arch;
$path = str_replace('\\','/',$path);
if
(preg_match('#^'.$_SERVER['DOCUMENT_ROOT'].'/bitrix/backup#',$path)
||
preg_match('#^'.$_SERVER['DOCUMENT_ROOT'].'/bitrix/[^/]*cache/#',$pat
h))
return;
$arch->AddFile($path,'',$_SERVER['DOCUMENT_ROOT']);
if (is_dir($path))
{
$dir = opendir($path);
while(false !== $file=readdir($dir))
{
if ($file=='.' || $file=='..')
continue;
Store($path.'/'.$file);
}
closedir($dir);
}
}
$arch = new CArchiver($backup_dir.'/'.$name.'.tar.gz', true);
$arch->_openWrite();
$arch->AddFile("$backup_dir/$name.sql",'',$_SERVER['DOCUMENT_ROOT']);
Store($_SERVER['DOCUMENT_ROOT']);
$arch->_close();
unlink("$backup_dir/$name.sql");
?>
, unix-,
php- .

326


/ ( > >
) .

.
! MySQL
MyISAM.

! -
. ,
!

327

:
,
?no_keep_statistic_LICENSE-KEY=Y.
.
!
.


: (login) (password) . :
http://www.mysite.ru/bitrix/admin/repair_db.php?login=DB_Login& password=DB_Password.

/bitrix/php_interface/dbconn.php.

,
.
/bitrix/php_interface/dbconn.php, ,
$DBDebug = true;
, , ,
.
, .

328


( > > )
.
.

! -
. .
.


( > > )
.

329

:
.
: , ,
( >
> > ).


- .
, - : ,
.
.
.
- ,
.

330

-
.
:

-, ;

26 39 ;

12 .

:
:

-
;

,
.

: , ;

: ,
;

-.

,
. .

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

.
.

331

- , .
.
.

( >
> ).
.
,
. .


, , - :

,
:

332



, .
. :

333

,
:

( );

:
.

334

- ,
.


,
( ).


.


. ,
> >
.

335


.
() +
.
, .

.
.
-
.

-,

. , .
, -
.


Bitrix Framework.
, ,
.
,
. :

SEO-;

CodeStyle;

336



1-:
:

HTML


( > > ).

337




.
, ,
-,
.
. ,
,
.
!

, ,
.
:

338

.
, ,
, .
: ,
+
.
, :
1. ,
:

: ,
,
( )
, , .
.

339

,
.
: -

.
:
, ,
.
() .
2.
.

3. ,

+ .
4. ,
+ .
. .
5.
.

340

: ,
.


.
:
+
.

, .

, .


.
/bitrix/cache/.
,
. ,
,
,
.


(ache Dependencies)
. ,

, .
- ,
.

341

! .
:

: ache Dependencies, ,
, Memcached, APC, eAccelerator.
.

HTML
, .
, .
.
.

,
- PHP -
.

, HTML .
, ,

-
.
,
, .
HTML AJAX
2.0. .

342

! . ,
HTML ( ) ,
- .
HTML- -
,
HTML- :

HTML- ,
;

,
,
, ; ,
( ),
, ;

,
;

, ;
, HTML-;

,
;

POST (,
), ;

,
(,
, ).
, :

(
(Begun .));

,
( , );

HTML-
DOS- ;

HTML-
, (,
);

HTML HTML :

343

,
html .

,
html .

() (
).

HTML .

.


,
, .

API.
, - .
: ,
.

344


,
:

, ;

,
, . ;

/bitrix/managed_cache/;

HTML HTML .


.
.

/bitrix/cache/
.
,

-. .

BX_FILE_PERMISSIONS BX_DIR_PERMISSIONS /bitrix/php_interface/dbconn.php,

:
umask(000);
@umask(~BX_DIR_PERMISSIONS);

345

CAPTCHA
CAPTCHA ( . Completely Automated Public Turing test to tell Computers and
Humans Apart
) , ,
, :
. : ,
,
. .
! CAPTCHA
FreeType library GD ( imagecreatetruecolor
imagejpeg). .

CAPTCHA
CAPTCHA ( > > CAPTCHA)
.

346


CAPTCHA .
:
CAPTCHA.

CAPTCHA , ,
. :

- 40-50%,

- -30 30,

bitrix_captcha.ttf -
.

,
.
.

347

CAPTCHA, :

:
/bitrix/modules/main/fonts/. *.ttf.
!
CAPTCHA.
:

CAPTCHA

CAPTCHA

CAPTCHA

CAPTHA

CAPTCHA
, , Wiki ..., CAPTCHA
.
CAPTCHA :

348

CAPTCHA
CAPTCHA .

CAPTCHA
CAPTCHA , ,
( ), ( )
...
CAPTCHA :

349

(CAPTCHA)
CAPTCHA
.
: CAPTCHA
.

CAPTCHA

CAPTCHA

/, , ,
...

:

CAPTCHA

350

CAPTCHA
,
CAPTCHA .
CAPTCHA ,
CAPTCHA :
01
<?include_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/cl
asses/general/captcha.php");
02

$cpt = new CCaptcha();

03
$captchaPass = COption::GetOptionString("main",
"captcha_password", "");
04

if(strlen($captchaPass) <= 0)

05

06

$captchaPass = randString(10);

351

07
COption::SetOptionString("main", "captcha_password",
$captchaPass);
08

09

$cpt->SetCodeCrypt($captchaPass);

10

?>

:
, .
<input name="captcha_code" value="<?=htmlspecialchars($cpt>GetCodeCrypt());?>" type="hidden">
<input id="captcha_word" name="captcha_word" type="text">
<img
src="/bitrix/tools/captcha.php?captcha_code=%3C?=htmlspecialchars%28$c
pt-%3EGetCodeCrypt%28%29%29;?%3E">
, , :
01

<?

02
if(!$APPLICATION->CaptchaCheckCode($_POST["captcha_word"],
$_POST["captcha_code"]))
03

04

//

05

06

else

07

08

//

09

10

?>


,
.

352

.
, :

,
.

, FTP.
( SFTP/SCP)

SSL.

Bitrix Framework.

! Bitrix Framework
- .
,
(, , Java, ).


, SSL.
SSL
.
. .
- ,
. SSL.
.
, .
, ,
( WiFi). ,
, ( IP,
). , ,
SSL.

:

:
, .
.

353

RSA.
RSA ( Rivest,
.

Shamir

Adleman)

, .
PHP openssl, 1024- .
. ,
mbmath 512- . ,
.
. ,
.
!
Javascripts.
:

, Javascript ,
, ,
.

, ,
, .

354

4.


. ,
. ,
, , ,
.
! ,
. ..
,
.
:
, , , .
, .
! .

355


( >
> > ).
.
.


. , ,
, , .


, , .
.

,
, ;

,
.


, .

356


.
,
- (, , ..). ,
, , ,
(, ). ,
C,
, .
.
: ,
.

357


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

, .
,
, .

358

359


(search.form)
(search.page).
:
.


( )

(search.form):

,
.

360


.
:


(bitrix:search.page).
HTML-:

361

:
, tags.
.

, .
:
.
.
,
.

362

(bitrix:search.page)
1. ,

OK:



, ,
. :

2. . ,
, ( , ).
, ,
.
:
o


(bitrix:search.page);

:

O:


<_>.
, (
) :

363


(
).
,
.
:

, HTML
(, ,
..) .
!
, , , ,
($APPLICATION -> SetTITLE<>).
, , , ,
.
.

, , ,
, .
, FTP
.
( ).
.
,
, URL
.

. ,
.

364


( > > ):

,
.
,
( ),
/ ,
( ).
:

,
: .
, .
InnoDB
.
, (, 50000).

() .
.
, .
(
) .

,
.
. (
,
.)
.
,

365

, .
50 .

,
.
.

!
.
:
(
(socialnetwork), (socialnetwork_group),
(socialnetwork_user)):

,
:

366


,
, .
:


, ,
;

( ) .

,
:
:

,
. ,
, .
,
(, page rank) .
, , ,
, , .
:

( );

367

(
, ,
);

( , ).

( ID ).

( ID ID ).


( > > ):

: - ,
;

368

:
.

,
.

,
.

,
, ;

,
.

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

:

369

: ,
.


1-:
. (,
, ) .
, ,
(, ..),
(, , ..).
, ,
, , , , ,
..

( > > >
) :

370

:
, ,
(, , ..). , , ,
, (, : ).
, C,

(
) ,
.

(
> > ). 3 :

, ,
, ..

,
;

371


,
. :


. ,
:
.

And, &, +

Or, >

Not, ~

,
, .

()


. ,

""

. .

372


,
, .


,
.

( )
,
, .


, ..
, , , ,
.

. , ,
, .
- .
: , , ,
.
,
, . :
.


, .
:

373

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

374

,
.


, ,
.
( ).
, , ,

. ,
(, ), .. ,
. ,
.
:
(bitrix:search.tags.cloud), (bitrix:search.tags.input)
(bitrix:search.page) ( tags
).
, .
,
(bitrix:search.tags.cloud):

375

: ,
.
- , , .
,
(bitrix:search.page) tags:

376

, ,
. ,
.

Google Sitemap
Google Sitemap
Google, .
Google Sitemap ,
,
Google.
: Google Sitemap
, , Yandex.

Google Sitemap , :

Google

Google
.


Google Google
.

Google.

.
, , ,
.
, .. ,
, .

: Google
.

Sitemap

Google Sitemap XML-,


.
Google Sitemap Google.
Google Sitemap Google Sitemap
( > > Google Sitemap):

377

! Google Sitemap sitemap_*.xml,


, .
:

Google
Sitemap

.
.
,
.
Google Sitemap ,
,
, .
Google Sitemap
:

378

. ,
, .
Google Sitemap.
changefreq priority. Google
Sitemap
.
:
Change frequency , -.
: never, weekly, daily, hourly, monthly, yearly.
riority , Google
- . : 0.0
( ), 1.0 ( ), 0.5 ( ).
11 , Google Sitemap
. XML-.


,
. ,
, ,
.
.
, -
1015%,
(2050).
3 :


, ,
:

SQL ( > > SQL )

:
select STEM,count(*) from b_search_content_stem group by STEM
order by count(*) desc limit 100

379

100
:

: .
.
, .
:
<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/header.php");
$query = $DB->Query("select STEM,count(*) from b_search_content_stem
group by STEM order by count(*) desc limit 100");
while($ar = $query->Fetch())
echo " ,",$ar["STEM"];
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/footer.php");
?>
.
: !

380



init.php , :
define("STEMMING_STOP_RU", ", , , ");
: 2- .
STEMMING_STOP_RU,
STEMMING_STOP_EN.


.

( > > ).
: .

/
.

5.9.3, ,
,
. 23 .


/ ( >
> ).

381


(404 - HTTP not found)
URL
. URL
,
URL ,
,
404-.

:
,

382


.
.
, , URL,
, URL
.
.
, .
!
.

383

5.



:
,
. , , , ..
, ,
, .
,
.
.
:


,
() .

.

.
,
.
:

384

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

: ,
;

RSS;


( > >
).


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

( ), ;

URL ,
;

. ,
, , , ,
.
;

RSS ( RSS
).


.

( > . > . >
__).

385


,
.
.
.


,
. , , , , ,
..
,

.
.

.

386

.

. -
,
: .
,
.
.

, , -,
, .

:

.
, .
, ,
. ,

.

387

/
- .
/
.

RSS
RSS ,
. RSS RSS
() (bitrix:rss.out), > RSS
.
, ,
. .
RSS , .
C RSS
(, , ..) .
RSS ,
RSS ( > >
> <__>):

, ,
( > >
> ):

388

: .

RSS
(, ),
(bitrix:news).
:
, HTML (,
/content/news/index.php).
: , RSS ;

: ,

RSS.

389

, , rss
RSS:

- (/content/news/index.php).

390

RSS
, RSS,
RSS () (bitrix:rss.show),
> RSS.

,
, rss , (
, ).
.

391

392

CSV
CSV
( > > > CSV).
:
, > >
.
. .
:
1.
, :

2.
:

, ;

, .

393

.
3.
:

, ,
.
: 3 .

394

CSV
, CSV ,
( >
> > CSV).
: CSV:
. >
> .
. .

1.
( ),
. :

2.
:

395

3.
,
:

4.
:

396

XML
XML
, .
.

XML ( > . > > XML).

,
.
<_>.xml.

,
;


. 0, .


. ,
, :

397

XML
, .
XML ( > . > > XML).

... XML
. ,
, .
: ,
, .
, , ,
, :

, ,
.
, ,
, .

398

,
XML . , ,

, .
,
,
, .
,
. ,
:

399


.
! 1-:
,
, , , ID .
,
. : goods_for_fishing.
.



( > >
> ).

400

.
:

(ID) , .
, .
, ,
.

. .
,

.

:
, .

401



( > . > . >
___).
.

402

.
,
:

,
.
-
.

RSS
RSS,
.

, ,
.
.

, .

.
, ,
, , ,
.
, ,
, .
.

URL ,
.

403

CSV
, CSV,
. 1-:

;.
,
.
: |,
.
MS Excel.
, ,
. MS Excel
csv.
: CSV MS Excel 2007
;. Excel ,.

.

CSV
CSV :
.
: ID .
ID .
.
,
.
.

404


,
, ,
, .
.
.
.
,
.
:
o

,
, .
,
.

.
,
.
.

,
,
.
, .
.

, .
.


. , ,
,
CSV
.


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

405

,
, 1-:
, CSV . 1-:

.


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


.
.


. CSV
.
,
. /upload.

406



. ,
-
.
.
/
/ .
-
.



.

( > . > . > _).

.

407

() .
, , .

408

: , .
, .


. - - ,
.

:
( ) ,
: .
.
text, html.
CSV html-.
.
, . ,
, -
. : "
", : " ".
:

.
: .


, , :
.
,
. . ,
, .
, .
,
,
.

.

.
, .

409


. .
,
.
,
, .

:
: jpg, gif, png.
, bmp, ,
. ,
.

.
.
, .
.
.

, .

.
/
- .
/ ,
/ .
:
.

, .
:
.

410


/.

411

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


.

:

412

:

-
, .

:

413

414


:
,

415

" - 2007"

416

Ctrl ,
,

417


Ctrl
, ,
">"

418


()

419

420

.
( ),
. ( )
( ), ,
">"

421



/
/

422



,
, .

423


:
http://dev.1c-bitrix.ru/download/files/video/learning/calendar.flv

424

6.


HTML-.

, ,
.
,
1-
310 ,
.
UNIX- Windows-,
- Apache.
. ,

,
,
.
! ,
, ,
( > ) .
:
Bitrix Framework.
-.

425

-
- ,
, , Windows.
. Windows-
, . -
, , ,
.
( ) ,
, , .
, ,
, -
( 32256 ) ( 3090 ). ,
-
,
.
- Bitrix
Framework (PHP ) .

PHP-
HTML- ,
. -,
- TCP/IP .
,
, . ,
.

-, ,
,
. ,
-
.
"1C-: "
PHP. PHP 5.0.0 .
PHP: (. PHP: Hypertext Preprocessor PHP: )
,
-.
-
, -.

426

PHP , ,
, Perl C: , ,
HTML-
, HTML- PHP. PHP
,
PHP HTML-, PHP-.
PHP - , ,
, JavaScript, , PHP- .
PHP-,
, , .
, HTML-
PHP, ,
HTML- .
, , PHP
. - ,
PHP,
PHP,
, ,
, PHP .
, HTML-, PHP
-. -
,
PHP .
HTML- .
!
,
.


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

- ,
.
TCP/IP , SQL-
.

427

-:

(Persistent).


. (
) .

(
PHP

*_pconnect)

, ,
.
, -
( TCP/IP ,
, ,
),
,
.
: ,
server localhost localhost:port, PHP
TCP/IP.
TCP/IP, 127.0.0.1 localhost.
TCP/IP
,
.
TCP/IP ,
.
, PHP-
-. ,
. 1-:
,
PHP.
1-:
: /bitrix/php_interface/dbconn.php
:
define("DBPersistent", true);
$DBType = "mysql";
$DBHost = "localhost:31006";
$DBLogin = "root";

428

$DBPassword = "";
$DBName = "bsm_demo";
$DBDebug = false;
$DBDebugToFile = false;
DBPersistent, .
:
define("DBPersistent", false);
Apache
MySQL. , .
PHP
.

1-: :

MySQL

MSSQL Express 2005

OracleXE

Oracle

MSSQL 2005

429

?
,
:

-;

: , , ;

: ,
- , , ,
, .

?
,
, .

.
-
-:

-,
PHP . ,
. , -
, , css
.

430


PHP
.
, , ,
apache, -. 2010
apache 64 500 ,
-.

:

1. .
2. PHP. .
3. .
4.
5. . .


- Apache , -
, . ,
, PHP
.
, Apache ,
PHP.
-
Apache,

431

, ,
.
,
.
. : .
0.1 ,
5 (
).
0.1, . ,
100 .

100 500
-. ? . ,
0.1., , ,
, ,
5 . 100 100 .
, 500

.
, 500
, 32 .
, 0.001 ,
,
, . ..
PHP
.

100 . 100
10 . 0.1 .
,
. .. 1 , - 10
! ,
10
. , .
, 10 ,
640 . ,
0.01
10 , 1

432

100 .
PHP .
, ,
-. .
, , ,
-
.

433

PHP,
PHP. .
60% - PHP-
.
PHP-, PHP
.

,
.
,
.

.
.
. .
,
,
.
.

434


,
:


- .
-.
Apache PHP-
64500 .
(
). ,
, ,
.


.
,

.
, ,
,
,
. ,
.


,
. MySQL.
, MySQL MyISAM.
, , ,

. ,
, ,
, ,
. , ,
.
, Oracle
MSSQL, MySQL InnoDB.

-
.
.

. ,
, ,
, ,
,
.

435

- Front-End Back-End

Front-End + Back-End .
Front-End ,
, Back-End
.
Back-End ,
PHP-, -
.
.
:

Front-end
Front-end ,
.
Front-End NGINX, SQUID, OOPS
.
NGINX - (HTTP-).
,

. , , NGINX
.
SQUID OOPS -,
,

.

436

NGINX.
-
.
Front-end
- -,
, ,
Back-End. NGINX ,
.
-, ,
Back-end .
Front-end
Back-end.
, Front-end :

, Back-end -.
, Front-end Back-end
PHP-.
Front-end
- ,
.
: Back-end -, ,
.
PHP,
Back-end .


.
PHP-. Front-end 2-5

.
.

. ,
HTML-, PHP- Back-end -,
Front-end ,
. , Front-end,
Back-end, , Back-end
, ,
.
, .
! , Front-end ,
Back-end . ..

.

Back-end
Back-end . ,
Front-end 51015 ,

437

Back-end. Back-end ,
.
, Front-end

! - Front-End,
.
, XML- -
.
- BackEnd Apache.
3-5 . .htaccess
-:
ExpiresActive on
ExpiresByType image/jpeg "access plus 3 day"
ExpiresByType image/gif "access plus 3 day"

, -
.htaccess mod_expires .
Front-end
Back-end.
, Front-end .
Back-end.

438

Back-end
Back-end - Apache, PHP.
Back-end ,
- Front-end. ,
Back-end 99%
PHP-. ,
Back-end .
Back-end,
. Back-end
- Apache, ,
, 88 localhost IP Frontend.
: IP
127.0.0.2, 127.0.0.3 .. 80- ,
Front-end.

Front-End Back-End
.

Front-end, ,
http://www.1c-bitrix.ru/ 80 . NGINX
Front-end.

Back-end (- Apache PHP),


http://127.0.0.2:80.

Back-end -,
PHP HTML- .

HTML- Back-end Front-end


, Front-end Back-end
( KeepAlive Back-end), Back-end
.

Front-end
, ,
. Front-end
.

,
.
Front-end Back-end, ..

Back-end.

439



Front-end ( ).
NGINX, ,
, back-end (Apache). Back-end
. nginx 12:50.
- :

apache:

, Front-end + Back-end
, ,

.
, , ,
, . ,
NGINX - 5 .

440

Back-end
,
.

Back-end Apache
MaxClients 5 50, .
80%
, . MaxClients,
Back-end.
,
.
MaxClients
MaxClients:

:
top Linux, ,
, .

441

- 4-
5 . swap- 4 .
MaxClients 100. apache 250 ,
, 40
apache.
.
, MaxClients ,
.


. ,
Back-end . , 50 . MaxClients 4,
200 . 512
MaxClients 5-10.
Front-end, Back-end,
50
10-20 .

MaxClients
.
! MaxClients ,
90% 100%.

,
.
, Front-end
, Back-end, Front-end
. , Back-end
.
Back-end
MaxClients. , MaxClients = 5,
:
MinSpareServers 5
StartServers 5
MaxClients 5

442

.. , Backend, .

Front-end. Back-end
, .
! MaxClients,
, 5. .
,
( ?show_page_exec_time=Y)
,
,
Back-end. , Front-end
Back-end .
MaxClients,
.

MaxClients
MaxClients .
(
12- )
. MaxClients
, ,
Back-end.
. ,
MaxClients Back-end
, .
! ,

.
(. ).
, :

443

PHP
! 60% -
PHP- .
PHP.
PHP :

Zend Performance Suite

Alternative PHP Cache (APC)

eAccelerator

Turck MMCache

PHP Accelerator

AfterBurner Cache

PHP
Zend Server (CE) APC (Alternative PHP Cache),
, .

PHP-. 32-64 ,
128 ,
.
PHP ,
-, PHP
( ).
-,
PHP,
.
,
PHP. -
.
PHP-
,
session.save_handler=mm php.ini. ,
RAM .

444


PHP
, "1-".

( > >
). PHP:

,
.
.
, .



.
HTML-
, ,
.
Front-End.
Back-End.
:

mod_deflate;

, 1-;

PHP ;

Apache.

445


. , Frontend Apache
"1-: ".


, ,
, NGINX .
IP
Front-end Back-end.
, NGINX : NGINX
, apache (rpaf
real_ip) .
, .
, HTTP_X_FORWARDED_FOR (
- SQUID),
/bitrix/php_interface/dbconn.php :
if(strlen($_SERVER["HTTP_X_FORWARDED_FOR"])>0 &&
$_SERVER["REMOTE_ADDR"]=="127.0.0.1")
{
if($p = strrpos($_SERVER["HTTP_X_FORWARDED_FOR"], ","))
{
$_SERVER["REMOTE_ADDR"] = $REMOTE_ADDR =
trim(substr($_SERVER["HTTP_X_FORWARDED_FOR"], $p+1));
$_SERVER["HTTP_X_FORWARDED_FOR"] =
substr($_SERVER["HTTP_X_FORWARDED_FOR"], 0, $p);
}
else
$_SERVER["REMOTE_ADDR"]=$REMOTE_ADDR=$_SERVER["HTTP_X_FORWARDED_FOR"];
}
, Apache Back-end KeepAlive.
Front-end , ,
.

446

; Front-End Back-End
,
;


, Back-end
MaxClients, Front-end
Back-end;


Back-end MaxClients,
;


;
Back-end ,
;

PHP;

447


BitrixVM.
:

- Apache Back-end

NGINX Front-end

Zend Server CE PHP ( )

MySQL .


ssh sftp.

- Apache
- /etc/apache2/apache2.conf
( /etc/httpd/httpd.conf). ,
- .
, ( ).
.
/etc/apache2/apache2.conf:
Timeout 300 # 300 ,

KeepAlive Off #
User ${APACHE_RUN_USER} #, -
Group ${APACHE_RUN_GROUP} #, -
/etc/apache2/ports.conf:
Listen *:8888 #- 8888

/etc/apache2/envvars:
.
export APACHE_RUN_USER=bitrix
export APACHE_RUN_GROUP=bitrix

/etc/apache2/conf.d/prefork: .
#
StartServers 4 #4

448

MinSpareServers 4
MaxSpareServers 4
MaxClients 4 #4
MaxRequestsPerChild 200 # 200
, - . ,
, -
MaxClients .

: -
-? ,
.
, apache
:
Linux free.
:
# free
total

used

free

shared

buffers

255676

224340

31336

33468

-/+ buffers/cache:

122908

132768

51800

478336

cached
Mem:
67964

Swap:

530136

, ~256 , ~500 swap (


). ~120 ,

top
, top.
apache2:
PID USER

PR

NI

VIRT

RES

SHR S %CPU %MEM

14687 bitrix

20

153m

45m

28m R

6.7 18.2

TIME+

COMMAND

0:05.34 apache2

RES ,
. , 1-

: 50 . ,
449

MaxClients 4 ,
.
, ( -)
- ( VPS) 512 .
- 1 VPS
1 .

Front-end NGINX
NGINX /etc/nginx/.
/etc/nginx/nginx.conf:
user
bitrix; #, nginx.
apache
worker_processes 8; #8
error_log /var/log/nginx/error.log warn;
pid
/var/run/nginx.pid;
worker_rlimit_nofile 10240; #

events {
use epoll;
worker_connections 10240; #
.
max_clients = worker_processes * worker_connections, .. 81920
,
}
http {
include
default_type

/etc/nginx/mime.types;
application/octet-stream;

#
log_format
[$time_local] $status'

main

'$remote_addr - $remote_user

'"$request" $body_bytes_sent
"$http_referer" '
'"$http_user_agent"
"$http_x_forwarded_for"';
log_format
common '$remote_addr - [$time_local] "$request" $status $bytes_sent "$http_referer"
"$http_user_agent" $msec';
access_log /var/log/nginx/access.log common;
sendfile
on;
tcp_nopush
on;
tcp_nodelay
on;
client_max_body_size
10m; #
, "ContentLength"
client_body_buffer_size
128k;
proxy_connect_timeout
300; #

450

proxy_send_timeout
300;
proxy_read_timeout
300;
proxy_buffer_size
64k;
proxy_buffers
8 64k;
proxy_busy_buffers_size
64k;
proxy_temp_file_write_size 10m;
gzip on; #
gzip_proxied any;
gzip_types application/x-javascript text/css;
server { #
listen 80; # 80
server_name bitrix; # .

server_name_in_redirect off; # ON

access_log /var/log/nginx/access.log common;
index index.php;
error_page 500 502 503 504 /500.html;
error_page 404 = /404.php;
#

proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For
$proxy_add_x_forwarded_for;
proxy_set_header Host $host:80;
client_max_body_size 1024M; #

client_body_buffer_size 4M;
root /var/www; #
# https .htsecure
if (-f /home/bitrix/www/.htsecure) {
rewrite ^(.*)$ https://$host$1 permanent;
}
#, backend ,

# backend
# ,

NGINX -
backend
location / { expires 3d;
if ($request_method = OPTIONS ) {
proxy_pass
http://127.0.0.1:8888;
}
if ($request_method = PROPFIND ) {
proxy_pass
http://127.0.0.1:8888;
}
if ($request_method = PROPPATCH ) {
proxy_pass
http://127.0.0.1:8888;
}

451

if ($request_method = MKCOL ) {
proxy_pass
http://127.0.0.1:8888;
}
if ($request_method = COPY ) {
proxy_pass
http://127.0.0.1:8888;
}
if ($request_method = MOVE ) {
proxy_pass
http://127.0.0.1:8888;
}
if ($request_method = LOCK ) {
proxy_pass
http://127.0.0.1:8888;
}
if ($request_method = UNLOCK ) {
proxy_pass
http://127.0.0.1:8888;
}
}
location ~
^(/extranet/docs|/docs|/workgroups|/company/profile|/bitrix/tools|/com
pany/personal/user).*/$ {
proxy_pass
http://127.0.0.1:8888;
}
location ~
^(/extranet/docs|/docs|/workgroups|/company/profile|/bitrix/tools|/com
pany/personal/user) {
if (-d $request_filename) {
rewrite ^(.*)(/*)$ $1/ last;
}
proxy_pass
http://127.0.0.1:8888;
}
location ~ ^(/bitrix/html_pages)
{
root /var/www;
index index@.html;
if (!-f $request_filename)
{
rewrite
^/bitrix/html_pages(.*)@(.*)\.html$ $1.php?$2 break;
rewrite ^/bitrix/html_pages(.*)\.html$
$1\.php break;
proxy_pass http://127.0.0.1:8888;
}
}
location ~ \.php$ {
root
/var/www;
if ($request_method = POST ) {
break;

452

proxy_pass
http://127.0.0.1:8888;
}
if ($http_cookie !~ "PHPSESSID=" ) {
rewrite ^(.*)\.php$
/bitrix/html_pages$1@$args.html? last;
}
proxy_pass http://127.0.0.1:8888;
}
location ~ /$ {
root
/var/www;
if ($request_method = POST ) {
break;
proxy_pass
http://127.0.0.1:8888;
}
if ($http_cookie !~ "PHPSESSID=" ) {
rewrite ^(.*)/$
/bitrix/html_pages$1/index@$args.html? last;
}
proxy_pass http://127.0.0.1:8888;
}
location ~ (/|\.php|\.asmx)$ {
proxy_pass
http://127.0.0.1:8888;
}
location ~ /\.ht {
deny all;
}
location ~ /favicon.ico {
proxy_pass
http://127.0.0.1:8888;
}
location ~ ^(/bitrixsetup\.php)$ {
proxy_pass
http://127.0.0.1:8888;
proxy_buffering off;
}
}
# https ()
}
NGINX ,
Back-end . ,
NGINX.
.
NGINX
www.nginx.ru wiki.nginx.org.

453

NGINX
, NGINX,
, :
location ~* \.(jpg|jpeg|gif)$ {
root

/var/www;

access_log

off;

expires

3d;

}
jpg, jpeg gif
NGINX, /var/www.

454


MySQL, Oracle, MSSQL
.
,
.
,
, . ..
.
.


,
:

;
,
;

;
,
.


, ,
;

;
,
,
;
SQL ;

,

.
,
.
,
.
60-80%
.

455


, (MySQL\Oracle),
(
max_connections processes ).
Front-end/Back-end

.
MaxClients - Back-end,
,
.
max_connections ,
1020% .

MySQL
MySQL-
,
.
MySQL MyISAM.
. ,
,

.
MyISAM
. ,
MySQL MyISAM ,
.

MySQL.
InnoDB.
InnoDB, MySQL 4.0,
,
.
, InnoDB
MyISAM:
1. . MyISAM , ,
, .

456

(, ) .
InnoDB . , .
, .
, .
InnoDB:
; (
InnoDB MyISAM ).
2. . MyISAM ,
, . ,
.
.
InnoDB ( ),
, , MyISAM.
InnoDB :
> > SQL
:
SHOW TABLES
.
:
ALTER TABLE < >, type=InnoDB
FAQ InnoDB.
InnoDB
/bitrix/php_interface/dbconn.php :
define("MYSQL_TABLE_TYPE", "InnoDB");
InnoDB

.
!

InnoDB.

InnoDB
my.cnf MySQL InnoDB innodb_*.
:
set-variable
set-variable
set-variable
set-variable
set-variable
set-variable

=
=
=
=
=
=

innodb_buffer_pool_size=250M
innodb_additional_mem_pool_size=50M
innodb_file_io_threads=8
innodb_lock_wait_timeout=50
innodb_log_buffer_size=8M
innodb_flush_log_at_trx_commit=0

457

:
, , set-variable
= innodb_flush_log_at_trx_commit=0.
MyISAM , InnoDB
.
, ,
. 6080%
.
: (multithreading) MySQL

.
2 ,
FreeBSD/Linux:
set-variable = table_cache=4096
250 ,
.
set-variable = key_buffer_size=16M
set-variable = sort_buffer=8M
set-variable = read_buffer_size=16M
MyISAM. MyISAM,
.
set-variable = query_cache_size=64M
set-variable = query_cache_type=1
. 32 (
Qcache_lowmem_prunes). - 1
, .
set-variable = innodb_buffer_pool_size=780M
, .
set-variable = innodb_additional_mem_pool_size=20M
, .
set-variable = innodb_log_file_size=100M
set-variable = innodb_log_buffer_size=16M

458

-,
. -
innodb_buffer_pool_size ( ).
set-variable = innodb_flush_log_at_trx_commit=0
,
set-variable = tmp_table_size=32m
32 .
join_buffer_size 2 ,
.
set-variable = join_buffer_size = 2M
InnoDB
.
,
. , MyISAM
InnoDB ,
, innodb_buffer_pool_size.

InnoDB.
! -
MyISAM, MySQL
,
. 6080%
.

459

Oracle
1C-:
Oracle 9i 10g.
Oracle
. Oracle
,
,
, .
Oracle
-.
Oracle Oracle
,
.
.
60-80%
:
db_cache_size
shared_pool_size
pga_aggregate_target
Oracle 10, Automatic Shared Memory
Management:

, % , 6080%
SGA_MAX_SIZE

, Oracle
( )
SGA_TARGET .
swap,
swap
100 MB.

SGA (shared_pool)
SQL-, ,

cursor_sharing = FORCE

cursor_sharing = SIMILAR
:

460

begin dbms_stats.set_param( 'METHOD_OPT', 'FOR ALL COLUMNS SIZE 1'


end;

);

Oracle , -,
IPC (PROTOCOL = IPC) (KEY = EXTPROC)
IP-.
Front-end Back-end
MaxClients,
PHP Oracle (Persistent connection),
/bitrix/php_interface/dbconn.php:
define("DBPersistent",true);
: Oracle 10g R2,
(Enhanced COMMIT) , -
.
,

.
, : COMMIT_WRITE='BATCH,NOWAIT'.

-
MySQL
MySQL
BitrixVM.
/etc/mysql/ MySQL .
(, 512
). , /etc/mysql/conf.d/bvat.cnf:
256 :
[mysqld]
query_cache_size=32M
innodb_buffer_pool_size=32M
512 :
[mysqld]
query_cache_size=48M
innodb_buffer_pool_size=96M

461

, 512 :
256 :
# free
total

used

free

shared

buffers

255676

224340

31336

33468

-/+ buffers/cache:

122908

132768

51800

478336

total

used

free

shared

buffers

515572

299208

216364

6944

-/+ buffers/cache:

105928

409644

530136

cached
Mem:
67964

Swap:

530136

512 :
# free
cached
Mem:
186336

Swap:

530136

, BitrixVM ,
.
, .
:
.
/etc/mysql/conf.d/2_bx_custom.cnf.

462


,
,
, 1C-:
.
:
, ,
.

- .
:

" "

" " ()

()

()

. ()

()



( > > >
).

463

URL -
,
URL' , .

- SQL .
SQL ( >
> SQL ).

PHP - PHP.
PHP ( >
> PHP).

-
.
( > >
).
,
, :
: (::).

-
.

: Bitrix Framework
.



, :

464

:
SQL-, .

.
:

- SQL-, ,
;

SQL- - SQL-,
;

- (,
);

- ;

- .

SQL- :

SQL
(. ).

465


SQL-

:
:

466


.
.


,
: n,
, :

, :

467

:
.
.



, ( >
):

SQL ;

PHP;

PHP.

468

(
>
> ) :

469


: ( >
> ) :

>>
:

470

:
( > )

>> :
( > > ),
:

471

( )
SQL SQL .

.

472

(
>
> )
:

SQL
SQL .

473

SQL

(
> SQL ) SQL:

>

: ,
.

:

474


( > > )
:

475

: ,
,
(n),
.

.
:

11
.
- , b_search_content_stem

476

SEARCH_CONTENT_ID=381.

477

b_search_content_stem,

,
.

478

PHP
: PHP ( >
> PHP)
PHP.

PHP
PHP (phpinfo).

>

479

( >

PHP
: PHP ( >
> PHP (N))
PHP, N - .

480

: ,
PHP.

(
>

>
).


. ,
: ,
, .
, ,
, .
.
"" .
,
.
, SQL
. , ,
.

481

- ,
( 10 ).
.. ( = 19,54) ,
(, ),
1/19,54 0,0512 . ,
19 (, ) .

, , . ,
( ).
.

- ,
.

482

php.
php ,
,
. Zend
Server CE - . ,
, ( )
APC, EAccelerator, XCache.

open_basedir.
shared ,
, : open_basedir,
.
.
apache
. VPS
open_basedir !
-.

nginx.
,
: (, , )
nginx apache.
apache: !

.
InnoDB,
.
mysqltuner.pl,
MySQL.

.
RAID : Linux
open source ,
.
.

PHP CGI.
PHP, CGI ( FastCGI) .
php-
PHP. ,
.

483


,
, PHP, PHP,
.

- , .

- , .

(CPU). .
,
. VPS, , ""
.

. ,
PHP : , ,
.
PHP .
, PHP ( ).

. hosting_test@bitrix.ru.
: "This is test message. Delete it."
! cron,
.

. ,
. ,
PHP ,
.

(//).
. : ,
. ,
,
. .


,
,
.

484


,
.

, , , .
:
.
, 20
.

485

/catalog/furniture/index.php:

/catalog/furniture/index.php
, URL
.
,

/catalog/furniture/office 2 ,
0,5 . , ,
- SQL-.
, .
.
17 /catalog/furniture/office.

486

, , SQL-
. 17 ,
.
SQL- (
). , , ( 3)
, ?
:
>> . .
,
:

487

, ( >
), , . ,
, .
, ,
:

:
.

488


10.0
-

:
. , .

489

.
, ,
.
, .
.

/bitrix/php_interface/init.php.

,
. /bitrix/php_interface/init.php
.

.
, .
,
, (, 10 , .. 0,1 .
).

- , ,
, .
:
.


.
, :
.

.


.
,
.
-
. wget,
Linux/Unix BitrixVM.
, ,
.
,
.
,
:

490

cd /tmp
mkdir test1
cd test1
rm -rf localhost
wget -m http://localhost
rm -rf localhost
wget -m http://localhost
rm -rf localhost
wget -m http://localhost
2 . ,
, CTRL+C.
!
.
( > > ).
1- wget:

491


php.
, php ,
.
, open_basedir.

, , , :
. ,
404 .
.
:
. MySQL . 5-
,
.

492


1-:
- Windows Linux ,
-.

, 1-:

MySQL 5

Apache 2.2

PHP 5.3

Catdoc

xpdf

msmtp

1 .

1C-: ,
- -
Linux.

1C-:
VMware (Player, ESX(i)
Server, Workstation) Microsoft Hyper-V.
.

493

7.

,
, "1-: ".


1-: ,
.
,
.
- ,
. :

,
(cron);

Unix
unix (Linux, Freebsd ..)
cron. unix tar bzip
, MySQL - mysqldump.

( )
( Bitrix Framework).
, :
mysqldump -hhost -uuser -ppass dbname > dump.sql
:
tar -czf archive.tar.gz
, :
#!/bin/sh
###### Config ######
doc_root=/home/denis/www/test
host=localhost

494

username=username
password=secret
database=sitemanager_demo_start
charset=cp1251
###################
cd $doc_root &&
mysqldump -h$host -u$username -p$password --default-characterset=$charset $database > $doc_root/bitrix/backup/archive.sql &&
tar -czf $doc_root/bitrix/backup/archive.tar.gz . &&
echo OK
, :

( DOCUMENT_ROOT phpinfo),

. UTF-8 utf8,
.

, , .
, ,
, bitrix/backup .
&& (,
).
, , , ,
, , , .
.

--exclude bitrix/backup,
, , .
, Bitrix Framework, ,
bitrix/php_interface/dbconn.php.
.
#!/bin/sh

495

doc_root=$1
name=$2
if [ -z $doc_root ]; then
echo Usage: $0 /path/to/document/root [backup_name]
exit
fi

if [ -z $name ]; then
name=backup
fi

dbconn=$doc_root/bitrix/php_interface/dbconn.php

readcfg() {
grep $1 $dbconn | sed 's/.*"\(.*\)".*/\1/'
}

host=`readcfg DBHost`
username=`readcfg DBLogin`
password=`readcfg DBPassword`
database=`readcfg DBName`

utf=`grep 'BX_UTF' $dbconn | grep true`

if [ -z "$utf" ]; then
charset=cp1251
else
charset=utf8
fi

496

backup_dir=$doc_root/bitrix/backup

if [ ! -e $backup_dir ]; then
mkdir $backup_dir
fi

cd $doc_root &&
mysqldump -h$host -u$username -p$password --default-characterset=$charset $database > $backup_dir/$name.sql &&
tar -cf $backup_dir/$name.tar $backup_dir/$name.sql &&
rm $backup_dir/$name.sql &&
tar -rf $backup_dir/$name.tar --exclude '*bitrix/tmp/*' --exclude
'*bitrix/updates/*' --exclude '*bitrix/backup/*' --exclude
'*bitrix/*cache/*' . &&
gzip -f -9 $backup_dir/$name.tar &&
echo OK && exit
echo Error
dbconn.php, ,
. , . .
bitrix/backup.
:
( , backup).
, Error.

, - .
, . ,
:

echo OK && exit

497

find $backup_dir -ctime +7 -exec rm {} \; && echo OK && exit



.
- . -
. .
.
mysqldump -h$host -u$username -p$password --default-characterset=$charset $database > $backup_dir/$name.sql

mysql -h$host -u$username -p$password --default-character-set=$charset


$database < $backup_dir/$name.sql
.
!
.
?
,
, backup.sh, :
chmod +x backup.sh
:
./backup.sh
OK, bitrix/backup backup.tar.gz.
,
: http://portal.ru/bitrix/backup/backup.tar.gz/ :
/home/denis/bin/backup.sh /var/www/test f43tg245g2_backup
cron.
, :
crontab -e

0 1 * * * /home/denis/bin/backup.sh /var/www/test
f43tg245g2_backup

498

, ,
:
0 1 * * * /home/denis/bin/backup.sh /var/www/test
f43tg245g2_backup_`date +\%Y\%m\%d`
cron (
),
.

Windows
, shell .
, PHP.
mysqldump, ,
( ).
tar.gz Bitrix Framework ( ,
). : -
, - .
, : -,
E:\WEB. :
e:\web\apache\php e:\web\www\test\backup.php e:\web\www\test
:
<?
$_SERVER['DOCUMENT_ROOT'] = $argv[1];

if (!$_SERVER['DOCUMENT_ROOT'])
die('Usage: '.basename(__FILE__).' /path/to/document/root'."\n");

$_SERVER['DOCUMENT_ROOT'] =
str_replace('\\','/',$_SERVER['DOCUMENT_ROOT']);

$name = $argv[2] ? $argv[2] : 'backup';

require($_SERVER['DOCUMENT_ROOT'].'/bitrix/php_interface/dbconn.php');

499

ini_set('max_execution_time',0);
$charset = defined('BX_UTF') && BX_UTF ? 'utf8' : 'cp1251';
$backup_dir = $_SERVER['DOCUMENT_ROOT'].'/bitrix/backup';
if (!file_exists($backup_dir))
mkdir($backup_dir);

shell_exec("mysqldump -h$DBHost -u$DBLogin -p$DBPassword --defaultcharacter-set=$charset $DBName > $backup_dir/$name.sql");

require($_SERVER['DOCUMENT_ROOT'].'/bitrix/modules/main/classes/genera
l/tar_gz.php');
function getmicrotime()
{
list($usec, $sec) = explode(" ", microtime());
return ((float)$usec + (float)$sec);
}

function Store($path)
{
global $arch;
$path = str_replace('\\','/',$path);
if
(preg_match('#^'.$_SERVER['DOCUMENT_ROOT'].'/bitrix/backup#',$path) ||
preg_match('#^'.$_SERVER['DOCUMENT_ROOT'].'/bitrix/[^/]*cache/#',$path
))
return;

$arch->AddFile($path,'',$_SERVER['DOCUMENT_ROOT']);
if (is_dir($path))
{

500

$dir = opendir($path);
while(false !== $file=readdir($dir))
{
if ($file=='.' || $file=='..')
continue;
Store($path.'/'.$file);
}
closedir($dir);
}
}

$arch = new CArchiver($backup_dir.'/'.$name.'.tar.gz', true);


$arch->_openWrite();
$arch->AddFile("$backup_dir/$name.sql",'',$_SERVER['DOCUMENT_ROOT']);
Store($_SERVER['DOCUMENT_ROOT']);
$arch->_close();
unlink("$backup_dir/$name.sql");
?>
, unix ,
php .

501

IIS 6
PHP ISAPI-
Microsoft Windows IIS 6.0.
1-: PHP 4.1.2
.
PHP 5 IIS
7.

PHP
, PHP .
PHP :
PHP 4.1.2 , .
http://www.php.net/downloads.php.
. , :\php\.
: :\,
, Windows.
php.ini-recommended php.ini.
php.ini x:\Windows.
php.ini .
:
extension_dir =
:
extension_dir = x:\php\extensions
:
doc_root =
:
doc_root = "x:\Inetpub\wwwroot"
:
cgi.force_redirect = 1

502

:
cgi.force_redirect = 0
.
php4ts.dll, x:\php\,
x:\Windows\System32.
Start > Settings > Control Panel > Administrative Tools > Internet
Information Services (IIS) Manager.
Web Sites (
Default Web Site).
,
Properties.
Home Directory.
Application settings Execute Permissions
Scripts and Executables.
, (Application settings) Configuration.
Mappings.
Mapping
,
.
Add, ISAPI DLL php.
:
o

Executable: Browse
php4isapi.dll :
x:\php\sapi\php4isapi.dll;

Extension: .php;

Verify that file exists.


Script Engine.

OK .
Web Service Extensions IIS.
Add a New Web service
extension.
Required file Add ,
(.php) ISAPI- php4isapi.dll.
x:\php\sapi\php4isapi.dll.

503

Set extension status Allowed.


OK.
index.php
:
Web Sites.
Properties.
Documents.
Add.
Add content Page.
index.php.
OK.
index.php .
Move Up, .
, OK.
, IIS,
.

PHP
test.php.

<? phpinfo(); ?>
.

PHP.

http://localhost/test.php,

PHP.

504

,
:
MySQL MyISAM.
:
MySQL

( >
).
.

MyISAM

>

:
( > >
).
/ .
,
.
:


MySQL MyISAM;

505

?no_keep_statistic_LICENSE-KEY=Y.
.


.
: (login)
(password) .
:
http://www.mysite.ru/bitrix/admin/repair_db.php?login=DB_Login&
password=DB_Password.

/bitrix/php_interface/dbconn.php. ,
, .
, ,
$DBDebug = true;.
, , ,
.
, .

:
:
DB query error. Please try later.
:

/bitrix/php_interface/dbconn.php

$DBDebug=true;
1-: http://dev.1c-bitrix.ru/support/.

:
:
MySQL Query Error: LOCK TABLE b_agent WRITE[Access denied for user: '
user @%' to database 'dab_test']
:
4- MySQL LOCK .
LOCK TABLES
.

506