Blog Archives

Enable Mod Rewrite in WAMP on Windows

As I have to keep looking this up periodically, I’m making notes for this here. The most straightforward write-up I’ve seen on this of late can be found here. How to enable mod rewrite in WAMP Click on the WAMP

Posted in Php

How to install LAMP Stack on Ubuntu

There’s a great walkthrough on how to set up Linux, Apache, MySQL and PHP on Ubuntu here. But for brevity’s sake here’s a shortened version Install Apache sudo apt-get update sudo apt-get install apache2 Install MySQL sudo apt-get install mysql-server

Posted in Php, Ubuntu and Unix

Virtualbox – Goodbye XAMPP Hello Virtual Lamp Stack

I recently found myself working on a Windows 8 machine and needed to set up a local development environment for Worpdress. Previously I would have installed something like XAMPP and gone through the usual windows installation dtramas. A good friend

Posted in Php, Ubuntu and Unix, Virtualization

Dates in php part 2 – saving dates to mysql

Came across a problem today where I needed to save value from a jQuery datepicker in dd-mm-yy format to a mysql database date column. Solution: $expiry = new DateTime($expiry); $expiry = date_format ( $expiry, ‘Y-m-d’ ); Then to display it

Posted in Php

Dates in php part 1

Let’s say you’re querying a MySql Database and it has a datetime field called ‘datecreated’ – you will actually end up with an error if you try to apply date_format to the output. e.g.  Let’s say we have a record

Posted in Php