# A new uWSGI PHP plugin is available

**URL:** <https://www.ruby-forum.com/t/a-new-uwsgi-php-plugin-is-available/217222>\
**Category:** NGINX\
**Created:** [February 24, 2012, 10:23am UTC](https://www.ruby-forum.com/t/a-new-uwsgi-php-plugin-is-available/217222 "2012-02-24T10:23:59Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![luislavena](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/0ea827/32.png) [@luislavena](https://www.ruby-forum.com/u/luislavena)\
**Post date:** [February 24, 2012, 10:23am UTC](https://www.ruby-forum.com/t/a-new-uwsgi-php-plugin-is-available/217222/1 "2012-02-24T10:23:59Z")

</div>

Hi everyone,

uWSGI has got a new php plugin, allowing you to run php apps at full  
speed  
(read: not in CGI mode) and getting all of the uWSGI features (like  
adaptive process spawning and jailing technics).

In addition to this a bunch of uwsgi api functions has been added,  
allowing your php apps to interact with other apps hosted in uWSGI.

[http://projects.unbit.it/uwsgi/wiki/PHP](http://projects.unbit.it/uwsgi/wiki/PHP)

The build system on redhat-based distros (fedora, centos…) is very  
easy,  
but for debian/ubuntu you need to rebuild php or use some ppa as debian  
(still) does not include the libphp.

In my company, we are using this plugin proxied behind nginx from about  
2  
weeks without problems. Every report will be wellcomed.

Please, do not ask me to compare it with php-fpm as i have never used it  
at a level allowing me to make a fair analysis ☹

–  
Roberto De Ioris  
[http://unbit.it](http://unbit.it)

---

<div class="post-metadata">

**Author:** ![Roberto\_De\_Ioris](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/50afbb/32.png) [@Roberto\_De\_Ioris](https://www.ruby-forum.com/u/Roberto_De_Ioris)\
**Post date:** [February 24, 2012, 11:45am UTC](https://www.ruby-forum.com/t/a-new-uwsgi-php-plugin-is-available/217222/2 "2012-02-24T11:45:18Z")

</div>

On 2012-02-24 16:23, Roberto De Ioris wrote:

> In my company, we are using this plugin proxied behind nginx from about 2  
> weeks without problems. Every report will be wellcomed.

Segfaulted on my server.

!!! uWSGI process 31078 got Segmentation Fault !!!  
\*\*\* backtrace of 31078 \*\*\*  
./uwsgi(uwsgi\_backtrace+0x2a) [0x80779ea]  
./uwsgi(uwsgi\_segfault+0x2c) [0x8077adc]  
[0x865420]  
./uwsgi(wsgi\_req\_recv+0x7b) [0x805640b]  
./uwsgi(simple\_loop+0x136) [0x8070dc6]  
./uwsgi(uwsgi\_ignition+0x196) [0x8074c16]  
./uwsgi(uwsgi\_start+0x2526) [0x80771a6]  
./uwsgi(main+0x1584) [0x807a654]  
/lib/libc.so.6(\_\_libc\_start\_main+0xdc) [0xabceac]  
./uwsgi [0x8054a91]  
\*\*\* end of backtrace \*\*\*  
DAMN ! worker 3 (pid: 31078) died ☹ trying respawn …  
Respawned uWSGI worker 3 (new pid: 31083)

Running:

- CentOS 5.7
- PHP 5.3 from IUSCommunity repository ([http://iuscommunity.org](http://iuscommunity.org))
- nginx 1.1.15 (self-compiled)
- Python 2.4

---

<div class="post-metadata">

**Author:** ![Roberto\_De\_Ioris](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/50afbb/32.png) [@Roberto\_De\_Ioris](https://www.ruby-forum.com/u/Roberto_De_Ioris)\
**Post date:** [February 24, 2012, 12:01pm UTC](https://www.ruby-forum.com/t/a-new-uwsgi-php-plugin-is-available/217222/3 "2012-02-24T12:01:02Z")

</div>

On 2012-02-24 17:46, Roberto De Ioris wrote:

> Be sure to fully rebuild (do a make clean) uWSGI if you have added  
> devel packages during php\_plugin compilation as they can modify CFLAGS  
> setup

Thank you, it’s working fine now. The DOCUMENT\_ROOT (or something else)  
doesn’t seem to be passed properly though? I get “Not Found” (uwsgi’s?)  
unless I start uwsgi with --php-docroot parameter. I’m following “Run  
php apps with nginx as frontend” chapter of the wiki.

---

<div class="post-metadata">

**Author:** ![Roberto\_De\_Ioris](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/50afbb/32.png) [@Roberto\_De\_Ioris](https://www.ruby-forum.com/u/Roberto_De_Ioris)\
**Post date:** [February 24, 2012, 11:47am UTC](https://www.ruby-forum.com/t/a-new-uwsgi-php-plugin-is-available/217222/4 "2012-02-24T11:47:12Z")

</div>

> ./uwsgi(uwsgi\_backtrace+0x2a) [0x80779ea]  
> DAMN ! worker 3 (pid: 31078) died ☹ trying respawn …  
> Respawned uWSGI worker 3 (new pid: 31083)
> 
> Running:
> 
> - CentOS 5.7
> - PHP 5.3 from IUSCommunity repository ([http://iuscommunity.org](http://iuscommunity.org))
> - nginx 1.1.15 (self-compiled)
> - Python 2.4

Be sure to fully rebuild (do a make clean) uWSGI if you have added devel  
packages during php\_plugin compilation as they can modify CFLAGS setup

–  
Roberto De Ioris

> **[unbit - Overview](https://github.com/unbit)**
>
> makers of uWSGI and many more open source projects - unbit

---

<div class="post-metadata">

**Author:** ![Roberto\_De\_Ioris](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/50afbb/32.png) [@Roberto\_De\_Ioris](https://www.ruby-forum.com/u/Roberto_De_Ioris)\
**Post date:** [February 24, 2012, 12:37pm UTC](https://www.ruby-forum.com/t/a-new-uwsgi-php-plugin-is-available/217222/5 "2012-02-24T12:37:51Z")

</div>

I tried building this on my Ubuntu 11.10 server with nginx-1.0.12

./configure   
–prefix=/opt/nginx   
–conf-path=/etc/nginx/nginx.conf   
–pid-path=/var/run/nginx.pid   
–lock-path=/var/lock/nginx.lock   
–http-log-path=/var/log/nginx/access.log   
–error-log-path=/var/log/nginx/error.log   
–http-client-body-temp-path=/var/lib/nginx/body   
–http-proxy-temp-path=/var/lib/nginx/proxy   
–http-fastcgi-temp-path=/var/lib/nginx/fastcgi   
–http-uwsgi-temp-path=/var/lib/nginx/uwsgi   
–http-scgi-temp-path=/var/lib/nginx/scgi   
–with-http\_stub\_status\_module   
–with-http\_ssl\_module   
–with-http\_gzip\_static\_module   
–add-module=/root/sources/uwsgi-1.1-snapshot5/nginx/   
–user=www-data   
–group=www-data   
–without-mail\_pop3\_module   
–without-mail\_imap\_module   
–without-mail\_smtp\_module

but I keep getting this error:

objs/addon/nginx/ngx\_http\_uwsgi\_module.o:(.data+0x0): multiple  
definition of `ngx_http_uwsgi_module' objs/src/http/modules/ngx_http_uwsgi_module.o:(.data+0x0): first defined here collect2: ld returned 1 exit status make[1]: *** [objs/nginx] Error 1 make[1]: Leaving directory `/root/sources/nginx-1.0.12’  
make: \*\*\* [build] Error 2

Posted at Nginx Forum:

> **[Re: a new uWSGI PHP plugin is available](https://forum.nginx.org/read.php?2,222924,222930#msg-222930)**
>
> Hi everyone, uWSGI has got a new php plugin, allowing you to run php apps at full speed (read: not in CGI mode) and getting all of the uWSGI features (like adaptive process spawning and jailing technics). In addition to this a bunch of uwsgi api...

---

<div class="post-metadata">

**Author:** ![Roberto\_De\_Ioris](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/50afbb/32.png) [@Roberto\_De\_Ioris](https://www.ruby-forum.com/u/Roberto_De_Ioris)\
**Post date:** [February 24, 2012, 12:15pm UTC](https://www.ruby-forum.com/t/a-new-uwsgi-php-plugin-is-available/217222/6 "2012-02-24T12:15:59Z")

</div>

> 

you are right, there is a missing variable assignment for docroot, i  
have  
released a new snapshot (snapshot5) or you can use the latest tip.

Obviously i suggest you to always list allowed docroots in uWSGI for  
increasing security.

–  
Roberto De Ioris

> **[unbit - Overview](https://github.com/unbit)**
>
> makers of uWSGI and many more open source projects - unbit

---

<div class="post-metadata">

**Author:** ![Roberto\_De\_Ioris](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/50afbb/32.png) [@Roberto\_De\_Ioris](https://www.ruby-forum.com/u/Roberto_De_Ioris)\
**Post date:** [February 24, 2012, 12:42pm UTC](https://www.ruby-forum.com/t/a-new-uwsgi-php-plugin-is-available/217222/7 "2012-02-24T12:42:53Z")

</div>

Thanks for the promp reply, I wasn’t aware it’s already been included.

Look forward to testing it out.

Posted at Nginx Forum:

> **[Re: a new uWSGI PHP plugin is available](https://forum.nginx.org/read.php?2,222924,222932#msg-222932)**
>
> Hi everyone, uWSGI has got a new php plugin, allowing you to run php apps at full speed (read: not in CGI mode) and getting all of the uWSGI features (like adaptive process spawning and jailing technics). In addition to this a bunch of uwsgi api...

---

<div class="post-metadata">

**Author:** ![Roberto\_De\_Ioris](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/50afbb/32.png) [@Roberto\_De\_Ioris](https://www.ruby-forum.com/u/Roberto_De_Ioris)\
**Post date:** [February 24, 2012, 2:34pm UTC](https://www.ruby-forum.com/t/a-new-uwsgi-php-plugin-is-available/217222/8 "2012-02-24T14:34:03Z")

</div>

I’m a bit stuck with ‘running the php script in the uWSGI server’

My PHP is built from source, as far as I understand I need to build it  
with --enable-embed

./configure --prefix=/opt/php5 --with-config-file-path=/opt/php5/etc  
–with-config-file-scan-dir=/opt/php5/etc/conf.d --with-curl  
–with-mhash --enable-cgi --with-pear --with-gd --with-jpeg-dir  
–with-png-dir --with-zlib --with-xpm-dir --with-freetype-dir  
–with-t1lib --with-mcrypt --with-mhash --with-mysql=mysqlnd  
–with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-openssl  
–with-xmlrpc --with-xsl --with-bz2 --with-gettext  
–with-fpm-user=www-data --with-fpm-group=www-data --disable-debug  
–enable-fpm --enable-exif --enable-wddx --enable-zip --enable-bcmath  
–enable-calendar --enable-ftp --enable-embed --enable-mbstring  
–enable-soap --enable-sockets --enable-shmop --enable-dba  
–enable-inline-optimization --enable-sysvsem --enable-sysvshm  
–enable-sysvmsg

How would I then proceed to build the uWSGI php plugin?

Posted at Nginx Forum:

> **[Re: a new uWSGI PHP plugin is available](https://forum.nginx.org/read.php?2,222924,222936#msg-222936)**
>
> Hi everyone, uWSGI has got a new php plugin, allowing you to run php apps at full speed (read: not in CGI mode) and getting all of the uWSGI features (like adaptive process spawning and jailing technics). In addition to this a bunch of uwsgi api...

---

<div class="post-metadata">

**Author:** ![Roberto\_De\_Ioris](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/50afbb/32.png) [@Roberto\_De\_Ioris](https://www.ruby-forum.com/u/Roberto_De_Ioris)\
**Post date:** [February 24, 2012, 12:40pm UTC](https://www.ruby-forum.com/t/a-new-uwsgi-php-plugin-is-available/217222/9 "2012-02-24T12:40:20Z")

</div>

> –http-proxy-temp-path=/var/lib/nginx/proxy   
> –without-mail\_imap\_module   
> make[1]: Leaving directory `/root/sources/nginx-1.0.12’  
> make: \*\*\* [build] Error 2

It looks like you have added the uwsgi patch to nginx, while nginx does  
not require it starting from 0.8.40 (it is included in the official  
distribution)

–  
Roberto De Ioris

> **[unbit - Overview](https://github.com/unbit)**
>
> makers of uWSGI and many more open source projects - unbit

---

<div class="post-metadata">

**Author:** ![Roberto\_De\_Ioris](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/50afbb/32.png) [@Roberto\_De\_Ioris](https://www.ruby-forum.com/u/Roberto_De_Ioris)\
**Post date:** [February 24, 2012, 2:42pm UTC](https://www.ruby-forum.com/t/a-new-uwsgi-php-plugin-is-available/217222/10 "2012-02-24T14:42:46Z")

</div>

> –with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-openssl  
> –with-xmlrpc --with-xsl --with-bz2 --with-gettext  
> –with-fpm-user=www-data --with-fpm-group=www-data --disable-debug  
> –enable-fpm --enable-exif --enable-wddx --enable-zip --enable-bcmath  
> –enable-calendar --enable-ftp --enable-embed --enable-mbstring  
> –enable-soap --enable-sockets --enable-shmop --enable-dba  
> –enable-inline-optimization --enable-sysvsem --enable-sysvshm  
> –enable-sysvmsg
> 
> How would I then proceed to build the uWSGI php plugin?

download 1.1 uWSGI sources:

[http://projects.unbit.it/downloads/uwsgi-1.1-snapshot5.tar.gz](http://projects.unbit.it/downloads/uwsgi-1.1-snapshot5.tar.gz)

uncompress and move to the resulting directory and run

make

if all goes well you will end with a binary named ‘uwsgi’

then build the php plugin with

python uwsgiconfig.py --plugin plugins/php

finally run (always from the same dir)

./uwsgi -s :3031 --plugins php

now point nginx to that port as described here:

> **[The uWSGI project — uWSGI 2.0 documentation](https://uwsgi-docs.readthedocs.io/en/latest/)**

–  
Roberto De Ioris

> **[unbit - Overview](https://github.com/unbit)**
>
> makers of uWSGI and many more open source projects - unbit

---

<div class="post-metadata">

**Author:** ![Roberto\_De\_Ioris](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/50afbb/32.png) [@Roberto\_De\_Ioris](https://www.ruby-forum.com/u/Roberto_De_Ioris)\
**Post date:** [February 24, 2012, 3:35pm UTC](https://www.ruby-forum.com/t/a-new-uwsgi-php-plugin-is-available/217222/11 "2012-02-24T15:35:40Z")

</div>

> Please, do not ask me to compare it with php-fpm as i have never used it at a  
> level allowing me to make a fair analysis ☹

Would love to see some (even simple) benchmarks from someone who has  
played around both (fpm and the uwsgi).

rr

---

<div class="post-metadata">

**Author:** ![Roberto\_De\_Ioris](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/50afbb/32.png) [@Roberto\_De\_Ioris](https://www.ruby-forum.com/u/Roberto_De_Ioris)\
**Post date:** [February 24, 2012, 3:08pm UTC](https://www.ruby-forum.com/t/a-new-uwsgi-php-plugin-is-available/217222/12 "2012-02-24T15:08:35Z")

</div>

Thanks for all the help so far Roberto.

When I run

python uwsgiconfig.py --plugin plugins/php  
using profile: buildconf/default.ini  
detected include path: [‘/usr/lib/gcc/x86\_64-linux-gnu/4.6.1/include’,  
‘/usr/local/include’,  
‘/usr/lib/gcc/x86\_64-linux-gnu/4.6.1/include-fixed’,  
‘/usr/include/x86\_64-linux-gnu’, ‘/usr/include’]  
\*\*\* uWSGI building and linking plugin plugins/php \*\*\*  
[gcc -pthread] ./php\_plugin.so  
/usr/bin/ld: cannot find -lphp5  
collect2: ld returned 1 exit status  
\*\*\* unable to build php plugin \*\*\*

Posted at Nginx Forum:

> **[Re: a new uWSGI PHP plugin is available](https://forum.nginx.org/read.php?2,222924,222939#msg-222939)**
>
> Hi everyone, uWSGI has got a new php plugin, allowing you to run php apps at full speed (read: not in CGI mode) and getting all of the uWSGI features (like adaptive process spawning and jailing technics). In addition to this a bunch of uwsgi api...

---

<div class="post-metadata">

**Author:** ![Roberto\_De\_Ioris](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/50afbb/32.png) [@Roberto\_De\_Ioris](https://www.ruby-forum.com/u/Roberto_De_Ioris)\
**Post date:** [February 24, 2012, 3:45pm UTC](https://www.ruby-forum.com/t/a-new-uwsgi-php-plugin-is-available/217222/13 "2012-02-24T15:45:44Z")

</div>

I’ve tried that, but same result:

LDFLAGS=“-Lpath” LD\_RUN\_PATH=“/opt/php5/lib/libphp5.so” python  
uwsgiconfig.py --plugin plugins/php  
using profile: buildconf/default.ini  
detected include path: [‘/usr/lib/gcc/x86\_64-linux-gnu/4.6.1/include’,  
‘/usr/local/include’,  
‘/usr/lib/gcc/x86\_64-linux-gnu/4.6.1/include-fixed’,  
‘/usr/include/x86\_64-linux-gnu’, ‘/usr/include’]  
\*\*\* uWSGI building and linking plugin plugins/php \*\*\*  
[gcc -pthread] ./php\_plugin.so  
/usr/bin/ld: cannot find -lphp5  
collect2: ld returned 1 exit status  
\*\*\* unable to build php plugin \*\*\*

Posted at Nginx Forum:

> **[Re: a new uWSGI PHP plugin is available](https://forum.nginx.org/read.php?2,222924,222943#msg-222943)**
>
> Hi everyone, uWSGI has got a new php plugin, allowing you to run php apps at full speed (read: not in CGI mode) and getting all of the uWSGI features (like adaptive process spawning and jailing technics). In addition to this a bunch of uwsgi api...

---

<div class="post-metadata">

**Author:** ![Roberto\_De\_Ioris](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/50afbb/32.png) [@Roberto\_De\_Ioris](https://www.ruby-forum.com/u/Roberto_De_Ioris)\
**Post date:** [February 24, 2012, 3:38pm UTC](https://www.ruby-forum.com/t/a-new-uwsgi-php-plugin-is-available/217222/14 "2012-02-24T15:38:46Z")

</div>

> \*\*\* uWSGI building and linking plugin plugins/php \*\*\*  
> [gcc -pthread] ./php\_plugin.so  
> /usr/bin/ld: cannot find -lphp5  
> collect2: ld returned 1 exit status  
> \*\*\* unable to build php plugin \*\*\*

Your php-config script is not exporting library dir. Use this trick:

LDFLAGS=“-Lpath” LD\_RUN\_PATH=“path” python uwsgiconfig.py --plugin  
plugins/php

where path is the directory containing libphp5.so

> 

–  
Roberto De Ioris

> **[unbit - Overview](https://github.com/unbit)**
>
> makers of uWSGI and many more open source projects - unbit

---

<div class="post-metadata">

**Author:** ![Roberto\_De\_Ioris](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/50afbb/32.png) [@Roberto\_De\_Ioris](https://www.ruby-forum.com/u/Roberto_De_Ioris)\
**Post date:** [February 24, 2012, 4:08pm UTC](https://www.ruby-forum.com/t/a-new-uwsgi-php-plugin-is-available/217222/15 "2012-02-24T16:08:16Z")

</div>

Thanks Robert - finally have it up and running.

Just did some quick testing and seeing 15% improvement in page load  
times, we’ve previously been using php-fpm.

Looks very promising so far!

Posted at Nginx Forum:

> **[Re: a new uWSGI PHP plugin is available](https://forum.nginx.org/read.php?2,222924,222946#msg-222946)**
>
> Hi everyone, uWSGI has got a new php plugin, allowing you to run php apps at full speed (read: not in CGI mode) and getting all of the uWSGI features (like adaptive process spawning and jailing technics). In addition to this a bunch of uwsgi api...

---

<div class="post-metadata">

**Author:** ![Roberto\_De\_Ioris](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/50afbb/32.png) [@Roberto\_De\_Ioris](https://www.ruby-forum.com/u/Roberto_De_Ioris)\
**Post date:** [February 24, 2012, 3:48pm UTC](https://www.ruby-forum.com/t/a-new-uwsgi-php-plugin-is-available/217222/16 "2012-02-24T15:48:51Z")

</div>

> I’ve tried that, but same result:
> 
> LDFLAGS=“-Lpath” LD\_RUN\_PATH=“/opt/php5/lib/libphp5.so” python  
> uwsgiconfig.py --plugin plugins/php

it must be

LDFLAGS=“-L/opt/php5/lib/” LD\_RUN\_PATH=“/opt/php5/lib/”

> Posted at Nginx Forum:  
> [http://forum.nginx.org/read.php?2,222924,222943#msg-222943](http://forum.nginx.org/read.php?2,222924,222943#msg-222943)
> 
> * * *
> 
> nginx mailing list  
> [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
> [mailman.nginx.org archive](http://mailman.nginx.org/mailman/listinfo/nginx)

–  
Roberto De Ioris

> **[unbit - Overview](https://github.com/unbit)**
>
> makers of uWSGI and many more open source projects - unbit

---

<div class="post-metadata">

**Author:** ![Roberto\_De\_Ioris](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/50afbb/32.png) [@Roberto\_De\_Ioris](https://www.ruby-forum.com/u/Roberto_De_Ioris)\
**Post date:** [March 18, 2012, 11:03am UTC](https://www.ruby-forum.com/t/a-new-uwsgi-php-plugin-is-available/217222/17 "2012-03-18T11:03:26Z")

</div>

Roberto De Ioris wrote in post #1048644:

> > –with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-openssl  
> > –with-xmlrpc --with-xsl --with-bz2 --with-gettext  
> > –with-fpm-user=www-data --with-fpm-group=www-data --disable-debug  
> > –enable-fpm --enable-exif --enable-wddx --enable-zip --enable-bcmath  
> > –enable-calendar --enable-ftp --enable-embed --enable-mbstring  
> > –enable-soap --enable-sockets --enable-shmop --enable-dba  
> > –enable-inline-optimization --enable-sysvsem --enable-sysvshm  
> > –enable-sysvmsg
> > 
> > How would I then proceed to build the uWSGI php plugin?
> 
> download 1.1 uWSGI sources:
> 
> [http://projects.unbit.it/downloads/uwsgi-1.1-snapshot5.tar.gz](http://projects.unbit.it/downloads/uwsgi-1.1-snapshot5.tar.gz)
> 
> uncompress and move to the resulting directory and run
> 
> make
> 
> if all goes well you will end with a binary named ‘uwsgi’
> 
> then build the php plugin with
> 
> python uwsgiconfig.py --plugin plugins/php
> 
> finally run (always from the same dir)
> 
> ./uwsgi -s :3031 --plugins php
> 
> now point nginx to that port as described here:
> 
> [The uWSGI project — uWSGI 2.0 documentation](http://projects.unbit.it/uwsgi/wiki/PHP)
> 
> –  
> Roberto De Ioris  
> [http://unbit.it](http://unbit.it)

Hi, I follow the tutorial of [The uWSGI project — uWSGI 2.0 documentation](http://projects.unbit.it/uwsgi/wiki/PHP)

the server config in nginx is:

server {  
listen 8080;  
server\_name [www.myphp.com](http://www.myphp.com) [myphp.com](http://myphp.com);  
location ~ .php {  
root /var/www/php\_test;  
uwsgi\_pass 127.0.0.1:3030;  
include uwsgi\_params;  
}  
}

Put a file name index.php in /var/www/php\_test.

Than i run uwsgi -s :3030 --plugin php -M -p 4  
the output is:

> > >

\*\*\* Starting uWSGI 1.1 (64bit) on [Sun Mar 18 17:57:32 2012] \*\*\*  
compiled with version: 4.6.1 on 17 March 2012 17:44:26  
current working directory: /home/delai/uwsgi  
detected binary path: /usr/local/bin/uwsgi  
your memory page size is 4096 bytes  
detected max file descriptor number: 1024  
lock engine: pthread mutexes  
uwsgi socket 0 bound to TCP address :3030 fd 3  
Python version: 2.7.2+ (default, Oct 4 2011, 20:41:12) [GCC 4.6.1]  
Python main interpreter initialized at 0x6945a0  
PHP 5.3.10 initialized  
your server socket listen backlog is limited to 100 connections  
\*\*\* Operational MODE: preforking \*\*\*  
\*\*\* no app loaded. going in full dynamic mode \*\*\*  
\*\*\* uWSGI is running in multiple interpreter mode \*\*\*  
spawned uWSGI master process (pid: 9385)  
spawned uWSGI worker 1 (pid: 9386, cores: 1)  
spawned uWSGI worker 2 (pid: 9387, cores: 1)  
spawned uWSGI worker 3 (pid: 9388, cores: 1)  
spawned uWSGI worker 4 (pid: 9389, cores: 1)  
\<\<\<

it looks fine.

when i visit [http://myphp.com:8080/](http://myphp.com:8080/), nginx return 404 not found  
visit [http://myphp.com:8080/index.php](http://myphp.com:8080/index.php), nginx return  
“uWSGI Error  
Python application not found”

php was recompiled and php plugin was configured.

Any one know Why?

---

<div class="post-metadata">

**Author:** ![Roberto\_De\_Ioris](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/50afbb/32.png) [@Roberto\_De\_Ioris](https://www.ruby-forum.com/u/Roberto_De_Ioris)\
**Post date:** [March 18, 2012, 4:30pm UTC](https://www.ruby-forum.com/t/a-new-uwsgi-php-plugin-is-available/217222/18 "2012-03-18T16:30:33Z")

</div>

> > > How would I then proceed to build the uWSGI php plugin?  
> > > if all goes well you will end with a binary named ‘uwsgi’
> 
> server {  
> listen 8080;  
> server\_name [www.myphp.com](http://www.myphp.com) [myphp.com](http://myphp.com);  
> location ~ .php {  
> root /var/www/php\_test;  
> uwsgi\_pass 127.0.0.1:3030;  
> include uwsgi\_params;  
> }  
> }

here you have missed

uwsgi\_modifier1 14;

that instruct uWSGI to route the request to the php plugin.

About index.php you can add an index directive in nginx or

php-index = index.php

in uwsgi config

–  
Roberto De Ioris

> **[unbit - Overview](https://github.com/unbit)**
>
> makers of uWSGI and many more open source projects - unbit

---

<div class="post-metadata">

**Author:** ![Roberto\_De\_Ioris](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/50afbb/32.png) [@Roberto\_De\_Ioris](https://www.ruby-forum.com/u/Roberto_De_Ioris)\
**Post date:** [March 20, 2012, 12:53am UTC](https://www.ruby-forum.com/t/a-new-uwsgi-php-plugin-is-available/217222/19 "2012-03-20T00:53:11Z")

</div>

> 

…and obviously disable request logging as uWSGI by default is really  
verbose.  
This is the command line of my test suite:

./uwsgi -s :3031 --plugins php --disable-logging -p 4 -M

this spawn 4 processes (as php-fpm default on debian/ubuntu).

–  
Roberto De Ioris

> **[unbit - Overview](https://github.com/unbit)**
>
> makers of uWSGI and many more open source projects - unbit

---

<div class="post-metadata">

**Author:** ![Roberto\_De\_Ioris](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/50afbb/32.png) [@Roberto\_De\_Ioris](https://www.ruby-forum.com/u/Roberto_De_Ioris)\
**Post date:** [March 20, 2012, 12:27am UTC](https://www.ruby-forum.com/t/a-new-uwsgi-php-plugin-is-available/217222/20 "2012-03-20T00:27:13Z")

</div>

> Thank you very much.
> 
> Robert

There should be not much difference in both (or php-fastcgi), the only  
thing that came to my mind is in different configuration.

Best way to test is in using both with a single process, or with the  
same  
number of processes (adaptive process spawning is completely different  
from the php-fpm one so i would not expect a fair comparison). But  
again,  
do not expect too much differences, the internal php stuff is the same.

–  
Roberto De Ioris

> **[unbit - Overview](https://github.com/unbit)**
>
> makers of uWSGI and many more open source projects - unbit

[Next page](https://www.ruby-forum.com/t/a-new-uwsgi-php-plugin-is-available/217222.md?page=2)
