Sunday 1 May 2016

Youtube Downloader PHP Script

Hi Guys iam PHP Beginner and dont know about fully php... i give my best here to impress visitors daily for my blogspot its my hardwork to find and share this api based script to Generate Download and streaming links for users....
Many of them this API SCRIPT is gone to 1Lakh rupees...
iam posting this For those who suffer in middle class as poor wapmasters
 and no Background Peoples Like Me....
And I Specially Dedicated To My Loveable One Whoes Reject My Propose....

STEP 1 : you should have small vps to generate download link of youtube...

STEP 2 : First of all its youtube-dl software based it will work on Linux OS such as Centos,Debian,Ubuntu,Fedora...etc


INSTALLATION COMMANDS :-

FOR RHEL/CentOS and Fedora



 STEP 1:   yum install youtube-dl

STEP 2 :   curl https://yt-dl.org/latest/youtube-dl -o /usr/local/bin/youtube-dl
After fetching the file, you need to set a executable permission on the script to execute properly.

   STEP 3:    chmod a+rx /usr/local/bin/youtube-dl

For Ubuntu/Linux Mint and Debian



STEP 1 :    sudo add-apt-repository ppa:nilarimogard/webupd8

 STEP 2 :   sudo apt-get update

STEP 3 :    sudo apt-get install youtube-dl

STEP 4 :    sudo curl https://yt-dl.org/latest/youtube-dl -o /usr/local/bin/youtube-dl

STEP 5 :    sudo chmod a+rx /usr/local/bin/youtube-dl

thats it you installed youtube-dl on your VPS

Now you want to create Download of Youtube Video Just check this command Below:-

                     youtube-dl -g https://www.youtube.com/watch?v=h7lvXx0tMy8

Output Come like this Download Links :-

https://r6---sn-nx57ynez.googlevideo.com/videoplayback?id=87b96f5f1d2d332f&itag=136&source=youtube&requiressl=yes&initcwndbps=552500&nh=IgpwcjAxLnNlYTAzKgkxMjcuMC4wLjE&mm=31&mn=sn-nx57ynez&ms=au&mv=m&pl=25&ratebypass=yes&mime=video/mp4&gir=yes&clen=95873386&lmt=1455525847273920&dur=491.490&key=dg_yt0&sver=3&signature=64D32BDD80CC79C2CEF531F9F6BB62B508277491.2BBDC3E6CFA801952925EC251282F9437617A8D8&upn=4ise3JE1ouk&fexp=9416126,9416891,9421085,9422596,9424135,9428398,9429743,9431012,9432060,9433046,9433096,9433188,9433946,9433961,9434281,9434289,9434674,9435490,9435603,9435790&mt=1462089163&ip=XXXXXXXX&ipbits=0&expire=1462110874&sparams=ip,ipbits,expire,id,itag,source,requiressl,initcwndbps,nh,mm,mn,ms,mv,pl,ratebypass,mime,gir,clen,lmt,dur



https://r6---sn-nx57ynez.googlevideo.com/videoplayback?id=87b96f5f1d2d332f&itag=251&source=youtube&requiressl=yes&initcwndbps=552500&nh=IgpwcjAxLnNlYTAzKgkxMjcuMC4wLjE&mm=31&mn=sn-nx57ynez&ms=au&mv=m&pl=25&ratebypass=yes&mime=audio/webm&gir=yes&clen=7650122&lmt=1458206986791400&dur=491.501&key=dg_yt0&sver=3&signature=167A7EF3FF1D35C129EF1A6778761E9BC3FC0846.46AB4992397096B2312B542CEFA520A9E5812310&upn=4ise3JE1ouk&fexp=9416126,9416891,9421085,9422596,9424135,9428398,9429743,9431012,9432060,9433046,9433096,9433188,9433946,9433961,9434281,9434289,9434674,9435490,9435603,9435790&mt=1462089163&ip=XXXXXXXX&ipbits=0&expire=1462110874&sparams=ip,ipbits,expire,id,itag,source,requiressl,initcwndbps,nh,mm,mn,ms,mv,pl,ratebypass,mime

Now you have Successfully  Generated Download Link Of Youtube link

using this php script
at the end of this you should denote like
YOUTUBE.php?v=XXXXXX
v=YOUTUBEID


PHP SCRIPT DOWNLOAD ON MASTER-LAND.NET

http://master-land.net/Thread-Youtube-API-Source-PHP-Script-For-Youtube-Download-Links 




WapWon Script Youtube Api Script Php MasterLand

Hi Guys iam PHP Beginner and dont know about fully php... i give my best here to impress visitors daily for my blogspot its my hardwork to find and share this api based script to Generate Download and streaming links for users....
Many of them this API SCRIPT is gone to 1Lakh rupees...
iam posting this For those who suffer in middle class as poor wapmasters
 and no Background Peoples Like Me....
And I Specially Dedicated To My Loveable One Whoes Reject My Propose....

STEP 1 : you should have small vps to generate download link of youtube...

STEP 2 : First of all its youtube-dl software based it will work on Linux OS such as Centos,Debian,Ubuntu,Fedora...etc


INSTALLATION COMMANDS :-

FOR RHEL/CentOS and Fedora



 STEP 1:   yum install youtube-dl

STEP 2 :   curl https://yt-dl.org/latest/youtube-dl -o /usr/local/bin/youtube-dl
After fetching the file, you need to set a executable permission on the script to execute properly.

   STEP 3:    chmod a+rx /usr/local/bin/youtube-dl

For Ubuntu/Linux Mint and Debian



STEP 1 :    sudo add-apt-repository ppa:nilarimogard/webupd8

 STEP 2 :   sudo apt-get update

STEP 3 :    sudo apt-get install youtube-dl

STEP 4 :    sudo curl https://yt-dl.org/latest/youtube-dl -o /usr/local/bin/youtube-dl

STEP 5 :    sudo chmod a+rx /usr/local/bin/youtube-dl

thats it you installed youtube-dl on your VPS

Now you want to create Download of Youtube Video Just check this command Below:-

                     youtube-dl -g https://www.youtube.com/watch?v=h7lvXx0tMy8

Output Come like this Download Links :-

https://r6---sn-nx57ynez.googlevideo.com/videoplayback?id=87b96f5f1d2d332f&itag=136&source=youtube&requiressl=yes&initcwndbps=552500&nh=IgpwcjAxLnNlYTAzKgkxMjcuMC4wLjE&mm=31&mn=sn-nx57ynez&ms=au&mv=m&pl=25&ratebypass=yes&mime=video/mp4&gir=yes&clen=95873386&lmt=1455525847273920&dur=491.490&key=dg_yt0&sver=3&signature=64D32BDD80CC79C2CEF531F9F6BB62B508277491.2BBDC3E6CFA801952925EC251282F9437617A8D8&upn=4ise3JE1ouk&fexp=9416126,9416891,9421085,9422596,9424135,9428398,9429743,9431012,9432060,9433046,9433096,9433188,9433946,9433961,9434281,9434289,9434674,9435490,9435603,9435790&mt=1462089163&ip=XXXXXXXX&ipbits=0&expire=1462110874&sparams=ip,ipbits,expire,id,itag,source,requiressl,initcwndbps,nh,mm,mn,ms,mv,pl,ratebypass,mime,gir,clen,lmt,dur



