P'unk Avenue Window

We’re hiring a new developer

May 3rd, 2010 by Alex No Comments

Things are moving pretty fast lately on our corner of E. Passyunk and Federal. Apostrophe is rolling along at a full clip and we have all sorts of other exciting projects we’re in the midst of. Olivia Rabe recently joined the team to work closely with our clients on issues of content strategy and Apostrophe support. We’re even beginning to expand our studio space into the adjacent building.

If this sounds at all interesting to you, the best news is that you might be able to help us fill some of our new space: We’re looking to make another addition to the team so we can continue to build these amazing applications and still go home on time. Right now we are looking for a new developer, somebody who would assist in the creation of new Apostrophe features and collaborate on development of products for our clients.

If you think you might be the right fit, or know someone who is, read on after the cut.
Read the rest of this entry »

Faster, Windows PHP! Kill! Kill!

April 26th, 2010 by Tom 1 Comment

IN WHICH our hero is narrowly saved by vague memories of a really dull presentation by some guys in suits.

You may recall my recent post on speeding up PHP on Linux without changing your PHP code. Those techniques have become standard practice around here, and the article has since been retweeted, linked to, engraved on an unobtanium disc embedded in a space probe to be launched next week by the Malaysian space forces, et cetera. So it seems we have the Linux PHP thing down to a science, for now.

But not every shop runs Linux, and one of our clients has asked us to deploy in a Windows environment. We’ve deployed PHP sites for them before, but that was in the Symfony 1.0 days, and there just weren’t nearly as many class files to compile. When we set out to deploy a modern site built with Apostrophe, our content management system based on Symfony 1.4 and Doctrine, we were reminded that out-of-the-box PHP is slow, slow, slow.

I would gladly have addressed this the same way we do it on Linux: FastCGI, APC and Apache’s worker thread MPM. And in fact Apache for Windows seems to only support a special threaded MPM under Windows anyway, so that part is already familiar.

Unfortunately, the official PHP infrastructure for Windows has, frankly, undergone a bit of code rot lately:

The PHP binaries don’t seem to include a CGI/FastCGI binary! Shoot. Well, maybe APC alone will be enough. But APC is not standard with the Windows PHP binaries, so I need to get it from PECL. Okay, but the PECL for Windows site is “temporarily out of service.” A new solution is coming, but it’s not here yet.

Searches led me to Pierre Joye’s folder on downloads.php.net. Pierre is a core PHP developer, so I trust him, no problem there. But the version of APC found there just locks up Windows PHP, at least in my tests. I investigated alternative PHP bytecode caches and wound up with xcache. xcache worked for a while, then started spewing errors about classes being redefined, and always began doing so again within a few page views after each restart of Apache.

Yuck!

Fortunately, by this point a vague memory was stirring somewhere in my geeky cortex. I was in Paris… I was full of pain au chocolat… I was very sleepy… two guys in suits were droning on and on about something while the crowd ignored them… AHA! Those Microsoft guys at Symfony Live! They were talking about speeding up PHP on Windows. They even mentioned hiring Pierre Joye to help out. But they didn’t demonstrate anything on Symfony, so I wasn’t paying a lot of attention—

Just enough as it turns out. The deal is this: Microsoft knows that PHP has, historically, sucked on Windows. And they have taken steps. And this is good news for the rest of us.

PHP can now be installed via the Microsoft Web Platform installer. That gives you single-threaded PHP running via fastcgi— exactly like my Linux setup, except for the bytecode cache part. And now the new Windows Cache Extension for PHP delivers a bytecode cache, equivalent to APC.

The end result is definitely in the ballpark with the performance of my Linux solution. Since I haven’t tested them on the same hardware (both boxes were VMs, and they were provided by different datacenters), I cannot say for certain which was faster. The Microsoft speakers at Symfony Live characterized it as better but still not as fast as the best PHP setups on Apache. At any rate it’s a big improvement and well worth your time if you need to host on Windows.

So here’s a HOWTO for configuring Symfony and PHP on Windows with good performance:

To configure IIS for Symfony:

1. Make sure IIS is installed. I know, right?

We want IIS 7. IIS 7 features an excellent importer for mod_rewrite rules, and Symfony loves mod_rewrite rules.

2. Install PHP from the Microsoft Web Platform. Click that link from IE running on your server (hint: remote desktop connection) for the easiest download-and-install process.

3. Install Windows Cache for PHP to get acceptable speed from the above. I installed version 1.0 because 1.1 is in beta. The beta does look interesting because it has an alternate PHP session handler that uses shared memory. You’d have to configure symfony to actually use that feature I believe (welcome to factories.yml).

4. Let’s say your project’s short name (aka “Unix name”) is mysite. So copy your Symfony project to c:\mysite. (I’m assuming a virtual machine for a single client project. Choose a better folder structure if you’re deploying lots of sites on this box.) You can set up cygwin to allow ssh access and rsync those files with project:deploy, and in fact we do, but that’s a subject for another day. FTP also works.

5. Launch the IIS manager (Start -> Administrative Tools -> IIS Manager).

6. Open the server’s icon, then “Sites,” then delete the “default site” entry.

7. Add a new site entry called mysite. Map the site’s web folder to be the web subfolder of the Symfony project which you should have copied to c:\mysite by now. So the web folder path would be c:\mysite\web. Assign it to port 80. Do NOT set the web folder to be the root of your project! That is very dangerous as it exposes your databases.yml file. Point it to the web subfolder.

8. Always clear your Symfony cache after copying a site to a new server. At the command shell (start->run->cmd.exe), type:

cd \mysite
php symfony cc

10. PHP needs write access to c:\windows\temp to store session data in order for logon sessions to work. You should have no trouble here on a new setup with just IIS I suspect, but if you previously ran Apache you might need to clean up. Clobber any existing session files in c:\windows\temp. Note that this is also the folder where the PHP error log file is found:

c:\windows\temp\php-errors.log

You can watch that file using a Cygwin shell and the tail -f command, or peek at it as needed with a text editor.

9. Try the site out, with a frontend controller name in the URL. You’ll get the home page but subpages won’t work yet without manually putting the controller name back in the URL. In IE running on the server itself, visit:

http://localhost/index.php

10. We need to add the mod_rewrite rules that remove the need for `/index.php`. But IIS doesn’t have mod_rewrite. Fortunately IIS7 has its own URL rewriting feature… and it can import your rules.

In the IIS manager, double-click mysite, then double-click “URL Rewrite.” In the “Actions” area at right, click “Import Rules” under “Inbound Rules.”

Edit: if “Inbound Rules” is missing, close “URL Rewrite” and then open that feature again. Also try adding one empty rule manually first. The “incredible disappearing/reappearing ‘Inbound Rules’ feature” appears to be a bug in the IIS manager.

Paste the mod_rewrite rules from your web/.htaccess file. IIS will do a pretty snazzy job of converting them when you click Import (but if you have fancy rules that go beyond the usual Symfony rules, give the end results a careful look-see). Then click “Apply.”

Edit: IIS won’t tell you, but the settings you just created live in a file called web.config in the web subfolder of your project. You must not crush this file when you sync your project. Add the file to your project, or rsync exclude it if you’re using cygwin and project:deploy. Since you might want to add more rules to it manually I generally recommend the former. But one disadvantage of adding it to your project is that any edits you make in the GUI will get clobbered on future syncs if you don’t manually copy the resulting changes from web.config on the server back to your project.

11. Try the site again. You should be able to browse the entire site now.

12. Whoops, you can’t log in because IIS is hijacking the 401 Unauthorized error page. To fix that, go back to the IIS Manager pane for mysite. Double-click “Modules” and remove the “Custom Error” module.

Now your site’s login page will appear properly. Also your custom 404 and 500 error pages.

That’s it – you should be ready to go with much speedier Windows PHP.

