Not too long ago, it seemed like there was a pretty clear distinction between client-side technologies and server-side technologies. Languages like PHP, Perl and Python resided on the server, taking care of tasks like database connectivity, transaction management and remote procedure calls, while tools like JavaScript, CSS and HTML were used exclusively on the client to render pages, perform whizzy effects and respond to user events.
Things aren’t that clear any longer. Projects like Jaxer and Phobos are blurring these distinctions, by making it possible to run JavaScript on the server and use it for tasks ranging from server-side file access to input validation. And in this article, I’m going to show you how to add a JavaScript engine to your PHP build, with a little help from PECL’s SpiderMonkey extension. Keep reading!