https://r6---sn-nx57ynez.googlevideo.com/videoplayback?id=87b96f5f1d2d332f&itag=251&source=youtube&requiressl=yes&initcwndbps=552500&nh=IgpwcjAxLnNlYTAzKgkxMjcuMC4wLjE&mm=31&mn=sn-nx57ynez&ms=au&mv=m&pl=25&ratebypass=yes&mime=audio/webm&gir=yes&clen=7650122&lmt=1458206986791400&dur=491.501&key=dg_yt0&sver=3&signature=167A7EF3FF1D35C129EF1A6778761E9BC3FC0846.46AB4992397096B2312B542CEFA520A9E5812310&upn=4ise3JE1ouk&fexp=9416126,9416891,9421085,9422596,9424135,9428398,9429743,9431012,9432060,9433046,9433096,9433188,9433946,9433961,9434281,9434289,9434674,9435490,9435603,9435790&mt=1462089163&ip=XXXXXXXX&ipbits=0&expire=1462110874&sparams=ip,ipbits,expire,id,itag,source,requiressl,initcwndbps,nh,mm,mn,ms,mv,pl,ratebypass,mime

Now you have Successfully  Generated Download Link Of Youtube link

using this php script
at the end of this you should denote like
YOUTUBE.php?v=XXXXXX
v=YOUTUBEID


PHP SCRIPT DOWNLOAD ON MASTER-LAND.NET

http://master-land.net/Thread-Youtube-API-Source-PHP-Script-For-Youtube-Download-Links 




Install FFMPEG on Centos Ubuntu Debain Commands

Installation FFMPEG 2015 Working For All Linux CentOs Ubunthu Debian Redhat..etc

Created By Praburam No One Can Give You In Simple Commands To Install FFMPEG But I Will Give You For Freely 

Step 1 : wget http://mirror.ffmpeginstaller.com/old/sc...8.0.tar.gz
step 2 : tar -xvzf ffmpeginstaller.8.0.tar.gz
step 3 : cd ffmpeginstaller.8.0
step 4 : ./install.sh 

For Debian and Ubunthu you must use this command before to start :
apt-get install -y git-core apg build-essential 
Thats All You should have 350MB Space On VPS 
if Any Error Occur Please Reinstall Your Server in To Recommanded Os CentOs 6 i have tested On this..
99% Error Should Not Occur Because I have Tested Nearly FFMPEG WITH 20 Packages and it Takes 1 Hour Time Taken To Install.... Please Keep Alive Till Process Gone To End Because It Ask 3 Times To Install in between During Installation So You Need To Wait For that happy 
if any Support Need I can Do You Freely On This Fb link And Dontations Also Welcome And its My One Month Hard Work To Get This Command happy
https://facebook.com/prabu.ram.5454
This Command Made By PrabuRam 
This FFMPEG Contains This Following Pacakges happy
Packages Installing 
ffmpeg : 
>>Mencoder
>>A52decoder
>>Amrnb and Amrwb
>>All codecs
>>facc and faad2
>>Ruby
>>fdk-aac
>>vo-aacenc
>>vo-amrwbenc
>>flvtool2
>>Git
>>Mplayer
>>Lame
>>Libogg
>>Libvorbis
>>Libtheora
>>Libspeex
>>Libflac
>>Libao
>>Libwmf
>>opencoreamr
>>vorbistools
>>X264
>>MP4Box
>>Xvidcore
>>Yasm
>>LibOggz

Youtube Api Source PHP Script For Generating DirectStream Link By Available Pixels

Hi Guys iam PHP Beginner and dont know about fully php... i give my best here to impress visitors daily for my blogspot its my hardwork to find and share this api based script to Generate Download and streaming links for users....
Many of them this API SCRIPT is gone to 1Lakh rupees...
iam posting this For those who suffer in middle class as poor wapmasters
 and no Background Peoples Like Me....
And I Specially Dedicated To My Loveable One Whoes Reject My Propose....

STEP 1 : you should have small vps to generate download link of youtube...

STEP 2 : First of all its youtube-dl software based it will work on Linux OS such as Centos,Debian,Ubuntu,Fedora...etc


INSTALLATION COMMANDS :-

FOR RHEL/CentOS and Fedora



 STEP 1:   yum install youtube-dl

STEP 2 :   curl https://yt-dl.org/latest/youtube-dl -o /usr/local/bin/youtube-dl
After fetching the file, you need to set a executable permission on the script to execute properly.


   STEP 3:    chmod a+rx /usr/local/bin/youtube-dl

For Ubuntu/Linux Mint and Debian



STEP 1 :    sudo add-apt-repository ppa:nilarimogard/webupd8

 STEP 2 :   sudo apt-get update

STEP 3 :    sudo apt-get install youtube-dl

STEP 4 :    sudo curl https://yt-dl.org/latest/youtube-dl -o /usr/local/bin/youtube-dl

STEP 5 :    sudo chmod a+rx /usr/local/bin/youtube-dl

thats it you installed youtube-dl on your VPS

Now you want to create Download of Youtube Video Just check this command Below:-

                     youtube-dl -g https://www.youtube.com/watch?v=h7lvXx0tMy8

Output Come like this Download Links :-

https://r6---sn-nx57ynez.googlevideo.com/videoplayback?id=87b96f5f1d2d332f&itag=136&source=youtube&requiressl=yes&initcwndbps=552500&nh=IgpwcjAxLnNlYTAzKgkxMjcuMC4wLjE&mm=31&mn=sn-nx57ynez&ms=au&mv=m&pl=25&ratebypass=yes&mime=video/mp4&gir=yes&clen=95873386&lmt=1455525847273920&dur=491.490&key=dg_yt0&sver=3&signature=64D32BDD80CC79C2CEF531F9F6BB62B508277491.2BBDC3E6CFA801952925EC251282F9437617A8D8&upn=4ise3JE1ouk&fexp=9416126,9416891,9421085,9422596,9424135,9428398,9429743,9431012,9432060,9433046,9433096,9433188,9433946,9433961,9434281,9434289,9434674,9435490,9435603,9435790&mt=1462089163&ip=XXXXXXXX&ipbits=0&expire=1462110874&sparams=ip,ipbits,expire,id,itag,source,requiressl,initcwndbps,nh,mm,mn,ms,mv,pl,ratebypass,mime,gir,clen,lmt,dur



https://r6---sn-nx57ynez.googlevideo.com/videoplayback?id=87b96f5f1d2d332f&itag=251&source=youtube&requiressl=yes&initcwndbps=552500&nh=IgpwcjAxLnNlYTAzKgkxMjcuMC4wLjE&mm=31&mn=sn-nx57ynez&ms=au&mv=m&pl=25&ratebypass=yes&mime=audio/webm&gir=yes&clen=7650122&lmt=1458206986791400&dur=491.501&key=dg_yt0&sver=3&signature=167A7EF3FF1D35C129EF1A6778761E9BC3FC0846.46AB4992397096B2312B542CEFA520A9E5812310&upn=4ise3JE1ouk&fexp=9416126,9416891,9421085,9422596,9424135,9428398,9429743,9431012,9432060,9433046,9433096,9433188,9433946,9433961,9434281,9434289,9434674,9435490,9435603,9435790&mt=1462089163&ip=XXXXXXXX&ipbits=0&expire=1462110874&sparams=ip,ipbits,expire,id,itag,source,requiressl,initcwndbps,nh,mm,mn,ms,mv,pl,ratebypass,mime