Note that for the time being the Microsoft Web Platform seems to offer only PHP 5.2.13. This is a stable and sane choice and until recently I would have done it no differently. But PHP 5.3.2 is much better than 5.3.0 and 5.3.1 and offers new features that matter— improved memory management, faster performance and new PHP language features that the forthcoming Symfony 2.0 requires. Hopefully PHP 5.3.x will appear in the Web Platform installer soon.

(*) Yes, I sorted through the maze and found versions of PHP and APC that were supposedly for the same C runtime, et cetera. Still no love. xcache was better, but alas the redefined class errors put paid to that too.

Open Source Help Desk

April 14th, 2010 by Tom 1 Comment

TOM: “Open source help desk, this is Tom speaking. How may we help each other?”

CALLER: “I chose your open source project for my client project and it’s due tomorrow and it doesn’t work! This is your problem and you must fix it immediately or I will explode!”

TOM: [CLICK]


TOM: “Open source help desk, this is Tom speaking. How may we help each other?”

CALLER: “Your code has several bugs, which I am going to describe in harsh and unsympathetic but highly accurate detail.”

TOM: [Hangs up on caller, then fixes those bugs]


TOM: “Open source help desk, this is Tom speaking. How may we help each other?”

CALLER: “I translated your program into Swahili! Here’s the XLIFF file. Also I found a bug. Here’s a patch file.”

TOM: “Yay! Welcome to the cool people’s club! We’re having chocolate ice cream. Would you like some?”


TOM: “Open source help desk, this is Tom speaking. How may we help each other?”

CALLER: “500 ERROR! AAAAAAAAAAAAAA!”

TOM: “Lower your voice, read your log files, try the dev controller and call back.”

CALLER: [reads own log files, discovers glaringly obvious permissions problem, solves it, is never heard from again]


TOM: “Open source help desk, this is Tom speaking. How may we help each other?”

CALLER: “something isn’t quite right. When I do X, Y and Z, I get the following error message [copies and pastes complete error message].”

TOM: “reproducible bug reports make me deeply happy. I’ve just committed a fix in svn. Would you like some ice cream?”

Happy Birthday to Us!

April 1st, 2010 by Tom 5 Comments
P’unk Avenue is five years old today!

In honor of this momentous occasion, we’ve reshuffled our roles.

Effective immediately, I (Tom Boutell) am the lead designer.

As my first official act, I’ve changed our default font here on the window blog to the timeless and brilliant Comic Sans.

Rick has also changed jobs. Please welcome him as our lead developer. I’m informed that he plans to switch us all over to Visual BASIC .NET immediately. The goal is to recreate Drupal in Visual BASIC. In the meantime we’ll be porting our Apostrophe sites to Drupal as a transitional step.

Geoff is already happy in his role as chief compost engineer, and we aim to keep him that way. Jake will be making a lateral move from designer to chief executive, and Dan will be our business development lead. He plans to win new clients to our cause by explaining the Symfony embedded forms API to them, drowning them in source code until they surrender one by one.

Alex and John have announced plans to open a bakery producing exclusively apostrophe-shaped cookies.

Just kidding, dear friends. Would we do such terrible things to you?

Mix Tape

March 28th, 2010 by Geoff 1 Comment

IMG_2289

We will be expanding soon to create a project room for P’unk Ave (war room, for you violent types). The expansion space is in the row home next door to the studio (in fact, it was the original studio space of P’unk Avenue.)

In preparation, I have been going through some boxes that were stored there.

In one of the boxes, I found some mix tapes. Over the years, I have been paring them down. (Maybe 4 years ago, I put more than a hundred on the steps of the studio with a free sign and they disappeared within a couple of hours.) For some reason, I have had trouble deaccessioning the ones that were made for me or ones I made together with a good friend.

For instance, the one pictured above was made with my friend Steve. He brought over his records and CDs and together we made this mix. As many of you remember, mix tapes were made in real time so this process took a couple of hours, a few beers were consumed and many things were discussed. I don’t recall what we talked about, but I have such a warm memory of that evening.

It has been hard to imagine parting with this tape, since one glance at it and I feel that all is right with the world for an instant. Taking this picture has been cathartic, though. This tape is in the box destined for Goodwill this week.

