Jan 30 2009

How to profile your PHP scripts with Xdebug

Performance is a big issue on the web, if you pages take too long to load then people will go elsewhere. Sometimes your problems can be solved with cache control on your server, but still some cases require optimisation of your code. For this task, you should be using a technique known as ‘profiling’ – essentially a debug log of what your script or program did during execution, which functions were called and how long it took. It gives you a great glimpse into what it is that is taking too long to execute which means you have something concrete to look at when you need to optimise your system.

Fortunately Read the rest of this entry »

Geoff Adams
Programmer, Research and Development

Jan 29 2009

Creating Mobile Websites

mobile-web-development

Gone are the days when a separate version of a web site was required to see a web-site. Many 3G Phones, such as the iPhone and Android compatible phones  support rendering of web pages in their full glory (except for Flash on the iPhone). While this creates the richness that one expects when you are surfing at home on your laptop or desktop computer. It can still be difficult to navigate around a large web pages. If you really want to make your website usable on a mobile phone it might be a better idea to go for a mobile version of a website.  Domains are available for mobile websites and  it is a good idea to buy the .mobi domain for your mobile website to host your mobile version of your website to show you are really serious about providing mobile content.

Read the rest of this entry »

Sir Pumpkin Longshanks
Programmer, Research and Development

Jan 14 2009

Finding the Path to Root with PHP

linux-sign1

Occasionally, it is necessary to know the absolute path when preparing  a configuration file. Such as when editing the configuration file of an applications such as OSCommerce or installing Joomla. It can be very frustrating when the program won’t work because you don’t know the absolute path. Just opening your FTP editor and looking at the directory structure is not going to work. So how can you find the path? PHP has several commands which will reveal this to you. The function getcwd (get current working directory) will store the value:

<?php
  echo getcwd();
?>

Another way to acheive the same thing is with:

<?php
  echo realpath(dirname(__FILE__));
?>

Simply copy in one or the other programs into a blank file call it ’show_path.php’ and upload it to your web directory. Go to the page in your browser at the absolute path will be returned. Simple.

Sir Pumpkin Longshanks
Programmer, Research and Development

Jan 14 2009

Free Applications For Web Developers

Every time I sit down at a new computer I find myself installing and using the same applications over and over again. Due to the fact that I use a lot of open source software many of these applications are free.  I have seen lots of other lists regarding free software out there, so I thought I would add in my thoughts on the subject and produce a list of free software that web developers would use. Read the rest of this entry »

Philip Norton
Lead Developer, Research and Development