Now you have Successfully  Generated Download Link Of Youtube link

using this php script
at the end of this you should denote like
YOUTUBE.php?v=XXXXXX
v=YOUTUBEID


PHP SCRIPT DOWNLOAD ON MASTER-LAND.NET

http://master-land.net/Thread-Youtube-API-Source-PHP-Script-For-Youtube-Download-Links



Saturday 19 September 2015

Install nginx FastCGI PHP (PHP-FPM) On Slackware 14

Slackware 14 + nginx + FastCGI + PHP (PHP-FPM)

I like the light-weight and fast web server nginx (Engine X).  But it is not included in the default Slackware packages.
First we need to build nginx for Slackware.  There is SlackBuilds script for nginx.  Download the script from SlackBuilds and nginx source code.
As this writing, the stable ngix version is 1.2.5 and SlackBuild script is for version 1.2.2.  You need to modified the script to match the version.  I also like to build with IPv6 support (--with-ipv6) and don't need the select and poll module (--without-poll-module, --without-select-module), we are running Slackware 14, epoll is the best method.  I also remove lines that include perl module support.  Your preferences may not be the same as mime.  I also change the build script to include nginx's default index.html and 50x.html into /var/html.  Th build script diff is here:
--- a/nginx.SlackBuild 2012-09-28 21:34:38.000000000 -0700
+++ b/nginx.SlackBuild 2012-11-19 17:02:38.712164716 -0800
@@ -25,8 +25,8 @@
 # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 PRGNAM=nginx
-VERSION=${VERSION:-1.2.2}
-BUILD=${BUILD:-2}
+VERSION=${VERSION:-1.2.5}
+BUILD=${BUILD:-1}
 TAG=${TAG:-_SBo}
 
 if [ -z "$ARCH" ]; then
@@ -85,9 +85,8 @@
   --group=${NGINXGROUP:=nogroup} \
   --error-log-path=/var/log/nginx/error.log \
   --http-log-path=/var/log/nginx/access.log \
-  --with-rtsig_module \
-  --with-select_module \
-  --with-poll_module \
+  --without-select_module \
+  --without-poll_module \
   --with-http_ssl_module \
   --with-http_realip_module \
   --with-http_addition_module \
@@ -99,14 +98,13 @@
   --with-http_random_index_module \
   --with-http_secure_link_module \
   --with-http_stub_status_module \
-  --with-http_perl_module \
-  --with-perl_modules_path=$installvendorlib \
   --http-client-body-temp-path=/var/tmp/nginx_client_body_temp \
   --http-proxy-temp-path=/var/tmp/nginx_proxy_temp \
   --http-fastcgi-temp-path=/dev/shm \
   --without-mail_pop3_module \
   --without-mail_imap_module \
-  --without-mail_smtp_module
+  --without-mail_smtp_module \
+  --with-ipv6
 
 make
 make install DESTDIR=$PKG
@@ -118,9 +116,11 @@
 find $PKG -perm 444 -exec chmod 0644 {} \;
 find $PKG -perm 555 -exec chmod 0755 {} \;
 
+sed --in-place "s/root[ \t]*html/root \/var\/html/" $PKG/etc/nginx/nginx.conf
 # Remove some other empty and/or unnecessary directories from the package
 eval $(perl '-V:archlib')
-rm -rf $PKG/$archlib $PKG/usr/html $PKG/var
+mv $PKG/usr/html  $PKG/var
+#rm -rf $PKG/$archlib $PKG/usr/html $PKG/var
 
 # Add an init script
 mkdir -p $PKG/etc/rc.d
@@ -150,4 +150,4 @@
 cat $CWD/doinst.sh > $PKG/install/doinst.sh
 
 cd $PKG
-/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
+/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-txz}

Now build the nginx server by running the script:
./ngix.SlackBuild

You will have a package file after build /tmp/nginx-1.2.5-x86_64-1_SBo.txz (I am compiling it under Slackware64), install it with the installpkg command.  And change mode of the startup script:
chmod +x /etc/rc.d/rc.nginx

One good thing about Slackware 14 is that we have already PHP-FPM built in the stock php package and does not need to go through the hassle to build PHP-FPM ourselves.  You need to make the startup script executable by
chmod +x /etc/rc.d/rc.php-fpm
Edit the file /etc/php-fmp.conf, change catch_workers_output to yes.  This will allow you to get meaningful error message in the log.
Edit the file /etc/nginx/nginx.conf, I have changed the document root to /var/html and move it to the server part:
 server {
        listen       80;
        server_name  localhost;

 root /var/html;
       ...
 }
Uncomment the line on related to fastcgi:
location ~ \.php$ {
 fastcgi_pass  127.0.0.1:9000;
 fastcgi_index index.php;
 fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
 include       fastcgi_params;
}
Note original lines
fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
has been changed to the above one.
Now, fire up the php-fpm and nginx server:
/etc/rc.d/rc.php-fpm start
/etc/rc.d/rc.nginx start
I have created a small test file /var/html/php.php:
<html>
<body>
<h1>NGINX + FASTCGI + PHP</h1>
<?php
print "<h2>Hello from PHP!</h2>"
?>
</body></html>
When you access http://localhost, you should be able to see:

Welcome to nginx!

If you see this page, the nginx web server is successfully installed and working. Further configuration is required.
For online documentation and support please refer to nginx.org.
Commercial support is available at nginx.com.
Thank you for using nginx.

When accessing http://localhost/php.php, you should be able to see:

NGINX + FASTCGI + PHP

Hello from PHP!


You may like to add the start up scripts to your rc.local script, so that the services are automatically started when you boot up your machine next time.
Reference:
Linux Slackware 13.0 + Nginx + PHP FastCGI using PHP-FPM

Install Nginx, PHP, MySQL on Slackware 13.37

Create mysql user

groupadd mysql
useradd -r -g mysql mysql

MySQL installation

cd /usr/src
wget -c "http://pmoghadam.com/homepage/Pages/Deposit/Source-packages/mysql-5.5.22.tar.gz"
su - install
cd /usr/src
tar xf mysql-5.5.22.tar.gz
cd mysql-5.5.22
cmake . \
  -DCMAKE_INSTALL_PREFIX=/usr/local/nginx/mysql \
  -DMYSQL_DATADIR=/var/lib/nginx-mysql \
  -DWITH_ARCHIVE_STORAGE_ENGINE=1 \
  -DWITH_FEDERATED_STORAGE_ENGINE=1 \
  -DWITH_BLACKHOLE_STORAGE_ENGINE=1 \
  -DINSTALL_LAYOUT=STANDALONE \
  -DENABLED_PROFILING=ON \
  -DMYSQL_MAINTAINER_MODE=OFF \
  -DWITH_DEBUG=OFF \
  -DWITH_SSL=yes
make
make install DESTDIR=/usr/local/encap/nginx-mysql-5.5.22
logout
cd /usr/local/encap/
chown -R root:root nginx-mysql-5.5.22/ 
mkencap nginx-mysql-5.5.22
epkg nginx-mysql-5.5.22

