Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>When you run PHP-FPM with NGINX, php will see the $_SERVER variables in a totally different way (this is because of the default passing of server parameters to fcgi scripts in nginx).</p> <p>Here's how $_SERVER variables will be seen by php when ran as php-fpm: Code: Array ( [USER] => nobody [HOME] => / [FCGI_ROLE] => RESPONDER [SCRIPT_FILENAME] => /usr/local/www/www.example.com/public_html/example/index.php [Content-Type] => multipart/form-data [QUERY_STRING] => upload=true [REQUEST_METHOD] => POST [CONTENT_LENGTH] => 40403 [SCRIPT_NAME] => /example/index.php [REQUEST_URI] => /site/index.php?upload=true [DOCUMENT_URI] => /example/index.php [DOCUMENT_ROOT] => /usr/local/www/www.example.com/public_html [SERVER_PROTOCOL] => HTTP/1.1 [GATEWAY_INTERFACE] => CGI/1.1 [SERVER_SOFTWARE] => nginx/0.7.65 [REMOTE_ADDR] => 193.110.48.4 [REMOTE_PORT] => 9971 [SERVER_ADDR] => 192.168.1.10 [SERVER_PORT] => 80 [SERVER_NAME] => www.example.com [REDIRECT_STATUS] => 200 [HTTP_HOST] => www.example.com [HTTP_ORIGIN] => <a href="http://www.example.com" rel="nofollow">http://www.example.com</a> [HTTP_X_FILE_SIZE] => 40403 [HTTP_X_REQUESTED_WITH] => XMLHttpRequest [HTTP_CACHE_CONTROL] => max-age=0 [HTTP_IF_MODIFIED_SINCE] => Mon, 26 Jul 1997 05:00:00 GMT [HTTP_CONTENT_LENGTH] => 40403 [HTTP_X_FILE_NAME] => nokia-6300-yahoo.jpg [HTTP_USER_AGENT] => Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_8; en-us) AppleWebKit/533.17.8 (KHTML, like Gecko) Version/5.0.1 Safari/533.17.8 [HTTP_CONTENT_TYPE] => multipart/form-data [HTTP_REFERER] => <a href="http://www.example.com/example/index.php" rel="nofollow">http://www.example.com/example/index.php</a> [HTTP_ACCEPT] => <em>/</em> [HTTP_ACCEPT_LANGUAGE] => en-us [HTTP_ACCEPT_ENCODING] => gzip, deflate [HTTP_CONNECTION] => keep-alive [PHP_SELF] => /example/index.php [REQUEST_TIME] => 1282822862 )</p> <p>Note the HTTP_CONTENT_TYPE, HTTP_X_FILE_SIZE, HTTP_X_FILE_NAME and <strong>other HTTP_* variables.</strong></p> <p>here is a simple php function that will regulate these header values into apache like ones.</p> <pre><code> function getallheaders() { $replace_array = array('CONTENT_TYPE' =&gt; 'Content-Type', 'CONTENT_LENGTH' =&gt; 'Content-Length', 'X_FILE_SIZE' =&gt; 'X-File-Size', 'X_FILE_NAME' =&gt; 'X-File-Name'); foreach($_SERVER as $h=&gt;$v) { $h = str_replace("HTTP_", "", $h); $h = $replace_array[$h]; $headers[$h] = $v; } return $headers; </code></pre> <p>}</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload