Wednesday, 17 June 2009

Trying to install NGinX, PHP-fcgi and spawn-fcgi

Today I was trying to install NGinX, PHP-fcgi and spawn-fcgi on my hosting with webfaction. I spent most of the morning looking at different tutorials on installing Nginx with PHP. Patching PHP with PHP-FPM seemed to be the recommended option as opposed to running PHP through spawn-fcgi, though lots of tutorials did cover installing PHP with spawn-fcgi.

In the end I decided to go with spawn-fcgi as php-fpm hasn't been updated since December 2008.

After lunch I went on Animal Crossing as usual.

I spent most of the afternoon waiting for PHP to make and make test. make test isn't necessary, but as I was using a beta version of PHP (3.0RC3) I thought I might as well do it in case it was helpful to the developers. Having said that, I might not have done make test if I'd known quite how long it would take. While I was waiting I went on the pinternet and read the dpreview D5000 review and part of the Olympus EP-1 preview.

After dinner I watched an episode of Fishing with John, which was pretty funny. Then I carried on setting up Nginx, PHP-fcgi and spawn-fcgi. I had it working with static files okay, but when I tried to view a PHP page I got
Warning: Unknown: Filename cannot be empty in Unknown on line 0

Fatal error: Unknown: Failed opening required '' (include_path='.:/home/path/to/php/lib') in Unknown on line 0


Quite a cryptic error. I spent the rest of the evening trying to work out how to fix this - lots of googling, changing nginx.conf and fastcgi_params, and restarting nginx. Eventually I did get it working. I had copied the fastcgi_params from the Nginx Wiki FastCGI Example, but the line
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
needed to be changed to
fastcgi_param SCRIPT_FILENAME /path/to/website/document/root$fastcgi_script_name;
(In other words I needed to hardcode the document root into the SCRIPT_FILENAME fastcgi_param).

I found this out by copying the fastcgi_params provided at: nginx on FreeBSD with PHP, fastcgi, Drupal, MySQL. I'm not sure whether commenting out
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
as directed by the Nginx wiki article also breaks it, but PHP seems to be working at the moment including that that line (so not commenting it out or deleting it).

I also bid on a lot of 5 saturn games that included Panzer Dragoon Saga on ebay, but got outbid. It ended up going for something like £67 + £8 P&P. Quite a good deal since a PAL copy of Panzer Dragoon Saga sold recently for about £140. The same seller also had another lot of 6 games, which sold for about £80 + P&P. I guess that had a rare game in it as well (Burning Rangers maybe?)

The weather today was overcast all day and rained quite a bit. However, just before sunset the sun started shining, probably resulting in a great sunset, but I couldn't see it too well from here.

Food
Breakfast: Bowl of choco hoops; cup o' tea.
Lunch: Slice of Roma (I think) style ham with iceberg lettuce and sliced cherry tomatoes sandwich; nectarine; slice of home-made lemon sponge cake; orange Trophy; cup o' tea.
Afternoon snack: Slice of Fabulous bakin' boys raspberry flapjack; cup o' tea.
Dinner: Egg Pasta; bacon sauce stuff; ground black pepper. Pudding was strawberry flan. Coffee.

No comments: