-

 -

  •     - - . : Internet Explorer 6, Fire Fox 1.5, Opera 9.5, Safari 3.1.1 JavaScript.

 -

   Net-man

 - e-mail

 

 -

 LiveInternet.ru:
: 20.04.2010
: 814
: 5985
: 11575

:


PHP: PHP - PHP CGI

, 08 2011 . 17:28 +

PHP CGI- , - PHP - ( Apache) , , chroot setuid . PHP cgi-bin -. CERT (, ) CA-96.11 - cgi-bin. PHP , , :

  • : http://my.host/cgi-bin/php?/etc/passwd

    , (URL) , CGI . , .

    PHP CGI- .

  • : http://my.host/cgi-bin/php/secret/doc.html

    , PHP, /secret/doc.html, , CGI- , - (, Action Apache) , , http://my.host/secret/script.php PHP. - /secret, http://my.host/cgi-bin/php/secret/script.php. , , /secret/script.php , /cgi-bin/php. , /cgi-bin/php, , , .

    PHP, --enable-force-cgi-redirect, doc_root user_dir , . , .

1:

, , IP-, . - PHP- , --enable-force-cgi-redirect PHP. , , http://my.host/cgi-bin/php/dir/script.php http://my.host/dir/script.php, .

- Apache AddHandler Action ( ).

2: --enable-force-cgi-redirect

, PHP, http://my.host/cgi-bin/php/secretdir/script.php. , PHP , -.

- Apache :

Action php-script /cgi-bin/php
AddHandler php-script .php

- Apache, REDIRECT_STATUS, CGI-. , - , , CGI-.

3: doc_root user_dir

, , - . , , , , , HTML-, (, ), , . , , CGI-.

, , , , doc_root, -.

PHP-, doc_root , PHP_DOCUMENT_ROOT. , PHP CGI, doc_root . , , ( user_dir, ).

- user_dir. , user_dir , doc_root. http://my.host/~user/doc.php , , doc_root ~user/doc.php (, ~).

public_php , , http://my.host/~user/doc.php, doc.php, , public_php. , /home/user, /home/user/public_php/doc.php.

user_dir doc_root, - .

4: PHP -

- PHP -, /usr/local/bin. , :

#!/usr/local/bin/php

. , , CGI-, Perl, sh , #! .

PATH_INFO PATH_TRANSLATED, PHP --enable-discard-path.

PHP.SU

PHP
:  

1

: [1] []
 

:
: 

: ( )

:

  URL