Moodle LMS – Operation is not valid due to the current state of the object – PHP Manager

If you upgrade your Moodle LMS on Windows and receive the following error when registering the PHP version under the PHP Manager,  delete the mapping to your current version of PHP and then go back and register the PHP version.

PHP Handler

 

Re-register the PHP Version, this will recreate the mappings (handler)

php handler manager

 

Achieving 100000 hits in Moodle Performance

In order to stress test our Moodle installation on IIS7.5 with PHP 5.5.6 we used the following -

Installed Moodle, PHP, Wincache and MySQL with Microsoft web installer.  This produced the production machine.

  • added the wincache.dll to the ext folder (Downloaded the new Wincache 1.3.5 found on SourceForge)

phpwincachedll

  • Added the following to PHP.ini

The Session Save Handler puts information into Memory and saves sessions to the moodledata folder sessions folder

phpinisessionhandler

The PHP_Wincache section calls the wincache.dll and uses an optimal amount of cache for performance

phpwincacheini

  • Downloaded PHP 5.56 from here and registered new PHP with IIS7.5 PHP Manager

phpmanager

  • Added Wincache stores to Moodle (from here)
    This is a plugin to enable MUC access to the WinCache PHP extension available on Windows platforms.  This caches Application Stores and enhances performance.

Configuration after installing the Wincache Store 

Site Administration – Plugins – Caching Configuration

Wincache Store

Moodle Session Handling

Site Administration – Server – Session handling – Disable database for session information.

moodle session handling

Testing the Cache store performance on 100,000 uniques requests per operation (See the after Moodle Data move below)

100000

Hardware

FX-6100 3.3Ghz CPU (Six Core) (info)
2 Western Digital 2 TB Hard Disk (info)
8 GB of Ram DDR3
Windows Server 2008 R2 (Processor Scheduling – Background and Virtual Memory – System Managed to second Hard Disk)

Hardware

Note: Since this write up, we have moved the MoodleData to a third hard disk and cloned the Windows Hard Disk to a solid state

The Tennessee College of Applied Technology – Shelbyville (Tennessee Technology Center at Shelbyville at the time) won Computerworld’s Laureate and Techtarget’s SearchCIO-Midmarket 2012 Customer Experience/Integration awards awards for their LMS system (supplemental to classroom work and hands-on).

Stats from Moodle

Moodle Stats

 

After the data was moved to a new drive

100000 After Moving Data

 

Results of Data Move (Before and After)

After Move

Speeding up Moodle LMS on Windows IIS 7.5

Speeding up Moodle LMS on Windows IIS 7.5

By default, Moodle uses its database to store information about sessions.  One of the ways you can speed up any PHP session on a Windows IIS server is to download wincache.  Wincache or Windows Cache Extension is designed to work with the PHP extension and speed up webservers.  Download the latest from SourceForge.

 

With Moodle, download the Wincache plugin to further optimize the Moodle file store.  Download the plugin here.

cache admin

Be sure to also download Wincache Info to see graphs and statistics.  Download the 2nd plugin here.

wincache

Because Moodle uses the SQL database to store information sessions, disabling this will significantly speed up the LMS.  In order to disable database sessions,  go to Site administration,  Server,  Session handling, and uncheck the option, Use database for session information.

session

Prior to doing this, check MySQL’s max allowed packet information is set to at least 4M in the my.cnf or my.ini.

 

 

 

 

Cannot find data record in database table course_modules.

The error that you may see if you are currently using Moodle may be seen after cron runs or when heavy access occurs.  The error,

!!! Can not find data record in database table course_modules. !!!

The error is related to heavy transactions and what we believe is caching corrupting the database.

To fix the error, you can run this query:

select modinfo from mdl_course where id = PutYourCourseIDHere;

Below, we use MySQL Workbench to run the query on a course id of 2

mysql workbench

Query

 

 

There is also a Moodle plugin that rebuilds all of the site’s cache.

https://moodle.org/plugins/pluginversion.php?id=2400

Unable to fetch available updates data – unexpected cURL error

When working with PHP and Moodle’s LMS, sometimes you have to dig for answers.  The error “Unable to fetch available updates data – unexpected cURL error” actually has a fix that is easy to implement.   Finding the solution was a challenge.

Moodle 2.4 updates using SSL and now you should place a certificate in the Moodledata folder.  Dawn was on this two weeks ago but the documentation was missing something.  (She can find anything on the web!)  Following up on what she had found, I found the solution here:

https://moodle.org/forum/discuss.php?d=218800

