August 2008 Archives

Movable Type is a large application with a lot of files. In a CGI context that application is loaded into memory every single time, and there is no ability to leverage a cache across a session or multiple requests.

When using FastCGI, the application is loaded into memory so that it doesn't have to be reparsed and interpreted every single request. This dramatically increases performance.

Unfortuantly some scripts of Movable Type are not compatible with FastCGI. A few of those scripts are i.e. mt-check.cgi or mt-xmlrpc.cgi (which is needed for XmlRPC transactions with your blog).

How to get the FastCGI-incompatible files up and running

In the end the solution is quite easy. You just need to tell Apache to not run some of Movable Type's scripts through FastCGI, but through classic CGI.

In your Apache configuration you need to activate add the following lines to the directives handling the Movable Type direcory:

That's all you need to do - Movable Type will run flawlessly.

What if you don't have direct access to your Apache configuration?

To ease up things you can also just create a template for a .htaccess file. It may also be much easier to use and maintainable this way. Just make sure you don't rebuild it each time you rebuild your site.

Eclipse PDT 2.0 release postponed

| | Comments (4) | TrackBacks (0)

As expected by many, Eclipse PDT's next major release has been postponed.

While two milestones couldn't be released, it became clearer and clearer that the release date of September 15th 2008 couldn't be met.

On December 29th 2008 Eclipse PDT 2.0 will hit the street

There is one milestone and two release candidates planed, before the final version is being expected to be released on December 29th 2008.

Personally I don't mind the delay, as PDT 2.0 will include many improvements to the current version:

  • PHP Model Infrastructure
  • Mark Occurrences
  • Type Hierarchy View
  • Override Method Annotation
  • New PHP Explorer capabilities
  • Extended Open Type
  • Code Templates
  • Code Assist for Dynamic Variables

One of the other reasons I see for delaying PDT 2.0 (hey - they bumbed the planned 1.1 release to 2.0) is a huge internal API change, also introduced because of the switch to Eclipse DLTK (Dynamic Languages Toolkit - a tool for vendors, researchers, and end-users who rely on dynamic languages).

Well, at least chances might be good they will include (at least a basic) Phar support.

As PHP 5.3 is marching towards the final release, Eclipse PDT's next version needs to support its new features. Two major additions to PHP 5.3 are namespaces and bundling the Phar extension. Especially used in combination, libraries could/should be distributed like Jars in the Java world.

The Phar extension provides a way to put entire PHP libraries or applications into a single file called a "Phar" (PHP Archive) for easy distribution and installation. Phar archives are best characterized as a convenient way to group several files into a single file. As such, a Phar archive provides a way to distribute a complete PHP library or application in a single file and run it from that file without the need to extract it to disk. Additionally, Phar archives can be executed by PHP as easily as any other file, both on the command line and from a web server. Phar is kind of like a thumb drive for PHP applications.

PHP 5.3 and Eclipse PDT 2.0 will soon hit the street

With Eclipse PDT 2.0 to be released in September (or October) support for namespaces is already on the roadmap. Support for Phar archives has not been listed, yet. But in my opinion Eclipse PDT 2.0 must support handling Phar archives when PHP 5.3 will hit the street.

