Posts made by Usman Asar

Picture of Plugin developers Picture of Testers

Doug,

Jeff has already written the code, but it depends, if you are on PHP 5.4, then you have to install opcache extension separately, else from PHP 5.5 onwards, this comes as a part of PHP already, all you have to do is copy the code Jeff wrote in your php.ini file and you're good to go.

You can skip the last moodle config section for these are the settings your may have already have in place.

additionally, this Jeff's code wont automatically enable opcache extension and get rid of exclamation mark, there is additional line that needs to be mentioned, so if you are on Linux platform, then add this line into your php.ini

zend_extension=/full/path/to/opcache.so

if you're on Windows platform, then add this line instead

zend_extension=php_opcache.dll

You will be adding these lines BEFORE what Jeff mentioned.

and last but not least, as you mentioned Moodle 3.1, then change the figure to 8000 in this line

opcache.max_accelerated_files = 4000 (change to 8000, for moodle 3+ has more files to be cached)



Picture of Plugin developers Picture of Testers

The only thing that I haven't seen working when using PHP 7 on Moodle older than 3.0.1 was CRON jobs, else all seemed working fine, therefore dont just automatically assume that Moodle older than 3.0.1 works 100% fine.

PHP 7 support for Moodle was tested and started coming  from 3.0.1 onwards, so upgrading to anything higher is recommended, just keep eye on your plug-ins just like Bret mentioned, and you're good to go.

Picture of Plugin developers Picture of Testers

Sean, Just as Bret said, Everything you need to run moodle, whether required or even recommended is already in PHP 5.5.x onwards, previous versions may still lack some recommended extensions (Like OpCache).

All you have to do is, remove the semi-colon before extension o enable it in php.ini file (also referred to as PHP config file)

One thing that MAY be problematic is version of PHP you've chosen as there are two versions, NTS and TS and they depend upon the WEB SERVER and not the operating system, so I am assuming that you MAY have downloaded the NTS (non-Thread Safe) version is for IIS where it runs on Windows platform only, where some people may assume that because it's for windows, so running Apache requires NTS as well, whilst in actual all depends on Web Server you're using, so in your case as it's Apache, so you would be downloading the TS (Thread Safe) version of PHP.

Once you've done that, your Moodle should open fine even on default settings for PHP.INI, should there be required extension then you'll get message in Environment section, usually it's INTL extension that is not enabled by default in PHP, else most required are already enabled.

If you're still in doubt, I have a full tutorial for setting up PHP manually, but that tutorial shows setting on Windows Server and IIS (so slight difference there) else method of setting up PHP remains similar, you can watch video in the link provided

http://blog.academictools.org/2015/12/installing-moodle-on-microsoft-windows.html

Just the applicable part is where I have shown how to enable extensions in PHP (simply finding them using find command in notepad and removing the semi-colon to enable them - dont forget to restart Apache web server)