"New" PHP-FPM instructions now posted

August 6th, 2009 No comments

I just posted some quick steps on how to get started messing around with the new PHP-FPM.

First, go signup to join the project at the Launchpad Project Page!

Remember this is not production ready quite yet. But download the code, test it out, and contribute. The steps are on the main page to get you started. It would be great if we could get it fixed up so it will work against 5.2.10 or 5.3.0 (and is smart enough to use the same ./configure script to determine it)

We can use many types of contributions, namely:

  • Developers - anyone who is familiar with C and PHP/FastCGI. We've got a list of desired features and such. Help us make them all happen!
  • Monetary contributions - keep the servers up, fund special requests, etc.
  • Documentation scrutiny - as the project changes, the documentation will need to reflect it. We'll try our best, but that's the great thing about using a wiki - update it as needed!
  • Translations - the wiki has translations currently, and the project itself -may- at some point require some translations. Possibly leveraging Launchpad's translation interface (which ties in to gettext hooks in the code)
Categories: PHP-FPM

PHP 5.3.0 patch now considered stable

July 31st, 2009 2 comments

After a few weeks of people running it in production without any issues, I'm proud to say that PHP-FPM for PHP 5.3.0 can now drop it's "Release Candidate" title and is now in "production"

Download PHP-FPM: http://php-fpm.org/download/

Remember, PHP 5.3.x has a lot of differences than PHP 5.2.x - be sure to read the Changelog, migration guide, etc. located here: http://php.net/releases/5_3_0.php - watch out for a lot of E_DEPRECATED messages ๐Ÿ™‚

However, I am excited about the performance improvements, mysqlnd, php.ini syntax stuff, support for htscanner like .htaccess file override capabilities and more.

In the future, PHP-FPM will no longer be a patch (at least, it shouldn't be) - there is now a new project on Launchpad that Andrei helped start that is a standalone PHP-FPM. It still requires PHP sources to compile it (for now) but it will allow the project to move at a quicker pace and not be bundled directly into PHP. Join the project and see how you can contribute today! https://launchpad.net/php-fpm/

Categories: PHP-FPM

"Tonight's project" ... just a couple weeks late

June 24th, 2009 2 comments

I'm finally getting around to posting all the pictures of this. It actually turned out pretty good, even though I was too impatient to wait to order some more fitting parts from online. Oddly enough, I could find almost all the parts locally besides these tiny little brackets that were basically holders to create a patch panel out of already plumbed out keystones.

After having my network completely reset itself a couple times, sometimes randomly, sometimes during a storm, sometimes during something normal spiking the electrical in the house like a washer or vacuum being turned on, I decided something needed to be done. The "home connectivity center" that was installed by the company I had wire my house up was a generic piece of crap that had a cover that was almost impossible to line up and put back in its place properly.

I was thinking I would get a connectivity box with a door. Nope.

Anyway, my thoughts were to find a UPS and get the central D-Link 5 port gigabit switch on it, something with voltage regulation hopefully, but at least something that should provide uninterrupted power should the power spike up or down. Simple, right? Not so much.

The box did not provide enough room, I would have had to special order some funky UPS from online, and I still wasn't guaranteed it was the best solution. It would radiate some heat and the box already made me a bit nervous heat-wise.

After talking to my old boss he got me thinking again about putting the UPS somewhere else. I realized I had the perfect place to put it - the access panel to my jetted tub right below the box (I figured that's where they ran the power from to power the box anyway...)

Anyway, here's the box before (a little messy, I did have the FiOS router strapped in too, just didn't take pics first)

With the smallest UPS I could find, which actually might have worked but definately would have been a heat worry...

I called around to look for a different box, that may be deeper or at least had an easier cover to put on. Sadly, I could only find one. It did not match up with mine either. Mine was 20" tall, the standard height seems to be 28" for a medium size one. So I decided I would rip mine out and replace it, and actually cut out 8 inches of my wall (what the hell was I thinking?)

I went and picked up the "home connection center" at Home Depot, and decided to get to work. What annoyed me is they only sold two other accessories for this unit, one of them was $50 just for a couple internal attachments. No thanks. I'll figure that out later.

Now the old one is ripped out of the wall:

What the bottom looked like after I cleaned it up a little:

Oh yeah - this is what I was given. They plumbed it out for me nicely, so I just needed to find a little patch panel type thing - should be easy enough (so I thought...)

Skip forward after sawing out my wall (I did a hell of a good job for the tools I had available to me, I think!)

Now, time to lay out the internal components. They've got some bracket accessories, but of course nobody had any at 12am at night, not to mention it didn't look good that any place would have it in stock locally to begin with.

Cleaned up a little bit more:

Finally, this will be about as good as I can get it. You'll note that I used zip ties - those were fun to fish around behind the panel (I'm joking) and the left side has a normal wall plate with 6 keystone spaces. I rigged it in to one of the only brackets any company had in town.