Philly Symfony Users Group: ASSEMBLE!

March 25th, 2010 by Tom 3 Comments


Sure, geeks have grabbed Philly by the balls, but that doesn’t mean we can’t sharpen our… skills… where am I going with this?

Oh yeah: the Philly Symfony Users Group. We use the Symfony framework for PHP development all day long. It’s been the basis for every single client project we’ve done since… hell, before I came aboard two years ago. It’s the foundation on which Apostrophe is based. We cannot imagine suffering through web application development without it (or at least something on a similar plane of object-oriented, thoroughly modern, Model-View-Controller awesome, like Zend Framework).

But we haven’t met a lot of other Philly-based Symfony developers. And this is where you come in. We’d like to spread the word and help aspiring local Symfony developers get their boots on the ground. And if other experienced Symfony developers are out there reading this, we’d really, really like to get to know you better.

Announcing the Philly Symfony Users Group! Every second Thursday of the month at 6:30pm, you are cordially invited to our office at 1168 East Passyunk Avenue. We’ll start off with informal discussion (and beer), then someone will present on an aspect of Symfony development.

WHERE: 1168 E. Passyunk Ave
WHEN: 6:30pm, Thursday April 8th
WHAT: Symfony Users Group
PRESENTATION: “Getting Started with Symfony,” Tom Boutell

At this first meeting I’ll talk about the process of installing Symfony, PHP and Apache on your own computer, focusing primarily on what it’s like to build a simple Symfony 1.4 web application.

You don’t have to be an experienced Symfony developer to attend! We welcome all PHP developers and those who aspire to become PHP coders.

Apostrophe Speaks Your Language

March 24th, 2010 by Tom 2 Comments

Apostrophe en francais
We’ve just released version 1.0.9 of Apostrophe, our content management system. This is an exciting release because it includes French, German and Spanish user interfaces, as well as improved support for translating the actual content of your site into multiple languages.

If you visit our demo site and switch languages you’ll see pages with pretty translated chrome but no content. That, of course, is because our own demonstration web site’s content is currently only available in English. Feel free to play with translating it, but keep in mind that the demo site resets at the top of the hour. If you’re seriously interested in translating our demo site’s content to go along with the nicely translated interface, join the Apostrophe google group and drop us a line to get involved.

Interested in putting this power to work on your projects? Visit apostrophenow.com to find out how we can help you. If you’re a Symfony developer or just a ballsy webmaster who doesn’t mind learning some new tricks, head straight for the Apostrophe manual to check out our installation guide. We do documentation in a big way.