Playing around with PHP 5.3 HEAD and Eclipse PDT 2.0 HEAD I've discovered several drawbacks of the yet missing support for Phar archives - here are the most important ones:

  • You cannot browse Phar archives.
  • Because of the disability of Eclipse PDT 2.0 of browsing Phar archives you cannot see in the outline which classes are inside of the Phar archive.
  • You cannot debug Phar archives. (Eclipse won't open a Phar archive.) (Using Xdebug or Zend Debugger does not change the situation.)

Debugging Phar archives using Xdebug is still an issue with the current stable release (Xdebug won't return enough information to browse the Phar archive), but Derick is already working on solving that issue. I didn't try the Zend Debugger - I don't even know if it runs with PHP 5.3.

Requirements for the Phar support are still to be defined

So opened an feature request at the Bugzilla issue tracker of Eclipse PDT. Roy Ganor, the team leader of the Zend Development Tools Group, responded quite fast and said, that the development team of Eclipse PDT already talked about the support of Phar archives but couldn't decide on requirements.

He asked me to help out and define proposals for requirements in a PDF file or the Eclipse PDT wiki.

Before providing proposals for requirements of the support of Phar archives for the next version of Eclipse PDT on my own, I wanted to ask the PHP community (especially those using Eclipse PDT / Zend Studio for Eclipse), what kind of Phar support they would like to see in Eclipse PDT 2.0.

Please do not hesitate on responding /commenting on this article, as there's not much time left before Eclipse PDT 2.0 shall hit the streets - and I wouldn't like to miss Phar support in this great IDE.

phpUnderControl is a customization of CruiseControl.

For those wanting to run CruiseControl behind an Apache webserver without configuring mod_jk or the like, this short how-to is just right.

Installing phpUnderControl / CruiseControl

This article is not about installing phpUnderControl or CruiseControl. For refernces see http://www.phpundercontrol.org/ or http://cruisecontrol.sourceforge.net/.

Configuring Apache as a proxy

So we are considering you have your phpUnderControl / CruiseControl instance up and running at http://localhost:8080/. We are also considering you have an instance of the Apache webserver up and running.

First we'll need to enable the proxy module of Apache. Consult the apache manual on how to enable the module in your instance of the Apache webserver. Now edit your Apache vHost or httpd.conf configuration.

You need to make sure that mod_proxy.so and mod_proxy_http.so do point to the right location on your harddisk.

Fixing URLs

Proxying already works with this configuration, but unfortunately clicking any link in your installation of phpUnderControl / CruiseControl would point to the direct installation of the instance. This is where mod_jk would come into play. But as we're just wanting a quick and easy resolution for runnning phpUnderControl / CruiseControl behind the Apache webserver, we'll be solving this issue quite easily:

Make sure to enable the ext_filter module. Now edit your Apache vHost or httpd.conf configuration again:

Conclusion

Just restart your Apache webserver and your instance of phpUnderControl / CruiseControl should be running perfectly well behind your Apache webserver.

Zend Studio for Eclipse is a commercial edition of Eclipse plus the PDT plugin and various other additions. Unfortunately Zend decided to disable the Xdebug support of the Eclipse PDT plugin. Nonetheless if you'd like to use Xdebug for debugging your PHP scripts, follow these simple steps to restore the Xdebug functionality of Eclipse.

How to enable Xdebug support

First you need to quit Zend Studio for Eclipse if it is still running.

  • Got to your Eclipse folder, for this article for instance /usr/local/ZendStudio:
    cd /usr/local/ZendStudio.
  • Enter the plugins folder (i.e. /usr/local/ZendStudio/plugins):
    cd plugins.
  • inside the plugins folder create a new folder named disabled (i.e. /usr/local/ZendStudio/plugins/disabled):
    mkdir disabled.
  • Now move all files starting with com.zend.php.debug into the disabled folder:
    mv com.zend.php.debug* disabled.
  • Go back to your main Zend Studio for Eclipse folder and start it via:
    ./ZendStudio -clean.
  • Xdebug is available in the main preferences dialog under PHP Debugging.

If you're working on Windows or Mac OS X, the procedure is likewise - you just need to remember the differences on the command line.

Conclusion

In order to get Xdebug working you now need to setup your computer like it is required for Eclipse PDT. Your can find the manual at http://www.eclipse.org/pdt/documents/XDebugGuide.pdf.

The only drawback is that profiling via the Zend Debugger doesn't work anymore in Zend Studio. But for this I would suggest to use Xdebug and KCacheGrind.

I will be speaking at IPC 2008

| | Comments (0) | TrackBacks (3)

ipc_2008.png

Aside from being a member of the advisory board of this years International PHP Conference, I will present one Full Day Workshop and one session at this year's edition of the International PHP Conference:

Quality Assurance in PHP Projects - In-Depth Best-Practises

Full Day Workshop

So you know PHPUnit, Selenium, phpUnderControl or CruiseControl and other tools to support testing efforts during your development process. But how does the puzzle of all those tools actually fit in your development process? During this Power Workshop Max Horvath and Wojciech Duda of studiVZ Ltd. will tell you about the everyday life at the Quality Assurance Business Unit. You will learn about best practices, which actually work and fit into an extremely fast moving iteration cycle at one of the biggest and fastest growing Social Networks in Europe. Talking about PHPUnit and Selenium, including tips on how to optimize using those tools, we will also show show you how you should integrate the testing process into your main development process, to be as lightweight and efficient as possible.

I will present this session together with my colleague Wojciech Duda.

Making Selenium Test Writing easier using a DSL

60 minutes Session

Implementing automated tests by using Seleniums API methods has several drawbacks. Selenium is great for what it does, providing a generic framework for testing a generic application. Using the Testing_SeleniumDSL framework, I will show you how to create your own Domain Specific Language (DSL), which would allow you to write tests in the language of your business rather than in Seleniums language.

I hope to see you in Mainz, Germany in late October!

Zend Studio for Eclipse is a commercial edition of Eclipse plus the PDT plugin and various other additions. Unfortunately Zend decided to disable the Ant plugin in it's distribution of the Eclipse platform. Nonetheless if you'd like to run Ant scripts or simple Phing scripts it would be really useful to be able to use the Ant integration of Eclipse.

Preparation

First you need to make sure that the Eclipse Java Development Tools are available in Zend Studio for Eclipse.

  • From the Help menu click Software Updates > Manage Configuration.
  • Check for the entry Eclipse Java Development Tools.

If the entry is not listed or disabled, you need to install the Eclipse feature.

  • From the Help menu click Software Updates > Find and Install.
  • Click Search for new features to install.
  • Check Europa Discovery Site and click Next.
  • Select Java Development Tools and click Finish to install the feature.
  • Restart Zend Studio for Eclipse.

How to enable the Ant integration

Now it gets a little tricky.

  • From the File menu click New > Project.
  • Check Show All Wizards.
  • In the Wizards text field enter Ant, select Java Project from Existing Ant Buildfile and click Next.
  • You will be asked to enable Ant Development - confirm with Yes.
  • Now you can cancel the new Java Project - Ant has been activated.

ant_integration_step1.jpg ant_integration_step2.jpg ant_integration_step3.jpg

Recent Activity

Tuesday

  • I tweeted, "Just published a new blog post:Problems when upgrading to Ubuntu 8.10 - Kernel panic - Unable to mount root fs http://tinyurl.com/5fbb6j"
  • I tweeted, "Dear american voters - don't be silly to vote for McCain ... thanks!"
  • I tweeted, "@janl Just ping me, I've Hot leads ..."

More ...

Conferences

Conferences I presented at:

Programming Blogs - BlogCatalog Blog Directory
Creative Commons License
This weblog is licensed under a Creative Commons License. blogoscoop

About this Archive

This page is an archive of entries from August 2008 listed from newest to oldest.

March 2008 is the previous archive.

September 2008 is the next archive.

Find recent content on the main index or look in the archives to find all content.