You'll see in the middle picture at the bottom the power cables. I bought an extension cable and split it myself to power my own power outlet that was wired directly to the UPS underneath the box, so the entire power outlet could be considered UPS'ed. The power cable on the rightmost is actually the original power cable - I was able to retain that. So it winds up being

Original power cable -> UPS -> New power outlets -> Router and Switch

When I looked in the little diagram I realized that there was an optional door that could be added. Instantly I got even more excited about the outcome of this project. I was finally going to have a box with a door. I was actually happy with the original hinged cover it came with, it was much easier to use than the old panel. That one was a piece of garbage.

Anyway, the final product, with the door...

Oh, and of course, the UPS that is underneath all of this:

I propped it up on some of the original foam packaging to keep it off the dusty/dirty/possibly wet ground (some day) - seems to have worked out quite well. I did clean up the cords a bit more too though.

Now all I need is to clean up the paint job. They had painted with the access door to the tub on, so when I went to remove it, it ripped off dried paint. That was a nice surprise. Also, there's some marks on the walls from random stuff and a sharpee mark from where the old box lined up. But when it's all sealed you can't really see any of that.

All in all, I'm kinda happy. Being such an Internet geek, I have very little patience for any manual labor, so to complete a project and for it to come together so well with a mish-mash of parts and tools was neat. I got the majority of work done the first night, but wound up bleeding in to the second day when I was trying to track down the other spare parts. Couldn't find the patch panel-ish thing (they do make one, but I would have had to wait 2-3 days at least) - so I just crafted some thing on that left side that works just as well.

It's functional, clean, has more space than it did before, has a door and now is fully UPS-ized. All in all, it was a good experience.

Categories: Toys

How to easily keep your Ubuntu packages in sync

June 19th, 2009 1 comment

Thanks to Monty, I've learned something that will save me a lot of headache in the future. I had a bunch of random scripts I wrote myself to try to keep things in sync, turns out most of the work is already all done for me.

On the source host you want to clone:

dpkg --get-selections > file

On the destination host:

dpkg --set-selections < file
apt-get dselect-upgrade

Now your machines should be identical, package-wise.

Categories: Software

WordPress on Drizzle - beaten to the punch

June 17th, 2009 No comments

Looks like Jeff Waugh actually beat me to it.

Haven't seen the code... but he's done it and sounds like he's done a somewhat thorough job.

Sadly I learned this from Brian's presentation on Drizzle at OS Bridge. Doh.

Categories: Drizzle, WordPress

Apple charging us for apps... more than once?

June 1st, 2009 No comments

This is the kind of bullshit I expect from AT&T for using their network.

Not from Apple.

Apple: seriously? Come on. You've got a phone that can't stay on the shelves. You're making money from apps already. Paying to re-download? Everyone has taken this app store idea and implemented their own... and now Apple has to change their winning formula?

I mean, how much overhead can there be? The apps don't need to be re-moderated. The only cost is a little bit of bandwidth on their servers. Most likely negligible...

