Skip to content

Author: dsamojlenko

PHP Caddy v1.3.4

I just pushed out a new version of PHP Caddy today with a bugfix that should make it a lot more stable.

I have been using PHP Caddy as my primary development environment on my PC at work for the last month or so.  At first it was wonderful – stable, fast, easy, as advertised.  But as I got into the swing of using it, I started running into issues with the PHP FastCGI (php-cgi.exe) process crashing and causing 502 Bad Gateway errors – occasionally at first, but more frequently over time until it was barely usable.  I have no idea what causes it to crash, and I have exhausted my google-fu trying to find a cause or solution, until now.

When I first started building PHP Caddy, I had PHP 7.0 installed, and that’s what I’ve been running since.  This week, as the crash frequency was reaching unbearable levels, I decided to try upgrading to PHP 7.1.  Initially, this didn’t make much difference – the crashing continued.  However, in my continuing search for a solution to the problem, I found a reference somewhere that said that PHP 7.1 had added support for running multiple processes on Windows.  This rang a bell, so I looked into it.

Success!  Setting the environment variable PHP_FCGI_CHILDREN=2 before starting up the PHP FastCGI process, tells php-cgi.exe to spawn multiple processes (3 total), and fixed the stability issues completely.  I have now been running PHP Caddy continuously for the past two days without crashing.

If you are using PHP Caddy and have been experiencing occasional 502 Bad Gateway errors, try upgrading to PHP 7.1 and be sure to run composer global update.

Introducing PHP Caddy

Here’s something I have been working on recently:

PHP Caddy is a tiny PHP development environment for Windows, inspired by Laravel Valet.

No hosts file, no configuration, no frills. Just run it and go write some code.

Why?
In a world where Homestead and Valet exist, this is a good question.  A couple things:

1) Due to the corporate nature of my current job, I work on a PC during the day, so Valet (MacOS only) is not available to me.  At home I get to play with Valet, and it makes daytime me very jealous.

2) While as a developer I have slightly higher privileges on my PC than the average bear, I still do not have full administrator privileges and can’t install everything I want, so some of the Valet for Windows alternatives that provide all the dns niceities of Valet are not available to me.

3) Sometimes a virtualized environment like Homestead is a bit (sometimes a lot) slow on Windows.

So, I built this thing.  I like it a lot.  It runs very fast for me, and makes developing in PHP on Windows a bit more enjoyable.  Maybe you’ll like it too.

Shanghai 2014

Shanghai 2014

Pudong skyline at night.

Shanghai 2014

Pudong skyline by day.

Shanghai 2014

Zhujiajiao water town

Shanghai 2014

Me and my translator Lily on a gondola in Zhujiajiao water town.  Her glasses had no lenses.  I think that’s a thing in Shanghai.  weird.

Zhujiajiao water town

It was very smoggy…

Shanghai 2014

Jade Buddha Temple

Last day, last chance for delicious noodles and dumplings!

Goodbye sweet girl…

Dexy guarding my shoes

I guess 18 years was just enough. She made it all the way through her birthday month, but unfortunately we had to say goodbye to our dear sweet Dexy tonight. She’s been my best friend and constant companion for more than 17 years. From the moment she appeared at my grocery store as a runaway with boundless energy and that great big smile, she has held my heart. She saw me through lots of rough times and she brought me endless amounts of joy. She was a part of our family and we will all miss her dearly. Goodnight my sweet girl.

Leave it in the Ground, pt 3

oilerrific

Extracting tar sands oil is no easy feat.  One method involves injecting super-heated steam under high pressure deep into the ground to liquefy the hardened tar so it can be extracted.  Only sometimes this results in a blowout and the toxic bitumen starts oozing out in unexpected places – like beaver ponds and lakes and forests.  And the best part is,

“This is a new kind of oil spill and there is no ‘off button,’ ” said Keith Stewart, an energy analyst with Greenpeace who teaches a course on energy policy and environment at the University of Toronto. “You can’t cap it like a conventional oil well or turn off a valve on a pipeline.

“You are pressurizing the oil bed so hard that it’s no wonder that it blows out. This means that the oil will continue to leak until the well is no longer pressurized,” which means the bitumen could be seeping from the ground for months.

And would you believe that the media and photographers are being kept away from these blowout sites and that government scientists are afraid to speak out about them?

No one knows how to stop these tar-sands oil spills | Grist.
‘Nobody understands’ spills at Alberta oil sands operation | Toronto Star.

A little too much water in his beer

nicolas_cage_26822

Ethan Hawke did Ask Me Anything on Reddit and had this to say about Nic Cage:

I’m kind of obsessed with Nic Cage. I just found out about /r/onetruegod too. He’s the only actor since Marlon Brando that’s actually done anything new with the art of acting; he’s successfully taken us away from an obsession with naturalism into a kind of presentation style of acting that I imagine was popular with the old troubadours. If I could erase his bottom half bad movies, and only keep his top half movies, he would blow everyone else out of the water. He’s put a little too much water in his beer, but he is still one of the great actors of our time.

I’m a huge fan of Nic Cage, despite all the terrible stuff he’s done.  When he’s at his best, he’s better than anyone.  Birdy, Raising Arizona, Vampire’s Kiss, Wild at Heart, Leaving Las Vegas… all have special places in my cinematic heart.

I got addicted to his films in college and spent countless hours hunting down and watching all of his films.  Most of my friends at the time were lukewarm to him at best, and my fascination with his work was largely a solo endeavour.

I remember reading a story about how and why he changed his name from Coppola to Cage so that he could build his own reputation outside the shadow of his uncle.  Apparently he got the name Cage from a comic book hero, Luke Cage of Power Man and Iron Fist fame.

As a kid I collected Power Man and Iron Fist and I was the only one I knew who did – I spent years collecting a comic that as far as I knew nobody else read – I have never in 30 years since I started collecting met a single person who even knows the series or the heroes, let alone a fan.  I still have all those books, and today my set is about 15 issues from being truly complete (every appearance of either character in any series).  There is nothing else in my life that I’ve enjoyed so much for so long and so obsessively as that collection, and I’d always felt so alone in my devotion to it.

When these two worlds collided my brain just about melted!  Ever since then I’ve felt this little connection to Nic (see, in my mind we’re on abbreviated-first-name-basis), and no matter how many terrible movies he does, there will always be that top half of his movies that made me a fan in the beginning, and I will always think of him as that one other fan of Power Man and Iron Fist out there in the world!