A New PHP Development Environment

We’ve been threatening to overhaul our entire PHP development environment for some time, but it has always been something we have managed to put off for as long as possible.  With Dreamweaver lagging further and further behind our requirements and the projects that we are dealing with at work getting more complex we have finally managed to take the plunge and get started on this.

I’ve found that locating really basic information on this has been surprisingly difficult, so have decided to blow the dust off my old blog and put down some notes on what we’re up to.  Hopeful someone else out there might find it useful, or better still offer some tips on how we can improve it further. Read on for more details.

Read more »

PHP IDEs - PHPed

Ho hum.  I had this morning set aside to get stuck in to my look at PHP IDEs and I have to say that it hasn’t been the greatest success so far.

I roped in Tim at work to help me do some of the comparison and we spend a couple of hours trawling the IDE websites trying to compare features.  At the end of that process the main thing we had learned was that the feature sets were pretty comparable across all the IDEs we were taking a look at (Komodo, eclipse, PHPed, PHPedit, & Zen).  It seems that the only way we are going to narrow the list down was by installing each in turn and taking a closer look.

We’ve pretty much ruled out eclipse at the moment.  It seems that neither of the two forks (phpeclipse and eclipse PDT) are going to be what we are looking for.  PHPeclipse sounds like it is developing slowly, barely keeping up with new software versions, and PDT doesn’t seem polished enough at this time). 

We decided to grab two of the others to look at.  Tim is taking a look at PHPedit and I PHPed.

Read more »

PHP IDEs

One of the motivating factors of blowing the dust off my old blog is that I’m about to start investigating some possible changes to the way we develop websites at work.  This is going to involve looking at quite a few solutions and I thought it might be interesting to get some thoughts on these up on the web as I go through the process. Read more »

Session IDs in Google

Just spotted that a lot of pages of this site have ended up confined to the supplemental results of Google, effectively being dropped from the main results.
This is an annoying feature of Google in particular in that it does really know how to deal properly with sessions (a way of storing information, such as login status, when you are on a site). Basically every time Googlebot visited it was seeing a different URL and thus assuming that there were hundreds of similar pages on the site.
As a quick fix I have simply added the following to my .htaccess file:
php_value session.use_trans_sid 0
php_value session.use_only_cookies 1

This forces PHP to use cookies to store the session and removes session support where cookies are not enabled. Not really the best solution, but on that will do for now at least. A better approach would be to do something like this on the pages instead:

$spiders = array(”Googlebot”,”WebCrawler, “etc etc”);
$from_spider = FALSE;
foreach($spiders as $Val)
{
if (eregi($Val, $_SERVER["HTTP_USER_AGENT"]))
{
$from_spider=TRUE;
break;
}
}

// Session
if(!$from_spider)
session_start();

This would then only start the session if the user_agent was not a recognised search engine spider. This is effectively cloaking (usually seriously frowned upon), but is one of the few legitimate uses for it.

The second solution is what I would use on a commercial site, but search engine results are not as important for this one so I have just gone for the quick fix.

Talkback

I’ve added a couple of extra features to the site today. The most obvious is “talkback” - a way of letting people add their comments to any item or photo posted on the site.

The other is automatic referrer information. At the moment this is just limited to listing the top referrers to the site and the most recent referrers to the site, but it will also soon do the same on an item by item basis.

I look forward to reading a few comments from you soon.