Here’s the answer:

“It needs the ca-bundle.crt available at http://curl.haxx.se/ca/cacert.pem – Just copy the contents into a text file and rename it to moodleorgca.crt and place this in the root of the moodledata directory.”   This is a comment found here MDL-36903 on Moodle.org.

cURL CA Certs (referenced in the link above)

MySQL problem writing to database during cron backup

If you receive the error “!!!Error Writing To Database!!!” during a cron backup, this can be related to

Find the my.ini file which is normally located in the MySql folder under program files
(C:\Program Files\MySQL\MySQL Server 5.1).  Edit it by adding or modifying the line -

Max_Allowed_Packet = 100M   (adjust as necessary)

MaxAllowedPacket

Add detailed statistics to Moodle with Piwik

If you have Moodle running on a server with PHP with IIS, you can add detailed statistics with Piwik.  While Moodle Statistics are detailed and is capable of giving analytics.  Piwik can be used on any website to obtain statistical information.

On IIS, go to Piwik and download their latest release.  Extract the file and copy it to your root folder of c:\inetpub\wwwroot.   Set permissions to full control with the security table on the extracted folder. For Network and IUSR accounts.

If you are using Microsoft’s SQL, you will need to download MySQL by using the Microsoft Web App Installer.   Because you have Moodle up and running, select to install MySQL only.  (You should have extracted Piwik and PHP is already running on the server).  Follow the installer’s wizard.

Once installed create a table called Piwik with MySQL.  At the MySQL command line (found in your program files) type:

CREATE DATABASE Piwik

Remove the ; in front of   extension=php_mysqli.dll on the php.ini file.  Save the php.ini file.  You will need to start and stop IIS.

Follow the installation instructions – http://piwik.org/docs/installation/

Open up the index.php file under your Moodle installation on your webserver.  Navigate to the login folder.  Open the index.php file to edit it add the following code at the top of your code (this will make javascript run with php).

<html>
<body>    Add the code your installation tells you after the body tag (following the installation instructions you will see the code the programmer tells you to put in your website) – This can be done for any of the pages.

Sample below

Piwik gives you very detailed analytics.

Piwik is a downloadable, open source (GPL licensed) real time web analytics software program. It provides you with detailed reports on your website visitors: the search engines and keywords they used, the language they speak, your popular pages… and so much more.

Piwik aims to be an open source alternative to Google Analytics, and is already used on more than 200,000 websites.



Here’s a copy of our previous post on Moodle Stats not working -
Need Statistics to show in Moodle ?

We normally try to put freeware and solutions for all users; however this seems to be a problem with Higher Education that use Moodle.

FIRST – In the Date section in your php.ini file – find the line ;date.timezone =, remove the semi-colon from the front of it and set it to the timezone that you have set in Administration > Locations (In the Moodle Administration Settings).  (Mine is America/Chicago). The line in your ini file should look like this date.timezone =’American/Chicago’ .  Save the php.ini and the locations set in Moodle under the Server’s time.  Restart IIS or Apache.

Go to – Modules | Blocks | Statistics   Enter at least 90 days on the graph – Save your settings

Go to – Server | Statistics | Disable Statistics in Moodle |Enter Maximum Processing – All  | Enter Maximum Runtime – Until Complete  | Enter Days to process 365 | Enter a Run Time 5-20 minutes before your current time on your computer (try to do this when at a Time when the server is not in use or has low usage – I am doing this at 12:40 a.m. – the stat time is at 12:30 a.m.)  Go down and Save your Changes!  Yes, It is disabled at this point.

On the SQL Server run the following query -

delete from mdl_stats_daily;
delete from mdl_stats_weekly;

delete from mdl_stats_monthly;
delete from mdl_config where name like ‘%stats%’;

Open up Moodle and now Enable Statistics and SAVE