We’d like to thank Quentin Dugauthier (French), Frank Wenzl (German), and Pablo Godel (Spanish) for their hard volunteer work on the translations. Others are working hard on Portuguese and Greek and have been patient through our growing pains as we mastered the fine points of UTF-8 and character sets in our translation system. We’ll be sure to thank them by name when they are done, so you don’t nag them too much now. (:


There are, of course, other important fixes and improvements in Apostrophe 1.0.9, including one security fix. Here’s the list:

  • A computer abandoned by an admin who has logged out can no longer be used to edit slots the admin previously edited using cleverly constructed URLs (only an issue on the same computer and if the PHP session has not ended). Note that you must upgrade your myUser class in apps/frontend/lib to extend aSecurityUser rather than sfGuardSecurityUser to get this fix (aSecurityUser is a subclass of the latter)
  • Global or virtual-page media slots can be edited successfully on Symfony pages that are not CMS pages
  • Unpublished pages no longer interfere with aNavigationAccordion layout
  • Fixtures no longer use HTML tags our filters remove on edit
  • Plaintext slots now autolink URLs and email address (obfuscated) as described in the manual
  • Search engine updates refactored, search engine now updates when you save page settings
  • ‘tool’ option to rich text slots now correctly activates the FCK toolbar set name you specify
  • Slot save/cancel buttons now survive form validation passes properly (thanks to Spike)
  • Date widget is XHTML correct (thanks Spike)
  • Engines now work when the CMS is not mounted at the root of the site (important for those using the CMS as a subfolder of a site dominated by other Symfony modules)
  • Attempting to attach a list of zero items to a slideshow no longer results in adding all items in the media repository
  • Cross-browser and XHTML strictness fixes
  • Moved lib/base to lib/action (you must symfony cc)
  • Lost connections between existing media slots and media items when editing other media slots: fixed. Also, slideshows etc. are no longer removed on “cancel,” and selecting zero media items no longer selects all media items
  • i18n of over 99% of the admin interface (many thanks to Quentin, Galileo, Frank, Pablo and Fotis), new languages are regularly being added to the demo project’s apps/frontend/i18n folder
  • More convenient i18n of your site content (temporary titles supplied, all navigation controls work for pages whose titles are not yet translated)
  • Aesthetic upgrades
  • Superadmins can grant superadmin status
  • Some demo-specific styles moved from a.css to demo.css
  • Optional language selector in a/login partial
  • Global admin buttons now have separate names and labels (labels can be internationalized) and a documented way to add and reorder them in app.yml
  • Alpha channel is now preserved when rendering PNGs from a PNG original with gd (not available with netpbm)
  • Compact PDF slot style, without inline preview (you can override this in aMediaPDF/normalView if you want it back and you have ghostscript)
  • Better IE6 upgrade message
  • Various private methods now protected for easier app level overrides

Apostrophe has a Point of View

March 22nd, 2010 by Geoff 1 Comment

The Apostrophe Google Group has become pretty active lately. It has been so great to connect up with people around the world that are using Apostrophe to make sites for themselves or their clients. It feels great to be able to share something that we have labored long and hard on. It is especially exciting to know that we scratched our own itch and made something that works well for us and for our clients. It’s also exciting to see it helping with other peoples’ itches.

We love the passion that people have about Apostrophe. We have seen that in many forms including the suggestion of new features. What I want to make clear, though, is that Apostrophe does have a point of view embedded in all of the decisions that we make as we design and build it. If someone asks for a new feature, I always ask, “What problem are you trying to solve?” or “Can you describe a situation where the need for this feature came up?”

I think that surprises some people. They assume that our goal is to have the longest list of features of any web content management tool. In fact, that is not our goal. Our goal is to create a tool that is joyful to use while still being powerful.

The reason people fall in love with Apostrophe is because we have worked very hard to keep it simple and elegant. We are always going to ask the tough question of what problem does this solve. (Can it be solved with what is already built?)

We will never build a feature just because we wonder if it can be done. We are not in a feature race with anyone. We have found that sometimes people pick something based on a list of features, but our clients and users pick Apostrophe based on how they feel when they use it (think Tiffany’s, not Walmart). They feel empowered and excited. They have often mentioned the joyfulness of using Apostrophe. We have even heard people gasp and giggle when editing content for the first time.

All that said, we don’t want to be the solution for everyone, but we hope you enjoy using Apostrophe if it works for you.

________

Note: I just finished reading Rework by Jason Fried and David Heinemeier Hansson of 37 Signals, and it reminded me that I should be putting down more of our thoughts on Apostrophe. These decisions have been embedded in Apostrophe from the beginning, but we have not always been good about communicating them.

Apostrophe: the bipartisan CMS

March 22nd, 2010 by Johnny No Comments

Ok, so it’s Friday and we’re all psyched for the weekend:

ok ok, it’s Monday but you can’t let that stop the dance party!

Beware of Geeks Bearing Gifts

March 11th, 2010 by Tom No Comments

@odysseus is now mayor of Shiny Wooden Horse Disco Everybody Come Check It Out! on #foursquare!

@agamemnon just checked in from Shiny Wooden Horse Disco Everybody Come Check It Out! via gowalla

@cassandra IT’S A TRAP!

@priam @cassandra SHUT UP ADMIRAL AKBAR THIS HORSE IS AWESOME

@agamemnon is now mayor of Sacked Ruin of Troy BOOYEAH! on #foursquare!