PHP Warning: strtotime(): It is not safe to rely on the system's timezone settings.

If a default timezone is not set in your php.ini, then you get the following warning:

"Warning: strtotime(): It is not safe to rely on the system's timezone settings. Please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/Denver' for 'CDT/-6.0/DST'"

To get rid of this warning, open you php.ini file and set a value for date.timezone

Sphinx search

Sphinx Search Sphinx is a free standalone full-text search engine. It is fast, efficient, and easily integrates with SQL databases and programming major programming languages. It is ideal for use with MySQL, PostgreSQL, PHP, Python, Perl and Ruby. Although Sphinx works well with Java but Lucene is better option for Java.

Following is a summary of features (copied from

Linux symbolic links

A symbolic link is a link which points to another file. In Microsoft windows, this is referred to as a shortcut and in Macintosh, an alias. To create a symbolic link:

$ ln -s source_file symbolic_link
$ ln -s readme.txt pointer-to-readme.txt

Now if you do:

$ cat readme.txt
$ cat pointer-to-readme.txt

Both commands would print the contents of the same file, readme.txt.

Converting string to date in PHP

Converting strings to dates in PHP requires the use of two functions. strtotime function converts the string to an epoch timestamp. date function converts the timestamp to the desirable date format.

   $string = "Nov 11, 2011";
   $timestamp = strtotime($string);
   $date = date("Y-m-d", $timestamp);
   print $timestamp . "<br>" . $date;


Installing mahara on Ubuntu

You can now install Mahara using the Synaptic Package Manager. But before you install mahara, you should create a database for mahara in MySQL or PostgreSQL. You will be asked for the database connectivity information during installation.

$ sudo apt-get install mahara

Once installation is complete, go to the mahara installation directory

$ cd /usr/share/mahara

and backup the config file

How can I change the filesize limit for imported files in PhpMyAdmin

The filesize limit is not defined in PhpMyAdmin. The limit is taken from php.ini file. To change this limit, you needed to edit your php.ini file:

$ locate php.ini
$ cd /etc/php5/apache2/
$ sudo cp php.ini php.ini.original  
$ sudo vi php.ini

Change the following two variables in the php.ini file:

upload_max_filesize = 50M
post_max_size = 200M

This would allow file uploads of 50 megabytes. You need to restart apache before these changes can take place. On Ubuntu, the command is