Running Moodle in XAMPP

Running Moodle in XAMPP

by kullboys boys -
Number of replies: 14

Hello everyone

I want to run Moodle 3.4 in XAMPP, but I have tried installing a number of different versions of XAMPP but keep getting errors. Does anyone know which version of XAMPP will be compatible with Moode 3.4 , or failing that,  which 2 versions work well together ?

Thanks. 


Average of ratings: -
In reply to kullboys boys

Re: Running Moodle in XAMPP

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

I don't know. But a couple of things...

- It might help if you tell us what errors you are getting. It's possible that it's nothing to do with the version of xampp.

- Read the release notes for 3.4 (https://docs.moodle.org/dev/Moodle_3.4_release_notes). Does the version of xampp you are using meet the requirements. 

- If you are installing on Windows then there are bundled installers - https://download.moodle.org/windows/

- Remember, xampp is NOT suitable for live/production use. Only testing and evaluation. 

In reply to Howard Miller

Re: Running Moodle in XAMPP

by Colin Fraser -
Picture of Documentation writers Picture of Testers

Try this download, and take you pick of which version you want to run.  

XAMPP is useful if you have no idea what you are doing with regards to setting up a server, MySQL,PHP, Moodle and so on, It is good for doing newbie things in, no good for anything more than about twenty/twenty-five users.  Always keep a copy of your download file handy and make sure your database is regularly backed up. Keep all backups off the drive with the XAMPP installation on, best to install another drive, fresh, clean and new and use it only for XAMPP. When things start to go wrong, don't try to fix them, reformat your drive, Restore the database, restore the files, don't bother trying to "fix it", replace it, this will save you a lot of time and a great deal of angst and "nothing works, I wanna slash my wrists" depression.  

In reply to Colin Fraser

Re: Running Moodle in XAMPP

by Broto Santoso -

Hi Colin

I have installed the latest pre-built moodle-xampp. I ran Start Moodle and went to my browser then typed my local IP to continue installation process.

but when it reached the step https://myIP/user/editadvanced.php?id=2, I got problem like this pictures (attached) below


What I should do? I am grateful to hear your advice, thanks

Attachment error-httpd.png
In reply to Broto Santoso

Re: Running Moodle in XAMPP

by Colin Fraser -
Picture of Documentation writers Picture of Testers

Ho Broto. 

Why is it throwing a memory error? It shouldn't...mmmm interesting. First, reboot your computer, that should clear memory issues. When restarted, check the Xampp Control Panel, see if Xampp is actually loading at start up first. The Apache, MySQL at least should be showing green. If it isn't, click Start on whatever options you installed. When green, go to the config button for the server and open the httpd.conf file. Scroll down until you see a line that says something like: 

Define SRVROOT "C:/xampp/apache"

ServerRoot "C:/xampp/apache" 

Check that this is where the installation really is, it supposed to be here, not anywhere else. Xampp doesn't like it being somewhere else, loses itself too easily. Then look for the line: 

listen 80

Check to see if it is looking at the right port. Then scroll down some more and look for the line: 

ServerName localhost:80

If that is what it is reading then try addressing it as localhost/moodle/ in your browser. The 80 is the port number that Apache uses to listen for HTTP web based requests and localhost is the name given your Apache server. 

If you want to set it to the ip address of your local machine/server, then change the line to: 

listen 192.168.237.134:80 

This assumes that the above address is static, in which case you might want to address it as 192.168.237.254:80, it cannot be dynamically assigned by the router. Obviously, you will have to reset your machine's network settings and instruct the router to not assign this address. HowToGeek.com can help you there if you are not sure how to do this. You can, if you have access to VMWare or similar, set up a virtual machine of, say, 60GB, and install Xampp there, giving that VM a static IP. Do not put anything else on it, just the Xampp, the Moodle, the WordPress, the Mahara, or anything else using PHP and MySQL, and your own web pages, of course. 

Also, I have found that the Apache Friends distro of Xampp is a little more stable, but if you want to do anything fancy in Apache, like virtual servers, then you're going to have a problem if you don't edit the httpd.conf and other configuration files through the Xampp Control Panel. One tiny edit can bring the whole thing down.  

I have been required to reinstall is for another project I have to work on, but my recommendation is to avoid Xampp at any cost. Good luck.  


In reply to Colin Fraser

Re: Running Moodle in XAMPP

by Broto Santoso -

Dear Colin

Thanks for your answer but it still doesn't work. I decided to install manually, one by one.

But with this method, I can not use Clean or Boost Campus theme because they render so slowly and their appearance did not complete. They have "ugly" look


Thanks again

In reply to Broto Santoso

Re: Running Moodle in XAMPP

by Colin Fraser -
Picture of Documentation writers Picture of Testers

This is the harder option, for sure, but one that will be more satisfying and helpful. In the meantime, the Xampp uninstaller does not remove the MySQL files cleanly, so you need to get in there and make sure they have been taken out. If you don't then you will likely get an error when trying to re-install MySQL, or perhaps you might want to go with MariaDB instead. MariaDB is a fork of MySQL and seems to be both successful and popular at the moment. You might not get the problems with re-installing either.  

In reply to Broto Santoso

Re: Running Moodle in XAMPP

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers

I have run Moodle successfully on XAMPP for the PC.  What I did was to install XAMPP first, then I manually installed Moodle.

I most often will use MAMP on my Mac, but sometimes I experiment with XAMPP on a VMWare Windows 10 PC.  In my XAMPP/Moodle install, I am running Boost.  (Picture below.)  As you might see, my Moodle has Boost modified a little with some CSS.  Pretty?  Who knows?  Slow?  Nope.

(In my current install, I am running Moodle 3.4+, mariaDB, php 7.1.10, XAMPP 7.1.10.

So your posts make wonder how you are installing everything?

Attachment xampp and moodle.jpg
In reply to Rick Jerz

[FINALLY SOLVED] Re: Running Moodle in XAMPP

by Broto Santoso -

Finally, I successfully installed moodle 3.5.2+ with Clean Theme using XAMPP 7.1.7 in my Windows 7 (see attached images)

--------

Before this happened, I got a problem to activate clean theme in my moodle installation using XAMPP as a server, even though I installed moodle without problem with XAMPP using default Boost theme.

So, I have tried many version of XAMPP with appropriate moodle version. Meanwhile, I followed Colin's idea but it still didn't work.

Here it is what I have done:

  1. Uncompress XAMPP portable version (I have tried 7.2.9, 7.0.32, and 7.1.7)
  2. Install moodle (3.5.2, 3.4.5, 3.5.2+)
Thanks everyone for the inspirations
Attachment SS_moodle352withboosttheme_xampp_login.png
Attachment SS_moodle352withboosttheme_xampp_not.png
Attachment SS_moodle352withcleantheme_xampp_not.png
In reply to Broto Santoso

Re: [FINALLY SOLVED] Re: Running Moodle in XAMPP

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers

Great, Broto!  Now you can enjoy your sandbox.

Realize that it is pretty easy to install additional Moodles in XAMPP.  For example, I have one installation that contains my production Moodle system.  Then I have another for experimenting.  Sometimes I might even install a future release of Moodle, just to check it out.

In reply to Rick Jerz

Re: [FINALLY SOLVED] Re: Running Moodle in XAMPP

by Colin Fraser -
Picture of Documentation writers Picture of Testers

Well done Broto! Giving hope to others is always an excellent thing to do!!!! 

@Rick, yeah, I did the same thing, after installing the Moodle version, installing additional Moodles, test out new versions, but never stopped to think that I could have installed a non-bundled version of Xampp, then install Moodle. You obviously got it working properly. I admit I so detest Xampp that I have only put it back on its own VM because I had to, and then I can lose the VM any time. OK, maybe I can experiment a bit more with it... thanks for the tip..

In reply to Colin Fraser

Re: [FINALLY SOLVED] Re: Running Moodle in XAMPP

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers

Yep Colin, the key here is that there are a variety of ways for someone to have a "sandbox" where they can, and should, experiment with Moodles.

These "local" installs provide "sandbox" functionality at zero cost!  Whether one ends up with XAMPP, MAMP, WAMP, or even natively on a Mac, or in a Linux VM, the key is to get a sandbox running.

I have struggled with the php intl extension in some of these installs.  Right now, I have had success with XAMPP PC, and MAMP Mac.  Since I own a Mac, I spend most of my experimental time in MAMP.  My  MAMP closely mimics my production Moodle, except the MAMP is running MySQL and my production Moodle is running MariaDB (so far, 100% compatible.)  And I can quickly set MAMP to use php 5.6, which then allows me to run my older Moodle 1.9 and Moodle 2.9 old production Moodles.  

In reply to Howard Miller

Re: Running Moodle in XAMPP

by ben reynolds -

You definitely want to use one of the bundled installers. I'm running 3.5 off an external hard drive, which is slow, but it works.

If you are determined to use an internal drive, do not put the bundle in Program Files (x86) or Program Files. It wants to go to the root of the c: drive.

In reply to kullboys boys

Re: Running Moodle in XAMPP

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers

It's been about 4 or 5 months since I experimented with XAMPP.  However, I did have success running Moodle and XAMPP on my virtual Windows 10 PC.  I did not have success on my Mac because I ran into some "intl" php extension problems.  I do not use the PC version much because it is on a virtual PC, and instead I run MAMP on my Mac.

I see that my XAMPP version on my PC is 7.1.10.  I have Moodle 3.4+ (Build: 20180104) installed on it. 

In reply to Rick Jerz

Re: Running Moodle in XAMPP

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers

As a follow up to what I have posted, and seeing some of the other posts, your question seemed specific about XAMPP.  Some of the moodle installers (see Colin's post) are "AMP" packages that include Moodle.

XAMPP, from what I know, is one form of "AMP" bundle, but it does not come with Moodle installed.  In my case, this was fine because I wanted to install Moodle from scratch, and learn.  My MAMP install on my Mac was a Moodle "bundle" which is running fine.  Again, I never had success (still too dumb) to get Moodle installed and running from my XAMPP install on my Mac, so this is why I run MAMP.

I really wanted XAMPP because it came with MariaDB, which is what I am using on my production server.  My successful PC install of XAMPP + Moodle is using MariaDB.  But it is not as convenient to me as MAMP on my Mac.

Yep, this gets a little complex.  These "AMP" approaches allow me to have "experimental" moodles.