Local installation of Moodle 3.2 and PHP7+ completed instructions

We are still checking an issue with our mahara installation which has thrown an authentication error due to the upgraded php version but the Moodle install was fine. It’s even easier to upgrade php on a self hosted site because you can do via phpmyadmin on your cPanel or equivalent control panel / dashboard settings.
These instructions are for installation of Moodle 3.2 with PHP7 on a local IIS server on Windows 7 (see previous post for MySQL and PHP too)
Check php version as per yesterday’s post / i.e. copy


into a file and save in e.g. inetpub/wwwroot/www subfolder (or just inetpub/wwwroot if you don’t)

  1. Optional – temporarily enable directory browsing on IIS via Configuration Editor / WebServices dropdown menus – change False to True (it can be useful for troubleshooting if needed) but disable again once Moodle installation completed.
  2. Backup old version of PHP if you have existing version and save the folder somewhere else as a zipped folder.
  3. Stop IIS and close MySQL Workbench (especially if you have low RAM – as your computer will be running really slowly)
  4. Download PHP7 and install either in C:// or e.g. C://Program Files (x86)
  5. Update PHP settings (e.g. this is for PHP 5.6 but useful for IIS and Windows 7 – you can ignore the end bit)
    • Open php.ini.production with notepad++ or text editor
    • Uncomment / enable extension directories as per video (we also double checked against our previous php.ini file)
    • Check you have all the correct php dlls (I had to add in zip.dll again and check that your zip and unzip folders are still in C)
    • Enable path in Windows / Control Panel / System / Advanced system settings / Environment variables (e.g. add C://Program Files (x86)/PHP) to Path) Apply and Ok to close.
    • Type optionalfeatures.exe in Windows start menu search box.
    • Open IIS and IIS management console, click handler mapping and Add Module mapping
    • Type *.php in Request Path
    • Select FastCGIModule in Module dropdown menu
    • Find php.cgi.exe in your PHP folder in C for Executable
    • Type PHP_viaFASTCGI in Name
    • Request restrictions – tick Invoke handler and select file or folder, tick ok.
  6. Open MySQL Workbench and connect. Add new schema (call it moodle – lowercase) and ensure there is a moodle folder in C://inetpub/wwwroot if for any reason your moodle download doesn’t have this as a top level folder (it should !)
  7. Download and install Moodle 3.2 or above
  8. Extract to C://inetpub/wwwroot folder
  9. Open C://inetpub/wwwroot/moodle/config-dist.php
  10. Add in dbname, dbpassword,bdhost, port (we copied these from our mahara settings as this is a Moodle sandpit we will be messing around with), leave others unchanged.
  11. Change to mysqli then save config-dist.php and close.
  12. Restart IIS
  13. Open localhost/moodle/index.php. You will then be automatically directed to install.php and follow the onscreen instructions to install Moodle.
  14. You will see a couple of screens which show what has been installed and upgraded. Then you should see your Moodle site open in admin view once you’ve specified an admin username and password. Go to Site Admin and Appearance / Navigation then Site Admin / Users to change the default dashboard and profile pages.
  15. Try testing URLs – localhost/moodle/index.php, localhost/moodle/my/index.php, localhost/moodle/admin/index.php
  16. Add Moodle site to list of sites on IIS
  17. Turn off directory browsing on IIS

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.