Latest PHP on Ubuntu 12.10 lts


So if you want the latest version of PHP on your Ubuntu 12.10 machine you will have to a little more than apt-get install…

Essentially you will need to instruct Ubuntu to install from a non standard location (don’t worry it is safe).

This will also upgrade Apache to 2.4!

Step 1 Update your lists and install 2 new programs

Step 2 With the above two programs installed, add this guys ppa to your listing and then update once again

Step 3 Make a backup copy of all you Apache Conf files.

Step 4 Install the latest PHP


Step 5 Sort out you Apache conf files..

When you restart apache now you will likely get a few complaints.. conf files empty or none existent.. unfortunately this is a manual task of eliminating the complaint one at a time.

Using virtual hosts?
You are of course not there yet, Apache 2.4 conf file has new tweaks. If you moved your webroot away from the default you will have re-align this. The site-available config files all now require the extension “.conf”. Make sure all you previous settings, mod-rewrites… etc etc are still there (a spot the diff between your copied version and the new essentially).

Drag and drop sortable table rows with jQuery UI Sortable

This is a step up from the fix found here:

What I found was that radio buttons were dropping their value, the fix is as follows:




Without doubt the best out there at the moment is Flurry available for iOS and Android in an Appcellerator module:!overview
There is a free version for iOS, does the same job.

Compression tools, zip:
Making an app to be downloaded over the air but want a base db to be sent out with it? Yipping your sqlite db and unzipping saves a substantial amount of space.
This guy as a pretty good module, ’tis free and pretty solid but only for iOS:
I have tried this free one on iOS just the other day and it worked a treat, claims to be Android too:!overview

Ignore/ Block ping requests on Ubuntu server

Blocking ping requests can help secure you server a little more against those probing tw@s trying to cause criminal damage to your business. It is quite a simple procedure and goes as follows:

First log in as root:


To temporarily disable ping responses (untill server reboot):



To then re-enable (asside from rebooting) ping responses



To permanently block ping requests, ie for the change to be there are reboot:
Edit the following file with you most dearest of text editors, eg:

And add the following:


Create a Javascript console.log wrapper with full backtrace to origin of caller.

In this post we have a development flag dependant on the URL pattern:

Using the dev flag you can now write a wrapper for “console.log”. Using console.log in internet explorer can break your application, further more it doesn’t give that much information either.

In the same file in which we set the dev_mode to true or false declare a new function “log()”. “log(‘with some message’)” can then be called anywhere in you application. EG:


And will spit out the following in the console:

And here is the log function (the following has been tested in Firefox and Chrome only):

Defining a dev-mode in your javascript application

Defining a development and live mode in your web application. There will often be functions you use in development such as console.log or alert that you don’t want to appear in your non-dev site. It can be very tedious to manually go through each file commenting out the console logs and alerts.. also in commenting them out or removing them means you have to put them back in for when back in dev mode…

So, you need a flag to indicate if your application is in dev or non-dev mode. Declare this a the start of your application:

An exmaple use of this is illustrated HERE