prepair database and my.cnf

cd /var/lib/
mkdir -p ./nginx-mysql
chown -R mysql ./nginx-mysql
chgrp -R mysql ./nginx-mysql

cd /usr/local/nginx/mysql/ 
chown -R mysql .
chgrp -R mysql .
scripts/mysql_install_db --user=mysql --datadir=/var/lib/nginx-mysql
chown -R root .

egrep -v '^#|^ *$' support-files/my-medium.cnf > /usr/local/nginx/mysql/my.cnf
sed -i -e 's/^log-bin=/#log-bin=/' /usr/local/nginx/mysql/my.cnf
sed -i -e 's/^binlog_format=/#binlog_format=/' /usr/local/nginx/mysql/my.cnf

/usr/local/nginx/mysql/my.cnf

[client]
port                = 3306
socket              = /var/lib/nginx-mysql/mysql.sock
[mysqld]
port                = 3306
socket              = /var/lib/nginx-mysql/mysql.sock
skip-external-locking
key_buffer_size = 16M
max_allowed_packet = 1M
table_open_cache = 64
sort_buffer_size = 512K
net_buffer_length = 8K
read_buffer_size = 256K
read_rnd_buffer_size = 512K
myisam_sort_buffer_size = 8M
server-id   = 1
[mysqldump]
quick
max_allowed_packet = 16M
[mysql]
no-auto-rehash
[myisamchk]
key_buffer_size = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M
[mysqlhotcopy]
interactive-timeout

Start mysqld for the first time

/usr/local/nginx/mysql/bin/mysqld_safe  \
    --defaults-file=/usr/local/nginx/mysql/my.cnf \
    --user=mysql \
    --datadir=/var/lib/nginx-mysql \
    --pid-file=/var/lib/nginx-mysql/mysql.pid \
    --skip-networking &

Secure installation wizard

env MYSQL_UNIX_PORT=/var/lib/nginx-mysql/mysql.sock \
    /usr/local/nginx/mysql/bin/mysql_secure_installation

Enter current password for root (enter for none):
Set root password? [Y/n] y 
Remove anonymous users? [Y/n] y 
Disallow root login remotely? [Y/n] n 
Remove test database and access to it? [Y/n] y 
Reload privilege tables now? [Y/n] y

Create appropriate mysql command line client

cat > /usr/local/sbin/mysql-nginx << EOF
env MYSQL_UNIX_PORT=/var/lib/nginx-mysql/mysql.sock /usr/local/nginx/mysql/bin/mysql \$*
EOF
chmod +x /usr/local/sbin/mysql-nginx

Startup script: /etc/rc.d/rc.mysqld-nginx

#!/bin/bash
#
# /etc/rc.d/rc.mysqld-nginx
#

BASEDIR="/usr/local/nginx/mysql/"
DATADIR="/var/lib/nginx-mysql"
PID="${DATADIR}/mysql.pid"

# Disable networking
SKIP="--skip-networking"

# Start mysqld:
mysqld_start() {
  # Remove stale pid file
  if [ -r ${PID} ]; then
    if ! ps ax | grep -v grep | egrep -q 'mysqld'; then
      echo "Cleaning up stale pid file: ${PID}"
      rm -f ${PID}
    fi
  fi

  ${BASEDIR}/bin/mysqld_safe --defaults-file=/usr/local/nginx/mysql/my.cnf \
    --user=mysql --datadir=${DATADIR} --pid-file=${PID} $SKIP & 
}

# Stop mysqld:
mysqld_stop() {
  # If there is no PID file, ignore this request...
  if [ -r ${PID} ]; then
    kill $(cat ${PID})
    # Wait at least one minute for it to exit, as we don't know how big the DB is...
    for second in $(seq 1 60); do
      if [ ! -r ${PID} ]; then
        break;
      fi
      sleep 1
    done
    if [ "$second" == "60" ]; then
      echo "WARNING:  Gave up waiting for mysqld to exit!"
      sleep 15
    fi
  fi
}

# Restart mysqld:
mysqld_restart() {
  mysqld_stop
  mysqld_start
}

case "$1" in
'start')
  mysqld_start
  ;;
'stop')
  mysqld_stop
  ;;
'restart')
  mysqld_restart
  ;;
*)
  echo "usage $0 start|stop|restart"
esac

Normal startup

chmod +x /etc/rc.d/rc.mysqld-nginx
/etc/rc.d/rc.mysqld-nginx restart

PHP-FPM installation (FastCGI Process Manager)

cd /usr/src
wget -c "http://pmoghadam.com/homepage/Pages/Deposit/Source-packages/php-5.4.0.tar.bz2"
su - install
cd /usr/src
tar xf php-5.4.0.tar.bz2
cd php-5.4.0
./configure \
  --prefix=/usr/local/nginx/php \
  --enable-pdo \
  --with-pdo-mysql \
  --with-pdo-sqlite=shared,/usr/local/nginx/php \
  --libdir=/usr/local/nginx/php/usr/lib \
  --with-libdir=lib \
  --sysconfdir=/usr/local/nginx/php/etc \
  --enable-mbregex \
  --enable-tokenizer=shared \
  --with-config-file-scan-dir=/usr/local/nginx/php/etc/php \
  --with-config-file-path=/usr/local/nginx/php/etc/httpd \
  --enable-mod_charset \
  --with-layout=PHP \
  --enable-sigchild \
  --enable-dom \
  --enable-libxml \
  --enable-xml \
  --with-libxml-dir=/usr/local/nginx/php/usr \
  --enable-simplexml \
  --enable-filter \
  --disable-debug \
  --with-openssl=shared \
  --with-pcre-regex=/usr \
  --with-zlib=shared,/usr \
  --enable-bcmath=shared \
  --with-bz2=shared,/usr/local/nginx/php/usr \
  --enable-calendar=shared \
  --enable-ctype=shared \
  --with-curl=shared \
  --with-curlwrappers \
  --enable-dba=shared \
  --with-gdbm=/usr/local/nginx/php/usr \
  --with-db4=/usr/local/nginx/php/usr \
  --enable-exif=shared \
  --enable-ftp=shared \
  --with-gd=shared \
  --with-jpeg-dir=/usr/local/nginx/php/usr \
  --with-png-dir=/usr/local/nginx/php/usr \
  --with-zlib-dir=/usr/local/nginx/php/usr \
  --with-xpm-dir=/usr/local/nginx/php/usr \
  --with-freetype-dir=/usr/local/nginx/php/usr \
  --with-t1lib=/usr/local/nginx/php/usr \
  --enable-gd-native-ttf \
  --enable-gd-jis-conv \
  --with-gettext=shared,/usr/local/nginx/php/usr \
  --with-gmp=shared,/usr/local/nginx/php/usr \
  --with-iconv=shared \
  --with-ldap=shared \
  --enable-mbstring=shared \
  --enable-hash \
  --with-mysql=shared,mysqlnd \
  --with-mysqli=shared,mysqlnd \
  --with-mysql-sock=/var/lib/nginx-mysql/mysql.sock \
  --with-pspell=shared,/usr \
  --with-enchant=shared,/usr \
  --with-mm=/usr/local/nginx/php/usr \
  --enable-shmop=shared \
  --with-snmp=shared,/usr \
  --enable-soap=shared \
  --enable-sockets \
  --with-sqlite3=shared \
  --with-regex=php \
  --enable-sysvmsg \
  --enable-sysvsem \
  --enable-sysvshm \
  --enable-wddx=shared \
  --with-xsl=shared,/usr/local/nginx/php/usr \
  --enable-zip=shared \
  --with-tsrm-pthreads \
  --enable-shared=yes \
  --enable-static=no \
  --with-gnu-ld \
  --with-pic \
  --enable-fpm
