Random writings on running, software & product development, business and anything else

Category: Technology (Page 3 of 12)

Technology, software development, FOSS (Free and Open Source Software) and the web. From languages like PHP to specific tools, books and anything else.

WordPress Custom Post Types

WordPress is best known as a blogging engine, but new features in recent releases and the ability of plugins to add functionality have made WordPress a viable CMS (Content Management System) for sites.

WordPress 3.0 added ‘custom post types’ which allows a developer to define new types of content in addition to the 5 inbuilt types. No longer will posts or pages need to be twisted into shape by use of custom fields or lots of PHP coding. Don’t let the name ‘custom post types’ have you believe the new content is just an extension to WordPress posts. The more correct title is ‘custom content types’.

Continue reading

PHP News #5

PHP news to August 6th, 2010.

  • New PHP drivers for for SQL Server released, under an Apache 2.0 license.
  • Zend framework 1.10.7 released. Bug fixes including an update for Zend_Service_Twitter, as Twitter moves to OAuth.
  • PHPNW conference on October 9 & 10, 2010 in Manchester, UK.
  • New PHP Excel extension from Ilia Alshanetsky.
  • Call for proposals at OSDC (Open Source Developers Conference) 2010 to be held in Melbourne, Australia from November 24th to 26th, 2010.

Moving web servers and hosts file

For whatever reason there may come a time when you need to change web hosts for a site. Its not a good look for the world see a broken site due to differences between the old and new. So how do you test everything is set up correctly at the new host before updating nameservers?
When you type a site into the browser location bar, a DNS lookup goes on and the typed in domain name is resolved to an IP address and a known location. the requested site is returned to you. So how do you test a domain that is to be hosted at a new location? In the scenario where you do not have a dedicated IP address, the answer is the hosts file on your local PC.
Your local hosts file is checked before any DNS lookup, so adding a domain and the new IP will cause your browser to go to the new location not the old.
So what does a hosts file look like? In the case of Windows XP, something like below, ignoring the comment lines which start with a #. In this case localhost will resolve to the IP address of 127.0.1 which is your local machine.       localhost

Hosts files for other OS are much the same. Ubuntu has entries for the local machine name and IPv6 setup in its default hosts file. localhost mymachine.local mymachine

# The following lines are desirable for IPv6 capable hosts'
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts

Now if you wished to have www.mysite.com resolve to IP address you would add the following line into the hosts file. As simple as that. It’s always a good idea to back up the existing hosts file.     mysite.com

So where is your hosts file? Obviously this varies by operating system. The table below will cover the standard location for common operating systems.

OS Location
Win XP, Vista, 7 & 2003 (32 bit) C:WINDOWSsystem32driversetchosts
Windows 64 bit C:WINDOWSSysWOW64driversetchosts
Mac OS X /private/etc/hosts
Linux distributions /etc/hosts

These lookup entries are often cached, so you will need to either restart networking or even reboot your machine for the new IP address to be used.
Once you have finished your move & testing, and updated the real nameservers for your new location, its always best to remove these temporary lines from the hosts file. That way you find the site, the same way everybody else does, and you may find out early if there are any problems.

Twitter Attempt 2

I first heard about Twitter at Web Directions in September 2008. The idea sounded exciting, and many in the profession were hyped by it. However most of the people I knew outside of web development had never heard of Twitter, and many had not really heard of Facebook.

Continue reading

PHP News #3

PHP developer news for week ending July 23rd, 2010.

  • PHP 5.2.14 released. Bug & security release and the end of active support for the 5.2 line.
  • PHP 5.3.3 released. Over 100 fixes with a number of security enhancements.
  • CakePHP 1.3.3 rainbow icing edition released.
  • Phalanx PHP Framework. Event driven PHP5.3+ framework.


  • CodeIgniter Con 2010. August 14 & 15, Bristol UK.
  • Symfony day. October 8th, 2010 in Cologne, Germany.
  • indieconf. Conference for independent web professionals. November 13, Raleigh, North Carolina, USA.
« Older posts Newer posts »

© 2022 Ernie Leseberg

Theme by Anders NorenUp ↑