Run cron from the command line – (Windows users, at the command prompt type -
c:\php\php.exe -f C:\inetpub\wwwroot\admin\cron.php

This should have worked…good luck!

No Graph in Stats? 
Go to Server | System Paths and make sure you specify GD is installed.  You must also take away the ; in front of  extension=php_gd2.dll in your php.ini file.  If you modify your php.ini, you must restart your webserver.

Critical bug found in latest PHP release, users advised against updating

PHP users are advised against upgrading to the latest (5.3.7) release of the scripting language because a critical flaw has been spotted only a day before its release.  Critical bug found in latest PHP release, users advised against updating.

Becoming a nurse

If you have ever thought about becoming an LPN or CNA, you’ll find that you have to take an exam prior to starting class.  In today’s busy world prospective students may not have time to attend classes to prepare for this entrance exam.

Because this is a technology blog, and the buzz words of today are asynchronous training and cloud computing; here’s how we overcame the technical challenges of delivering class online while saving money.

The Tennessee Technology Center at Shelbyville will be offering the Allied Health (LPN, CNA, PCT/Medical Assistant) Test preparation as an online course through the TTC Shelbyville Learning Management System this fall.  Using technology to deliver the course online, the course will include sections on Numerical Skills/Pre-Algebra Placement Test and Reading.

The Allied Health LMS allows the student to access the course anywhere at any time.   There are two sections of the  test that students are tested on: Pre-Algebra and Reading. The minimum required score for acceptance into the registration process (Exam) may vary, depending on the school to which students are applying and the class into which the students want to enroll. Included with the course are 24 videos delivered by Kate Jacobs, Technology Foundations Teacher.   The videos have been optimized for delivery on any computer including mobile tablets and smartphones.    In addition to the videos, the course includes 78 detailed handouts along with eight practice exams. So how did we overcome the challenges?

Already being overwhelmed by the amount of work we can sometimes have, the IT department implemented the Moodle Learning Management system which is rated as one of the best free LMS systems available.   The cost of the server (we build our own) was only 20% of purchasing a server from a vendor.   The handouts were converted as PDFs and over 10 hours of instruction was recorded and converted to play on iPads, Android and computers.   The videos were compressed and optimized so that minimum bandwidth is used and can be delivered to low speed internet connections.

Adding users to Moodle is easy and fast.  Registration and classes can ‘clean’ up automatically and with logging, students can be monitored with state of the art communication providing ‘on the go’ students with the best possible experience.   Instructors can monitor student logins and progress so delivery quality can be monitored.

Opensource and freeware used -

Any Video Converter (free or inexpensive)

Stats Not Working on Moodle?

Need Statistics to show in Moodle ?

We normally try to put freeware and solutions for all users; however this seems to be a problem with Higher Education that use Moodle.

FIRST – In the Date section in your php.ini file – find the line ;date.timezone =, remove the semi-colon from the front of it and set it to the timezone that you have set in Administration > Locations (In the Moodle Administration Settings).  (Mine is America/Chicago). The line in your ini file should look like this date.timezone =’American/Chicago’ .  Save the php.ini and the locations set in Moodle under the Server’s time.  Restart IIS or Apache.

Go to – Modules | Blocks | Statistics   Enter at least 90 days on the graph – Save your settings

Go to – Server | Statistics | Disable Statistics in Moodle |Enter Maximum Processing – All  | Enter Maximum Runtime – Until Complete  | Enter Days to process 365 | Enter a Run Time 5-20 minutes before your current time on your computer (try to do this when at a Time when the server is not in use or has low usage – I am doing this at 12:40 a.m. – the stat time is at 12:30 a.m.)  Go down and Save your Changes!  Yes, It is disabled at this point.

On the SQL Server run the following query -

delete from mdl_stats_daily;

delete from mdl_stats_weekly;

delete from mdl_stats_monthly;
delete from mdl_config where name like ‘%stats%';

Open up Moodle and now Enable Statistics and SAVE

Run cron from the command line – (Windows users, at the command prompt type -
c:\php\php.exe -f C:\inetpub\wwwroot\admin\cron.php

This should have worked…good luck!

No Graph in Stats?
Go to Server | System Paths and make sure you specify GD is installed.  You must also take away the ; in front of  extension=php_gd2.dll in your php.ini file.  If you modify your php.ini, you must restart your webserver.



Nida E-Learning added to IM Class

Butch Arnold, Industrial Maintenance instructor at TTC Shelbyville has recently networked a dozen or more PLCs, installed RSLinx and Rockwell software to further implement tools students can use in the classroom.   After his installation of Motoman Robots and Green Training  (Wind Turbines and solar power), his recent addition includes Nida’s E-Learning Suite that allows students to use our Moodle Learning Management System to login and use and access their lessons 24/7 (Nida software is SCORM compliant).

For more information on Nida visit their website

.   x   

Motoman Demo

RSLinx by Rockwell Automation

Allow programming of multiple Rockwell Automation Software, the picture below from Rockwell Automation shows how this RSLinx, RSLogix 5000 and other hardware can be used.

The combination of all of this software and hardware makes this one of the most technical industrial maintenance classes in the state.