Skip to content

Author: dsamojlenko

Brew MySQL: Can’t read dir of ‘/usr/local/etc/my.cnf.d’

Tonight after my first reboot in a long time, MySQL suddenly stopped working – I couldn’t connect from Sequel Pro, and when I tried to fire up the cli, I got the error below:

mysql: Can't read dir of '/usr/local/etc/my.cnf.d' (Errcode: 2 - No such file or directory)
mysql: [ERROR] Fatal error in defaults handling. Program aborted!

I don’t know if this is a common issue, but figured I’d write up the solution here.  I’m not sure why the directory no longer exists, or why MySQL worked without it before, but I just ran mkdir /usr/local/etc/my.cnf.d and everything was back to normal.

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.