HOW-TO Install Spawn-FCGI & PHP with MySQL for Nginx: VPS BIBLE




new password?
login
X
php fastcgi spawn-fcgi logo image

This tutorial guide shows how to install MySQL & PHP compiled with Spawn-FCGI to work with the Nginx web server and to start automatically on reboot.

Let me point out, this is not the FastCGI method I recommend and I suggest you consider the alternatives at vpsBible’s PHP Index page (publishing Friday) and at the FastCGI benchmark page that tests Spawn-FCGI against regular FastCGI and PHP-FPM.

Then again, the method to install PHP with Spawn-FCGI has been simplified recently (you used to have to extract Spawn-FCGI from a Lighttpd web server installation) and here is the updated method for anyone interested.

Setup Unmanaged VPS: The Ubuntu-Nginx Guide

Take your virtual private server from zero to hero

  .. from blank box to cute-as server ..  

with this easy-to-follow copy/paste guide.

22+ parts with video, here’s the index.

Assume Super-User Permissions

To gain root access and save a few keystrokes:-


Please sign up for automatic premium content access.

Just $15/year* will save you hours, maybe days!

Alternatively, the vpsBible forum is free and you are welcome.

Install MySQL

Paste this to install MySQL and its dependents:-


Please sign up for automatic premium content access.

Just $15/year* will save you hours, maybe days!

Alternatively, the vpsBible forum is free and you are welcome.

…when prompted, enter your new root MySQL password; change it again if you want to, but this isn’t necessary; type “y” to remove anonymous users; type “y” to disallow root login remotely; type “y” to remove test database and access to it; type “y” to reload privilege tables.

Install PHP

.. together with various modules required for hosting sites.


Please sign up for automatic premium content access.

Just $15/year* will save you hours, maybe days!

Alternatively, the vpsBible forum is free and you are welcome.

PHP needs a quick fix. Paste the following to edit PHP’s configuration file php.ini, without actually opening it:-


Please sign up for automatic premium content access.

Just $15/year* will save you hours, maybe days!

Alternatively, the vpsBible forum is free and you are welcome.

Install Compilers

We’ll need a handy toolkit of binary builders to help install Spawn-FCGI.


Please sign up for automatic premium content access.

Just $15/year* will save you hours, maybe days!

Alternatively, the vpsBible forum is free and you are welcome.

Don’t be tempted to uninstall that afterwards .. we use it again in this vpsBible series.

How to Compile Spawn-FCGI

Paste this:-


Please sign up for automatic premium content access.

Just $15/year* will save you hours, maybe days!

Alternatively, the vpsBible forum is free and you are welcome.

Create the Spawn-FCGI Binary

From the above created compilation, we’ll copy the core:-


Please sign up for automatic premium content access.

Just $15/year* will save you hours, maybe days!

Alternatively, the vpsBible forum is free and you are welcome.

And we’ll ally the application with Nginx (to talk to PHP) opening a file:-


Please sign up for automatic premium content access.

Just $15/year* will save you hours, maybe days!

Alternatively, the vpsBible forum is free and you are welcome.

.. and pasting within:-


Please sign up for automatic premium content access.

Just $15/year* will save you hours, maybe days!

Alternatively, the vpsBible forum is free and you are welcome.

Make Spawn-FCGI Start on Request/Reboot

Create a new file with our initiation scripts:-


Please sign up for automatic premium content access.

Just $15/year* will save you hours, maybe days!

Alternatively, the vpsBible forum is free and you are welcome.

And paste:-


Please sign up for automatic premium content access.

Just $15/year* will save you hours, maybe days!

Alternatively, the vpsBible forum is free and you are welcome.

Modify permissions to enable the script and setup startup hooks:-


Please sign up for automatic premium content access.

Just $15/year* will save you hours, maybe days!

Alternatively, the vpsBible forum is free and you are welcome.

Start Spawn-FCGI’s processes:-


Please sign up for automatic premium content access.

Just $15/year* will save you hours, maybe days!

Alternatively, the vpsBible forum is free and you are welcome.

Rescind Super-User Permissions

Abandon root access:-


Please sign up for automatic premium content access.

Just $15/year* will save you hours, maybe days!

Alternatively, the vpsBible forum is free and you are welcome.

Er, thassit.

Setup Unmanaged VPS: The Ubuntu-Nginx Guide

Take your virtual private server from zero to hero

with this easy-to-follow copy/paste guide.

“My local PC runs Windows” Show me for Linux/Mac

22+ parts with video, here’s the index ..

Manage Unmanaged VPS: Ubuntu-Nginx Administration

Already set it up? We’d best maintain it then.

Toggle to the ..  Ubuntu-Nginx Admin Index

Manage Unmanaged VPS: Ubuntu-Nginx Administration

Maintain your virtual private server with ..

.. cheatsheets, tutorials, tips & guides.

Head back to the ..  Ubuntu-Nginx Installation Index

Nginx Admin: In the Works ..

This lot’s marked for addition already:-

  • Setup or Edit DNS using Bind
  • Network Tools Troubleshooting Guide
  • The Comprehensive Permissions Guide
  • Configuring Nginx Rewrites
  • Custom Website Error Page
  • Setting up Cron Jobs
  • Rsync for Incremental Remote-to-Local Backup
  • Cron & Rsync for Automatic Backup
  • Cron & mysqldump for Auto DB Backup
  • Safeguard Bandwidth with Hotlink Protection
  • Block Access with Nginx’ IP Deny



Got a Question? Want to Comment?

This site has no comments system. We've got a better system!

Please use the link at the top of the post and goto this topic's forum thread:-

  • to help build community
  • for a superior knowledge base
  • to keep info in one place, not diluted between forum & comments.

For those posts ported from Guvnr.com (pre-Feb/2010), archive comments remain.

Handy info from these comments is in the process of being ported to the forum and attributed to the original author.

If you think this idea sucks, let me know.

Thank you.