Showing posts with label class. Show all posts
Showing posts with label class. Show all posts

Wednesday, May 20, 2009

Install Moodle on CentOS 5

Following are steps to install Moodle 1.9 on CentOS 5.

Step 1
Install mysql-server-5.0.45, mysql-5.0.45 and php-5.1.6

Install other PHP library php-mbstring-5.1.6, php-xmlrpc-5.1.6

Step 2
Add the user name "user1" and database "mymoodle" to MySQL with the correct privilege.

Step 3
Download the moodle and extract to /var/www/html/moodle
Create and assign the permission of the webserver to the data directory at /var/www/moodledata

Step 4
In a start the moodle installation via web browser, use the location
http://localhost/moodle

Copy the script into a file named config.php within the root directory of Moodle.

Follow the rest of the instruction to complete.

Step 5
Install lynx to activate the cron. Edit the crontab to run every 30 minutes.

$ crontab -e
*/30 * * * * wget -q -O /dev/null http://localhost/moodle/admin/cron.php



See http://docs.moodle.org/en/Installing_Moodle
http://docs.moodle.org/en/Administration_FAQ

Saturday, January 3, 2009

Surviving an OSS migration in 2009

Over the past couple of years, numerous efforts have be undertaken to seek benefits of adopting open source software (OSS) from individuals, corporate to governments. There have been successful adoption and others who have had to rake out more cash to revert back to proprietary software. Based on such events, here are my predictions to survive an OSS migration in 2009.

  1. Lay out an OSS migration plan for all to see. This does not have to be in great detail but sufficient enough to know who will be affected.
  2. Keep information flowing on the progress of the implementation to management and those below. Don't you just want people to get involved? what is better than awareness!
  3. Recognise the OSS participation of individuals and groups. This means the management understands that their business secrets are protected as they know who is contributing what. Morale will increase as people strive to improve systems out of their own interest. Remind everyone of their targets, some may get too preoccupied in OSS and forget their business objectives.
  4. Be prepared to change how the business is carried out. This means knowing a different way of doing things to achieve equal or greater results.
  5. Maintain budget on ICT. Yes, OSS will reduce cost if proper expense on the migration is provided. You will see the savings! Get quotes for similiar systems and file them for comparison of the actual implementation. How elese would you know the exact savings?

OSS will be around for a long time. Proprietary systems will seek ways to leverage on OSS instead of fighting them. You will survive.

Thursday, January 10, 2008

PHP commands to connect with MySQL

PHP and MySQL class just end over a 3 day duration. The syllabus covers the basic PHP command structures. This included variable usage, loops, conditional, user defined functions, pre-defined functions and database connectivity. A quick way to learn connectivity with MySQL is to already be familiar with SQL and relational database.

What is there to know about the database? I have a checklist below for learners to use
  1. Database
    1. Creating
    2. Deleting
    3. Selecting/Using a database
  2. Field types and their use
    1. Numerical - int, float
    2. Strings - char, varchar, text
    3. Time - date, timestamp
  3. Tables
    1. Creating
    2. Deleting
    3. Altering tables
  4. Records
    1. Inserting records
    2. Deleting records
    3. Editing records
    4. Retrieving records

Once the SQL syntax is known, the next step is to use PHP to execute the SQL commands on the MySQL database server. Among the basic commands that can be use is listed below:

  1. mysql_connect( ) - Open connection to a MySQL database server
    1. Description: returns FALSE if fail
      resource mysql_connect ([ string $server [, string $username [, string $password [, bool $new_link [, int $client_flags ]]]]] )
  2. mysql_query( ) - Send SQL commands to MySQL database server
    1. Description: returns FALSE on error
      resource mysql_query ( string $query [, resource $link_identifier ] )
  3. mysql_select_db( ) - Determine which database name to use on the MySQL database server
    1. Description: returns TRUE or FALSE
      bool mysql_select_db ( string $database_name [, resource $link_identifier ] )
  4. mysql_fetch_array( ) - Retrieve a record as an array
    1. Description: returns FALSE if no more records
      array mysql_fetch_array ( resource $result [, int $result_type ] )
  5. mysql_close( ) - Close a MySQL database connection
    1. Description: returns TRUE of FALSE
      bool mysql_close ([ resource $link_identifier ] )

That is all for now. I will write more in coming postings on PHP use with MySQL.

Blog Archive