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)
- 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.
- Backup old version of PHP if you have existing version and save the folder somewhere else as a zipped folder.
- Stop IIS and close MySQL Workbench (especially if you have low RAM – as your computer will be running really slowly)
- Download PHP7 and install either in C:// or e.g. C://Program Files (x86)
- 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.
- 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 !)
- Download and install Moodle 3.2 or above
- Extract to C://inetpub/wwwroot folder
- Open C://inetpub/wwwroot/moodle/config-dist.php
- 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.
- Change to mysqli then save config-dist.php and close.
- Restart IIS
- Open localhost/moodle/index.php. You will then be automatically directed to install.php and follow the onscreen instructions to install Moodle.
- 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.
- Try testing URLs – localhost/moodle/index.php, localhost/moodle/my/index.php, localhost/moodle/admin/index.php
- Add Moodle site to list of sites on IIS
- Turn off directory browsing on IIS