make -j 7 || make || make || make
make install INSTALL_ROOT=/usr/local/encap/nginx-php-5.4.0
logout
cd /usr/local/encap/nginx-php-5.4.0
find . -perm 777 -exec chmod -v 755 {} \;
find . -perm 775 -exec chmod -v 755 {} \;
find . -perm 664 -exec chmod -v 644 {} \;
cd /usr/local/encap/
chown -R root:root nginx-php-5.4.0
mkencap nginx-php-5.4.0/
epkg nginx-php-5.4.0/

/usr/local/nginx/php/etc/php-fpm.conf

[global]
[www]
user = apache
group = apache
listen = 127.0.0.1:9000
pm = dynamic
pm.max_children = 5
pm.start_servers = 2
pm.min_spare_servers = 1
pm.max_spare_servers = 3

/etc/rc.d/rc.php-fpm

#!/bin/bash
#
# /etc/rc.d/rc.php-fpm
#

PREFIX="/usr/local/nginx/php"
BIN="${PREFIX}/sbin/php-fpm"
CONF="${PREFIX}/etc/php-fpm.conf"
PID="${PREFIX}/var/run/php-fpm.pid"
INI="${PREFIX}/etc/php.ini"
OPTS="-c ${INI} --pid ${PID} --fpm-config ${CONF}"
TIMEOUT=35

wait_for_pid () {
  for try in $(seq 0 $TIMEOUT); do
    case "$1" in
      'created')
        [ -f "$2" ] && try='' && break
        ;;

      'removed')
        [ ! -f "$2" ] && try='' && break
        ;;
    esac
    echo -n .
    sleep 1
  done
}

case "$1" in

  start)
    echo -n "Starting php-fpm: "
    ${BIN} ${OPTS}
    [ "$?" != "0" ] && echo "Failed !!!" && exit 1
    wait_for_pid created $PID
    [ -n "$try" ] && echo "Failed !!!" && exit 1
    echo "Done."
    ;;

  stop)
    echo -n "Gracefully shutting down php-fpm: "
    [ ! -r $PID ] && echo "pid file not found - is php-fpm running?" && exit 1
    kill -QUIT $(cat $PID)
    wait_for_pid removed $PID
    [ -n "$try" ] && echo "Failed !!! Use force-quit" && exit 1
    echo "Done."
    ;;

  force-quit)
    echo -n "Terminating php-fpm: "
    [ ! -r $PID ] && echo "pid file not found - is php-fpm running?" && exit 1
    kill -TERM $(cat $PID)
    wait_for_pid removed $PID
    [ -n "$try" ] && echo "Failed !!! Use force-quit" && exit 1
    echo "Done."
    ;;

  restart)
    $0 stop
    $0 start
    ;;

  reload)
    echo -n "Reload service php-fpm: "
    [ ! -r $PID ] && echo "pid file not found - is php-fpm running?" && exit 1
    kill -USR2 $(cat $php_fpm_PID)
    echo "Done."
    ;;

  *)
    echo "Usage: $0 {start|stop|force-quit|restart|reload}"
    exit 1
    ;;

esac

/usr/local/nginx/php/etc/php.ini

[PHP]
engine = On
short_open_tag = Off
asp_tags = Off
precision = 14
y2k_compliance = On
output_buffering = 4096
zlib.output_compression = Off
implicit_flush = Off
unserialize_callback_func =
serialize_precision = 17
allow_call_time_pass_reference = Off
safe_mode = Off
safe_mode_gid = Off
safe_mode_include_dir =
safe_mode_exec_dir =
safe_mode_allowed_env_vars = PHP_
safe_mode_protected_env_vars = LD_LIBRARY_PATH
disable_functions =
disable_classes =
expose_php = On
max_execution_time = 30
max_input_time = 60
memory_limit = 128M
error_reporting = E_ALL & ~E_DEPRECATED
display_errors = On
display_startup_errors = Off
log_errors = On
log_errors_max_len = 1024
ignore_repeated_errors = Off
ignore_repeated_source = Off
report_memleaks = On
track_errors = Off
html_errors = Off
variables_order = "GPCS"
request_order = "GP"
register_globals = Off
register_long_arrays = Off
register_argc_argv = Off
auto_globals_jit = On
post_max_size = 8M
magic_quotes_gpc = Off
magic_quotes_runtime = Off
magic_quotes_sybase = Off
auto_prepend_file =
auto_append_file =
default_mimetype = "text/html"
doc_root =
user_dir =
enable_dl = Off
file_uploads = On
upload_max_filesize = 2M
max_file_uploads = 20
allow_url_fopen = On
allow_url_include = Off
default_socket_timeout = 60
extension=bcmath.so
extension=bz2.so
extension=calendar.so
extension=ctype.so
extension=curl.so
extension=dba.so
extension=enchant.so
extension=exif.so
extension=ftp.so
extension=gd.so
extension=gettext.so
extension=gmp.so
extension=iconv.so
extension=ldap.so
extension=mbstring.so
extension=mysql.so
extension=mysqli.so
extension=openssl.so
extension=pdo.so
extension=pdo_mysql.so
extension=pdo_sqlite.so
extension=pspell.so
extension=shmop.so
extension=snmp.so
extension=soap.so
extension=sqlite.so
extension=sqlite3.so
extension=tokenizer.so
extension=wddx.so
extension=xsl.so
extension=zip.so
extension=zlib.so
[Date]
[filter]
[iconv]
[intl]
[sqlite]
[sqlite3]
[Pcre]
[Pdo]
[Pdo_mysql]
pdo_mysql.cache_size = 2000
pdo_mysql.default_socket=
[Phar]
[Syslog]
define_syslog_variables  = Off
[mail function]
SMTP = localhost
smtp_port = 25
mail.add_x_header = On
[SQL]
sql.safe_mode = Off
[ODBC]
odbc.allow_persistent = On
odbc.check_persistent = On
odbc.max_persistent = -1
odbc.max_links = -1
odbc.defaultlrl = 4096
odbc.defaultbinmode = 1
[Interbase]
ibase.allow_persistent = 1
ibase.max_persistent = -1
ibase.max_links = -1
ibase.timestampformat = "%Y-%m-%d %H:%M:%S"
ibase.dateformat = "%Y-%m-%d"
ibase.timeformat = "%H:%M:%S"
[MySQL]
mysql.allow_local_infile = On
mysql.allow_persistent = On
mysql.cache_size = 2000
mysql.max_persistent = -1
mysql.max_links = -1
mysql.default_port =
mysql.default_socket =
mysql.default_host =
mysql.default_user =
mysql.default_password =
mysql.connect_timeout = 60
mysql.trace_mode = Off
[MySQLi]
mysqli.max_persistent = -1
mysqli.allow_persistent = On
mysqli.max_links = -1
mysqli.cache_size = 2000
mysqli.default_port = 3306
mysqli.default_socket =
mysqli.default_host =
mysqli.default_user =
mysqli.default_pw =
mysqli.reconnect = Off
[mysqlnd]
mysqlnd.collect_statistics = On
mysqlnd.collect_memory_statistics = Off
[OCI8]
[PostgresSQL]
pgsql.allow_persistent = On
pgsql.auto_reset_persistent = Off
pgsql.max_persistent = -1
pgsql.max_links = -1
pgsql.ignore_notice = 0
pgsql.log_notice = 0
[Sybase-CT]
sybct.allow_persistent = On
sybct.max_persistent = -1
sybct.max_links = -1
sybct.min_server_severity = 10
sybct.min_client_severity = 10
[bcmath]
bcmath.scale = 0
[browscap]
[Session]
session.save_handler = files
session.save_path = "/var/lib/php"
session.use_cookies = 1
session.use_only_cookies = 1
session.name = PHPSESSID
session.auto_start = 0
session.cookie_lifetime = 0
session.cookie_path = /
session.cookie_domain =
session.cookie_httponly =
session.serialize_handler = php
session.gc_probability = 1
session.gc_divisor = 1000
session.gc_maxlifetime = 1440
session.bug_compat_42 = Off
session.bug_compat_warn = Off
session.referer_check =
session.entropy_length = 0
session.cache_limiter = nocache
session.cache_expire = 180
session.use_trans_sid = 0
session.hash_function = 0
session.hash_bits_per_character = 5
url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=fakeentry"
[MSSQL]
mssql.allow_persistent = On
mssql.max_persistent = -1
mssql.max_links = -1
mssql.min_error_severity = 10
mssql.min_message_severity = 10
mssql.compatability_mode = Off
mssql.secure_connection = Off
[Assertion]
[COM]
[mbstring]
[gd]
[exif]
[Tidy]
tidy.clean_output = Off
[soap]
soap.wsdl_cache_enabled=1
soap.wsdl_cache_dir="/tmp"
soap.wsdl_cache_ttl=86400
soap.wsdl_cache_limit = 5
[sysvshm]
[ldap]
ldap.max_links = -1
[mcrypt]
[dba]

