I have no idea what the correct behaviour here is, but at least Slim
the PHP framework fails when used with --php-app, and it complains
about the empty SCRIPT_NAME
SCRIPT_NAME seems to be empty in uwsgi in both cases on the uwsgi
level, but when in php in the first case (php-app) it's again empty,
in the second (php-index) it's magically filled.
interesting that in the first case, even though uwsgi knows about
PATH_INFO, php doesn't return any $_SERVER['PATH_INFO']

This is latest uwsgi from git: 056417303c

=== index.php ===

<?php
     echo 'SCRIPT_NAME => ' . $_SERVER['SCRIPT_NAME'] . "\n";
     echo 'PATH_INFO => ' . $_SERVER['PATH_INFO'] . "\n";
     echo 'REQUEST_URI => ' . $_SERVER['REQUEST_URI'] . "\n";


== php-app ===

~/src/uwsgi/uwsgi -M --http-socket :8080 --http-socket-modifier1 14
--php-app index.php

add uwsgi var: REQUEST_METHOD = GET
add uwsgi var: REQUEST_URI = /asdsa
add uwsgi var: PATH_INFO = /asdsa
add uwsgi var: QUERY_STRING =
add uwsgi var: SERVER_PROTOCOL = HTTP/1.1
add uwsgi var: SCRIPT_NAME =
add uwsgi var: SERVER_NAME = archaeopteryx
add uwsgi var: SERVER_PORT = 8080
add uwsgi var: REMOTE_ADDR = 127.0.0.1
[uWSGI DEBUG] PATH_INFO=/asdsa
[uWSGI DEBUG] SCRIPT_NAME=
[uWSGI DEBUG] SERVER_NAME=archaeopteryx
[uWSGI DEBUG] HTTP_HOST=localhost:8080
php filename = index.php script_name =  (0) document_root =
/home/damjan/my-work/phar-test (30)
[pid: 29650|app: -1|req: -1/1] 127.0.0.1 () {24 vars in 265 bytes}
[Sat Jun 27 01:03:48 2015] GET /asdsa => generated 52 bytes in 0 msecs
(HTTP/1.1 200) 2 headers in 85 bytes (0 switches on core 0)

$ curl localhost:8080/asdsa
SCRIPT_NAME =>
PATH_INFO =>
REQUEST_URI => /asdsa


=== php-index ===

$ ~/src/uwsgi/uwsgi -M --http-socket :8080 --http-socket-modifier1 14
--php-index index.php

add uwsgi var: REQUEST_METHOD = GET
add uwsgi var: REQUEST_URI = /index.php/asdsa
add uwsgi var: PATH_INFO = /index.php/asdsa
add uwsgi var: QUERY_STRING =
add uwsgi var: SERVER_PROTOCOL = HTTP/1.1
add uwsgi var: SCRIPT_NAME =
add uwsgi var: SERVER_NAME = archaeopteryx
add uwsgi var: SERVER_PORT = 8080
add uwsgi var: REMOTE_ADDR = 127.0.0.1
[uWSGI DEBUG] PATH_INFO=/index.php/asdsa
[uWSGI DEBUG] SCRIPT_NAME=
[uWSGI DEBUG] SERVER_NAME=archaeopteryx
[uWSGI DEBUG] HTTP_HOST=localhost:8080
php filename = /home/damjan/my-work/phar-test/index.php script_name =
/index.php (10) document_root = /home/damjan/my-work/phar-test (30)
[pid: 29726|app: -1|req: -1/4] 127.0.0.1 () {24 vars in 285 bytes}
[Sat Jun 27 01:06:13 2015] GET /index.php/asdsa => generated 78 bytes
in 0 msecs (HTTP/1.1 200) 2 headers in 85 bytes (0 switches on core 0)

$ curl localhost:8080/index.php/asdsa
SCRIPT_NAME => /index.php
PATH_INFO => /asdsa
REQUEST_URI => /index.php/asdsa









-- 
damjan
_______________________________________________
uWSGI mailing list
[email protected]
http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi

Reply via email to