Below is my guide to setup Nginx on IBM i PASE environment and have it work with PHP.  Let me know if you have any problems.  If you don’t already have PHP installed and compiled from source you can check my guide here: .

#some things we may need:
rpm –ignoreos –ignorearch –nodeps –replacepkgs -hUv zlib-devel-1.2.8-1.aix5.1.ppc.rpm
#nginx: [emerg] using regex "\.php$" requires PCRE library in /usr/local/nginx/conf/nginx.conf:72
rpm –ignoreos –ignorearch –nodeps –replacepkgs -hUv pcre-8.35-1.aix5.1.ppc.rpm
rpm –ignoreos –ignorearch –nodeps –replacepkgs -hUv pcre-devel-8.35-1.aix5.1.ppc.rpm
#git source
git clone -c http.sslVerify=false
cd nginx
#configure it, make it, install it
PATH=/opt/freeware/bin:$PATH \
CC=gcc \
./auto/configure \
–error-log-path=/var/log/nginx/error.log \
–http-log-path=/var/log/nginx/access.log \
–with-http_ssl_module \
–pid-path=/var/run/ \
–without-http_scgi_module \
–without-http_uwsgi_module \
–with-cpu-opt=ppc64 && gmake && gmake install
joe /usr/local/nginx/conf/nginx.conf
server {
listen 61183;
location / {
root html;
index index.php index.html index.htm;
location ~* \.php$ {
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
#test config
/usr/local/nginx/sbin/nginx -t -c /usr/local/nginx/conf/nginx.conf
#nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
#nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful
#run nginx webserver
/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
#Create a test file
rm /usr/local/nginx/html/index.html
echo "<?php phpinfo(); ?>" >> /usr/local/nginx/html/index.php
#stop the webserver and start it.
/usr/local/nginx/sbin/nginx -s stop
#setup for PHP
cp ~/php-src/php.ini-development /usr/local/phpdave7/lib/php.ini
ln -s /usr/local/phpdave7/lib/php.ini /usr/local/phpdave7/etc
joe /usr/local/phpdave7/lib/php.ini
#find cgi.fix_pathinfo and set it to 0