Starting php-fpm daemon

chmod +x /etc/rc.d/rc.php-fpm
/etc/rc.d/rc.php-fpm start
ps -A | grep php-fpm

Nginx installation

cd /usr/src
wget -c "http://pmoghadam.com/homepage/Pages/Deposit/Source-packages/nginx-1.0.13.tar.gz"
su - install
cd /usr/src
tar xf nginx-1.0.13.tar.gz
cd nginx-1.0.13
./configure \
  --with-http_ssl_module \
  --without-mail_pop3_module \
  --without-mail_imap_module \
  --without-mail_smtp_module \
  --with-http_stub_status_module \
  --with-rtsig_module \
  --with-select_module \
  --with-poll_module \
  --with-http_realip_module \
  --with-http_addition_module \
  --with-http_xslt_module \
  --with-http_sub_module \
  --with-http_dav_module \
  --with-http_flv_module \
  --with-http_gzip_static_module \
  --with-http_random_index_module \
  --with-http_secure_link_module \
  --with-http_stub_status_module
make
make install DESTDIR=/usr/local/encap/nginx-1.0.13
cd /usr/local/encap/nginx-1.0.13
mkdir -p usr/local/nginx/conf/sites-enabled
logout
cd /usr/local/encap
chown -R  root:root nginx-1.0.13/
mkencap nginx-1.0.13/
epkg  nginx-1.0.13/

/usr/local/nginx/conf/fastcgi_params

fastcgi_param  QUERY_STRING       $query_string;
fastcgi_param  REQUEST_METHOD     $request_method;
fastcgi_param  CONTENT_TYPE       $content_type;
fastcgi_param  CONTENT_LENGTH     $content_length;

fastcgi_param  SCRIPT_NAME        $fastcgi_script_name;
fastcgi_param  REQUEST_URI        $request_uri;
fastcgi_param  DOCUMENT_URI       $document_uri;
fastcgi_param  DOCUMENT_ROOT      $document_root;
fastcgi_param  SERVER_PROTOCOL    $server_protocol;

fastcgi_param  GATEWAY_INTERFACE  CGI/1.1;
fastcgi_param  SERVER_SOFTWARE    nginx/$nginx_version;

fastcgi_param  REMOTE_ADDR        $remote_addr;
fastcgi_param  REMOTE_PORT        $remote_port;
fastcgi_param  SERVER_ADDR        $server_addr;
fastcgi_param  SERVER_PORT        $server_port;
fastcgi_param  SERVER_NAME        $server_name;

# PHP only, required if PHP was built with --enable-force-cgi-redirect
fastcgi_param  REDIRECT_STATUS    200;

fastcgi_connect_timeout 60;
fastcgi_send_timeout 180;
fastcgi_read_timeout 180;
fastcgi_buffer_size 128k;
fastcgi_buffers 4 256k;
fastcgi_busy_buffers_size 256k;
fastcgi_temp_file_write_size 256k;
fastcgi_intercept_errors on;

/usr/local/nginx/conf/nginx.conf

user  nobody;
worker_processes  6;

events {
    worker_connections  1024;
}