EDIT: the original article is gone, a replacement article has been linked, and now it looks like it was only a limited audience.

Categories: Consumerism

Don't forget the $args!

May 15th, 2009 11 comments

August 2010 UPDATE: Read here for new information!

I just realized when trying to use the try_files shortcut that either the behavior has changed or the code I've used it for has never had to take advantage of it, but what happens when you do something like this:

try_files $uri $uri/ /foo/index.php?u=$uri;

Is that the query string is stripped out and the only thing PHP sees is the $_GET['u']

to fix this, it's easy enough:

try_files $uri $uri/ /foo/index.php?u=$uri&$args;

I never noticed this behavior in WordPress (I've been using try_files with it for a while without noticable issue) but it was an issue with Drupal (which uses the Front-Controller Pattern just like WP does) and custom code we've written.

UPDATE: depending on what custom WordPress plugins you may be using that rely on the $_GET params, you should add this. This should be the final recipe from what I can tell. ๐Ÿ™‚

I haven't asked Igor if the behavior has changed slightly with it, but the changelogs have not mentioned any behavior changes, from what I can tell.

Anyway if you notice your pagination or other GET params are being dropped, you might want to take a quick look at that ๐Ÿ™‚

Categories: nginx, WordPress

Porting WordPress to Drizzle - will I succeed?

May 14th, 2009 1 comment

Since I can't write C to save my life, I'm attempting to help out in other ways. This has been in the form of donating machine time, helping with the wiki, blog and being a general smartass on #drizzle.

However, where I can provide some help is trying to showcase and see how apps may need to change to work with Drizzle as opposed to MySQL.

I will admit, this may go nowhere as I am consistently swamped with work and a busy social life, but it might be something fun to mess around with to get used to working with Drizzle and possibly come up with something to give back to the community.

I don't expect a huge amount of changes. I think some column types might need to change and definately the DB class (I will be using the native drizzle-php-ext module, even though I believe the mysql/mysqli/etc. modules may work transparently already) - so we shall see.

So wish me luck!

Categories: Drizzle

I love this frickin' toolkit

May 9th, 2009 No comments

I have to give original props to Kevin for first letting me borrow it a couple times. He got it a long time ago but it appears Best Buy is still selling it.

It's Dynex, which is their "cheap house brand" - but it's still great. Its saved my hyde now a couple times. If it was a person, it would actually go under my "Respect Knuckles" category. I am almost tempted to do it anyway... But I digress!

From helping me dismantle a bunch of annoying hex screws on HD enclosures to helping me fish out what was almost a screw in an almost impossible place, this kit so far has been great. Price isn't too bad either, and of course, every geek needs something like this.

Price: $29.99
SKU: 7263061

Dynexยฎ - Computer Tool Kit

There's probably hundreds out there, but this has a nice clean case, easily portable and so far has had a tool for everything I need.

Categories: Toys

Finally using nginx's "try_files" directive

March 19th, 2009 20 comments

OLD:

error_page 404 = /wordpress/index.php?q=$request_uri;

or:

if (!-e $request_filename) {
   rewrite ^/(.*) /wordpress/index.php?uri=$request_uri last;
}

NEW:

try_files $uri $uri/ /wordpress/index.php?q=$uri&$args;

Why make life more complicated if you don't need to?

Also thanks to Igor's patch you can have multiple of these, i.e.:

location /wordpress {
   try_files $uri $uri/ /wordpress/index.php?q=$uri&$args;
}

location /anotherapp {
   try_files $uri $uri/ /anotherapp/controllerfile.php?q=$uri&$args;
}

etc.

This is good, as Drupal, WordPress and many other packages (including anything I develop anymore) use the Front Controller pattern of development, which makes deploying applications a lot simpler and helps support a consistent framework across the entire application.

NOTE: Updated on 1/5/10 to include the $args ๐Ÿ™‚

Categories: nginx, WordPress