Closed yechoi42 closed 3 years ago
Your program should set the following Meta-Variables
https://www.whoishostingthis.com/compare/cgi-access/variables/
php-mac/lib/php/build/run-tests.php
/*
** cgi
*/
map["AUTH_TYPE"] = ""; //auth 인증 type ex=> cookie
map["CONTENT_LENGTH"] = "";
map["CONTENT_TYPE"] = "text/html";
map["GATEWAY_INTERFACE"] = "CGI/1.1";
map["PATH_INFO"] = "/directory/youpi.php"; // 기본 cgi 필수요소
map["PATH_TRANSLATED"] = "/Users/holee/Desktop/test/Webserv/YoupiBanane/youpi.php"; // 기본 cgi 필수요소
map["QUERY_STRING"] = "";
map["REMOTE_ADDR"] = "127.0.0.1";
map["REMOTE_IDENT"] = "";
map["REMOTE_USER"] = "";
map["REQUEST_METHOD"] = "POST"; // 기본 cgi 필수요소
map["REQUEST_URI"] = "/directory/youpi.php";
map["SCRIPT_NAME"] = "/Users/holee/Desktop/test/Webserv/YoupiBanane/youpi.php";
map["SERVER_NAME"] = "first_server";
map["SERVER_PORT"] = "8080";
map["SERVER_PROTOCOL"] = "HTTP/1.1"; // 기본 cgi 필수요소
map["SERVER_SOFTWARE"] = this->m_server_name;
/* cgi */
map["HTTP_X_SECRET_HEADER_FOR_TEST"] = '1'; // 기본 cgi 필수요소
/* php */
map["REDIRECT_STATUS"] = "200";
map["SCRIPT_FILENAME"] = "/Users/holee/Desktop/test/Webserv/YoupiBanane/youpi.php";
<?php
print "Status: 200 OK\r\n";
print "Content-Type: text/html; charset=utf-8\r\n\r\n";
phpinfo(INFO_VARIABLES);
?>
youpi.php