http {
    include       mime.types;
    default_type  application/octet-stream;
    sendfile        on;
    keepalive_timeout  10 10;

    gzip on;
    gzip_comp_level 1;
    gzip_proxied any;
    gzip_types text/plain text/css application/x-javascript text/xml application/xml application/xml+rss text/javascript;

    log_format main '$remote_addr - $remote_user [$time_local] '
                    '"$request" $status  $body_bytes_sent "$http_referer" '
                    '"$http_user_agent" "$http_x_forwarded_for"';

    access_log  logs/nginx_access.log  main;
    error_log  logs/nginx_error.log debug;

    include /usr/local/nginx/conf/sites-enabled/*;
}

/usr/local/nginx/conf/sites-enabled/default.conf

server {
    listen 8000;
    server_name localhost;
    #access_log  /var/log/nginx/localhost.access.log;

## Default location
    location / {
        root /srv/nginx;
        index index.php;
    }

## Images and static content is treated different
    location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico|xml)$ {
      access_log        off;
      expires           30d;
      root /srv/nginx;
    }

## Parse all .php file in the /srv/nginx directory
    location ~ .php$ {
        fastcgi_split_path_info ^(.+\.php)(.*)$;
        fastcgi_pass   backend;
        fastcgi_index  index.php;
        fastcgi_param  SCRIPT_FILENAME  /srv/nginx$fastcgi_script_name;
        include fastcgi_params;
        fastcgi_param  QUERY_STRING     $query_string;
        fastcgi_param  REQUEST_METHOD   $request_method;
        fastcgi_param  CONTENT_TYPE     $content_type;
        fastcgi_param  CONTENT_LENGTH   $content_length;
        #fastcgi_intercept_errors        on;
        fastcgi_ignore_client_abort     off;
        #fastcgi_connect_timeout 60;
        #fastcgi_send_timeout 180;
        #fastcgi_read_timeout 180;
        #fastcgi_buffer_size 128k;
        #fastcgi_buffers 4 256k;
        #fastcgi_busy_buffers_size 256k;
        #fastcgi_temp_file_write_size 256k;
    }

## Disable viewing .htaccess & .htpassword
    location ~ /\.ht {
        deny  all;
    }
}
upstream backend {
        server 127.0.0.1:9000;
}

/etc/rc.d/rc.nginx

#!/bin/bash
#
# Nginx daemon control script.
#

BIN="/usr/local/nginx/sbin/nginx"
CONF="/usr/local/nginx/conf/nginx.conf"
PID_FILE="/usr/local/nginx/logs/nginx.pid"
PID="$(pgrep -o '^nginx$')"

nginx_start()
{
  if [ ! -r "$CONF" ]; then
    echo "$CONF does not appear to exist. Abort."
    exit 1
  fi

  if [ -n "$PID" ]; then
    echo "Nginx appears to already be running?"
    echo "$PID exists. Abort."
    exit 1
  fi

  echo "Starting Nginx server daemon..."
  [ -e "$PID_FILE" ] && rm "$PID_FILE"
  if [ -x $BIN ]; then
    $BIN -c $CONF
  fi
}

nginx_test_conf() {
  echo "Checking configuration for correct syntax and"
  echo "then trying to open files referenced in configuration..."
  $BIN -t -c $CONF
}

nginx_term() {
  echo "Shutdown Nginx quickly..."
  kill -TERM $PID
}

nginx_stop() {
  echo "Shutdown Nginx gracefully..."
  kill -QUIT $PID
}

nginx_reload() {
  echo "Reloading Nginx configuration..."
  kill -HUP $PID
}

nginx_rotate() {
  echo "Rotating Nginx logs..."
  kill -USR1 $PID
}

nginx_restart() {
  nginx_stop
  sleep 3
  nginx_start
}

case "$1" in
  check)
    nginx_test_conf
    ;;
  start)
    nginx_start
    ;;
  term)
    nginx_term
    ;;
  stop)
    nginx_stop
    ;;
  reload)
    nginx_reload
    ;;
  restart)
    nginx_restart
    ;;
  rotate)
    nginx_rotate
    ;;
  *)
  echo "usage: `basename $0` {check|start|term|stop|reload|restart|rotate}"
esac

Commands

mkdir -p /srv/nginx/
chown nobody:nobody /srv/nginx/
chmod +x /etc/rc.d/rc.nginx
/etc/rc.d/rc.nginx start

/srv/nginx/index.php

<?php phpinfo(); ?>

/etc/rc.d/rc.local

/etc/rc.d/rc.mysqld-nginx start
/etc/rc.d/rc.php-fpm start
/etc/rc.d/rc.nginx start

/etc/rc.d/rc.local_shutdown

#!/bin/bash

/etc/rc.d/rc.nginx stop
/etc/rc.d/rc.php-fpm stop
/etc/rc.d/rc.mysqld-nginx stop

Commands

chmod +x /etc/rc.d/rc.local_shutdown

Note: nginx original configure command line

./configure \
  --prefix=/usr \
  --sbin-path=/usr/sbin/nginx \
  --conf-path=/etc/nginx/nginx.conf \
  --pid-path=/var/run/nginx.pid \
  --lock-path=/var/lock/nginx \
  --user=${NGINXUSER:=nobody} \
  --group=${NGINXGROUP:=nogroup} \
  --error-log-path=/var/log/nginx/error.log \
  --http-log-path=/var/log/nginx/access.log \
  --with-rtsig_module \
  --with-select_module \
  --with-poll_module \
  --with-http_ssl_module \
  --with-http_realip_module \
  --with-http_addition_module \
  --with-http_xslt_module \
  --with-http_sub_module \
  --with-http_dav_module \
  --with-http_flv_module \
  --with-http_gzip_static_module \
  --with-http_random_index_module \
  --with-http_secure_link_module \
  --with-http_stub_status_module \
  --with-http_perl_module \
  --with-perl_modules_path=$installvendorlib \
  --http-client-body-temp-path=/var/tmp/nginx_client_body_temp \
  --http-proxy-temp-path=/var/tmp/nginx_proxy_temp \
  --http-fastcgi-temp-path=/dev/shm \
  --without-mail_pop3_module \
  --without-mail_imap_module \
  --without-mail_smtp_module

Note: php original configure command line

./configure \
  --prefix=/usr/local/nginx/php \
  --libdir=/usr/lib \
  --with-libdir=lib \
  --sysconfdir=/etc \
  --disable-safe-mode \
  --disable-magic-quotes \
  --enable-zend-multibyte \
  --enable-mbregex \
  --enable-tokenizer=shared \
  --with-config-file-scan-dir=/etc/php \
  --with-config-file-path=/etc/httpd \
  --enable-mod_charset \
  --with-layout=PHP \
  --enable-sigchild \
  --enable-xml \
  --with-libxml-dir=/usr \
  --enable-simplexml \
  --enable-filter \
  --disable-debug \
  --with-openssl=shared \
  --with-pcre-regex=/usr \
  --with-zlib=shared,/usr \
  --enable-bcmath=shared \
  --with-bz2=shared,/usr \
  --enable-calendar=shared \
  --enable-ctype=shared \
  --with-curl=shared \
  --with-curlwrappers \
  --with-mcrypt=/usr \
  --enable-dba=shared \
  --with-gdbm=/usr \
  --with-db4=/usr \
  --enable-exif=shared \
  --enable-ftp=shared \
  --with-gd=shared \
  --with-jpeg-dir=/usr \
  --with-png-dir=/usr \
  --with-zlib-dir=/usr \
  --with-xpm-dir=/usr \
  --with-freetype-dir=/usr \
  --with-t1lib=/usr \
  --enable-gd-native-ttf \
  --enable-gd-jis-conv \
  --with-gettext=shared,/usr \
  --with-gmp=shared,/usr \
  --with-iconv=shared \
  --with-imap-ssl=/usr \
  --with-imap=$IMAPLIBDIR \
  --with-ldap=shared \
  --enable-mbstring=shared \
  --enable-hash \
  --with-mysql=shared,mysqlnd \
  --with-mysqli=shared,mysqlnd \
  --with-mysql-sock=/var/run/mysql/mysql.sock \
  --enable-pdo=shared \
  --with-pdo-mysql=shared,mysqlnd \
  --with-pdo-sqlite=shared,/usr \
  --with-pspell=shared,/usr \
  --with-enchant=shared,/usr \
  --with-mm=/usr \
  --enable-shmop=shared \
  --with-snmp=shared,/usr \
  --enable-soap=shared \
  --enable-sockets \
  --with-sqlite=shared \
  --with-sqlite3=shared \
  --enable-sqlite-utf8 \
  --with-regex=php \
  --enable-sysvmsg \
  --enable-sysvsem \
  --enable-sysvshm \
  --enable-wddx=shared \
  --with-xsl=shared,/usr \
  --enable-zip=shared \
  --with-tsrm-pthreads \
  --enable-shared=yes \
  --enable-static=no \
  --with-gnu-ld \
  --with-pic \
  --enable-fpm

Install Nginx and php-fpm in Slackware 14.1 using Slackbuilds method

Nginx (pronounced “engine-x”) is an open source reverse proxy server for HTTP, HTTPS, SMTP, POP3, and IMAP protocols, as well as a load balancer, HTTP cache, and a web server (origin server). The nginx project started with a strong focus on high concurrency, high performance and low memory usage. It is licensed under the 2-clause BSD-like license and it runs on Linux, BSD variants, Mac OS X, Solaris, AIX, HP-UX, as well as on other *nix flavors. It also has a proof of concept port for Microsoft Windows.
Info about the system:
root@slackwar14:~# cat   /etc/slackware-version
 Slackware 14.1
root@slackwar14:~# uname   -a
 Linux slackwar14 3.10.17-smp #2 SMP Wed Oct 23 17:13:14 CDT 2013 i686 Intel(R) Core(TM) i7-3740QM CPU @ 2.70GHz GenuineIntel GNU/Linux
Dowload nginx Slackbuild:
root@slackwar14:~# wget  http://slackbuilds.org/slackbuilds/14.1/network/nginx.tar.gz
 --2014-07-04 11:50:27--  http://slackbuilds.org/slackbuilds/14.1/network/nginx.tar.gz
 Resolving slackbuilds.org (slackbuilds.org)... 208.94.238.115
 Connecting to slackbuilds.org (slackbuilds.org)|208.94.238.115|:80... connected.
 HTTP request sent, awaiting response... 200 OK
 Length: 4660 (4.6K) [application/x-gzip]
 Saving to: 'nginx.tar.gz'
 100%[===================================================================================================================================================================================================>] 4,660       --.-K/s   in 0s
 2014-07-04 11:50:27 (618 MB/s) - 'nginx.tar.gz' saved [4660/4660]
Extract with:
tar -zxvf nginx.tar.gz
Download Lastest nginx tarball inside the  nginx folder
cd nginx
root@slackwar14:~# wget http://nginx.org/download/nginx-1.7.2.tar.gz
 --2014-07-04 11:53:32--  http://nginx.org/download/nginx-1.7.2.tar.gz
 Resolving nginx.org (nginx.org)... 206.251.255.63
 Connecting to nginx.org (nginx.org)|206.251.255.63|:80... connected.
 HTTP request sent, awaiting response... 200 OK
 Length: 814079 (795K) [application/octet-stream]
 Saving to: 'nginx-1.7.2.tar.gz'
100%[===================================================================================================================================================================================================>] 814,079      193KB/s   in 4.4s
2014-07-04 11:53:36 (182 KB/s) - 'nginx-1.7.2.tar.gz' saved [814079/814079]
 The Output is like this:
root@slackwar14:~/nginx# ls -altr
total 836
-rw-r--r-- 1 1016 users    762 Nov 26  2013 slack-desc
-rw-r--r-- 1 1016 users   1684 Nov 26  2013 rc.nginx
-rw-r--r-- 1 1016 users    178 Nov 26  2013 nginx.logrotate
-rw-r--r-- 1 1016 users    931 Apr 14 13:49 doinst.sh
-rw-r--r-- 1 1016 users    833 Apr 14 13:49 README
-rw-r--r-- 1 1016 users    267 Apr 27 19:23 nginx.info
-rwxr-xr-x 1 1016 users   5683 May 20 18:58 nginx.SlackBuild*
-rw-r--r-- 1 root root  814079 Jun 17 15:35 nginx-1.7.2.tar.gz
drwx--x--- 3 root root    4096 Jul  4 11:57 ../
drwxr-xr-x 2 1016 users   4096 Jul  4 11:57 ./

Edit nginx.SlackBuild: 
PRGNAM=nginx
VERSION=${VERSION:-1.6.0}
BUILD=${BUILD:-2}
TAG=${TAG:-_SBo}

to
PRGNAM=nginx
VERSION=${VERSION:-1.7.2}
BUILD=${BUILD:-2}
TAG=${TAG:-_SBo}
Now you are ready to build the Nginx with this command:
 root@slackwar14:~/nginx# ./nginx.SlackBuild
...............................
............................
...................................
usr/lib/perl5/vendor_perl/
usr/lib/perl5/vendor_perl/nginx.pm
usr/lib/perl5/vendor_perl/auto/
usr/lib/perl5/vendor_perl/auto/nginx/
usr/lib/perl5/vendor_perl/auto/nginx/nginx.so
usr/doc/
usr/doc/nginx-1.7.2/
usr/doc/nginx-1.7.2/README
usr/doc/nginx-1.7.2/CHANGES.ru
usr/doc/nginx-1.7.2/CHANGES
usr/doc/nginx-1.7.2/LICENSE
usr/doc/nginx-1.7.2/nginx.SlackBuild

Slackware package /tmp/nginx-1.7.2-i486-2_SBo.tgz created.

Install the package generated under /tmp directory:
 root@slackwar14:~/nginx# installpkg   /tmp/nginx-1.7.2-i486-2_SBo.tgz
Verifying package nginx-1.7.2-i486-2_SBo.tgz.
Installing package nginx-1.7.2-i486-2_SBo.tgz:
PACKAGE DESCRIPTION:
# nginx (http/imap/pop3 proxy)
#
# Nginx [engine x] is a high-performance HTTP server and reverse proxy,
# as well as an IMAP/POP3 proxy server.
#
# Nginx was written by Igor Sysoev.
#
# Homepage: http://nginx.net/
#
Executing install script for nginx-1.7.2-i486-2_SBo.tgz.
Package nginx-1.7.2-i486-2_SBo.tgz installed.

root@slackwar14:~/nginx#

Configure Nginx
Remove or disable Apache if existing:
Enable nginx and php-fm to start on boot:
chmod +x /etc/rc.d/rc.php-fpm
chmod +x /etc/rc.d/rc.nginx
Edit the Root Web directory (default is /var/www/html) in my case changed  html to unixmen.
Configure PHP
vi /etc/nginx/nginx.conf
and
        location / {
            root   /var/www/unixmen;
            index  index.php index.html index.htm;
        }

        #error_page  404              /404.html;

        # redirect server error pages to the static page /50x.html
        #
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   /var/www/unixmen;
        }

        # proxy the PHP scripts to Apache listening on 127.0.0.1:80
        #
        #location ~ \.php$ {
        #    proxy_pass   http://127.0.0.1;
        #}

        # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
        #

        location ~ .php$ {
        root /var/www/unixmen;
        fastcgi_split_path_info ^(.+\.php)(.*)$;
        fastcgi_pass   127.0.0.1:9000;
        fastcgi_index  index.php;
        fastcgi_param  SCRIPT_FILENAME  /var/www/unixmen$fastcgi_script_name;
        include fastcgi_params;
    }
}



save and exit.
Make Index.html on /var/www/unixmen.
cp /var/www/jtml/index /var/www/unixmen
Make phpinfo page:
vi /var/www/unixmen/info.php
and, add:
<?php
phpinfo();
?>

save and exit.
Restart The Deamons:
root@slackwar14:/etc/nginx# /etc/rc.d/rc.php-fpm restart
root@slackwar14:/etc/nginx# /etc/rc.d/rc.nginx restart
Now check the http page and php test page:
http://ip/info.php
slckwarenginx
php-slackware


Done.