Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Unexpected redirect with PHP plugin #205

Closed
ivankravets opened this Issue · 2 comments

2 participants

Ivan Kravets unbit
Ivan Kravets

All steps made by http://uwsgi-docs.readthedocs.org/en/latest/PHP.html

PHP: last 5.4.13 version compiled with --enable-embed flag
uWSGI: 1.9 (32Bit) installed from PIP
uWSGI Plugin: Built accordingly to Docs
UWSGICONFIG_PHPDIR=/usr/local/php54 python uwsgiconfig.py --plugin plugins/php default php54, then php54_plugin.so moved to /usr/local/php54/bin (temporary)
nGinx: last 1.2.7 with the next configuration:

location ~ .php$ {
        root /my_www_document_root;
        include uwsgi_params;
        uwsgi_modifier1 14;
        uwsgi_pass 127.0.0.1:3030;
}

In /my_www_document_root created PHP file index.php:

<?php
    phpinfo();
?>

uWSGI runned with command uwsgi -s :3030 --plugin php54 -M -p 4:

# uwsgi -s :3030 --plugin php54 -M -p 4
*** Starting uWSGI 1.9 (32bit) on [Fri Mar 29 16:15:59 2013] ***
compiled with version: 4.1.2 20080704 (Red Hat 4.1.2-54) on 29 March 2013 14:15:52
os: Linux-2.6.18-348.3.1.el5 #1 SMP Mon Mar 11 19:40:14 EDT 2013
nodename: _my_domain_
machine: i686
clock source: unix
pcre jit disabled
detected number of CPU cores: 4
current working directory: /usr/local/php54/bin
detected binary path: /usr/local/python2.7/bin/uwsgi
uWSGI running as root, you can use --uid/--gid/--chroot options
*** WARNING: you are running uWSGI as root !!! (use the --uid flag) ***
your processes number limit is 32376
your memory page size is 4096 bytes
detected max file descriptor number: 1024
lock engine: pthread robust mutexes
uwsgi socket 0 bound to TCP address :3030 fd 3
Python version: 2.7.3 (default, Mar 10 2013, 22:59:49)  [GCC 4.1.2 20080704 (Red Hat 4.1.2-54)]
*** Python threads support is disabled. You can enable it with --enable-threads ***
Python main interpreter initialized at 0x8ed0c48
PHP 5.4.13 initialized
your server socket listen backlog is limited to 100 connections
your mercy for graceful operations on workers is 60 seconds
mapped 319580 bytes (312 KB) for 4 cores
*** Operational MODE: preforking ***
*** no app loaded. going in full dynamic mode ***
spawned uWSGI master process (pid: 21371)
spawned uWSGI worker 1 (pid: 21373, cores: 1)
spawned uWSGI worker 2 (pid: 21374, cores: 1)
spawned uWSGI worker 3 (pid: 21375, cores: 1)
spawned uWSGI worker 4 (pid: 21376, cores: 1)

In this step all OK, we can see success message PHP 5.4.13 initialized, but after GET /index.php HTTP/1.1 next:

[pid: 21375|app: -1|req: -1/1] _my_ip () {30 vars in 439 bytes} [Fri Mar 29 16:19:10 2013] GET /index.php => generated 0 bytes in 0 msecs (HTTP/1.1 301) 2 headers in 76 bytes (0 switches on core 0)

and response:

HTTP/1.1 301 Moved Permanently
Server: nginx
Date: Fri, 29 Mar 2013 14:19:10 GMT
Connection: close
Location: /index.php/
Transfer-Encoding: Identity

Why?

P.S: Also I try to start uWSGI with --chdir _my_www_dir and --php-docroot ... but this can't help me.

unbit
Owner

use at least 1.9.3 with php, a bug with headers management could cause what you are experiencing

Ivan Kravets

Sorry for this report, with 1.9.3 it's working correctly:

[pid: 22154|app: -1|req: -1/4] *** () {30 vars in 439 bytes} [Fri Mar 29 17:20:38 2013] GET /index.php => generated 45692 bytes in 1 msecs (HTTP/1.1 200) 2 headers in 70 bytes (0 switches on core 0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.