Skip to end of metadata
Go to start of metadata

You are viewing an old version of this content. View the current version.

Compare with Current View Version History

« Previous Version 3 Current »

In order for moodle to be updated to newer versions the update of php version is inevitable. PHP8.1 will guarantee us the opportunity to update to moodle version 4.2. Note that the update must be condacted into a dev environment first. All custom plugins,themes,scripts must also be checked thorougly so we make sure that everything is working as it should.

\uD83D\uDCD8 Instructions

Instructions on how to install it on our EC2 instances. We take for granted that we already have Amazon Linux 2 installed with amazon-linux-extras.

The steps are as follows:

  1. check what php version we currently have.

  2. Uninstall php

    sudo yum remove php*
    sudo yum remove /etc/php*
  3. check that php is completely removed

    whereis php
    php -v
  4. After removing the packages, clean up your system:

    sudo yum clean all
  5. Disable Any Third-Party PHP Repositories. If you have any third-party repositories enabled (like Remi or EPEL), you should disable them to avoid conflicts:

    sudo yum-config-manager --disable remi-php*
  6. Enable PHP Repository via Amazon Linux Extras

    sudo amazon-linux-extras enable php8.1
  1. Install all php packages that are required for moodle to operate.

    1. first install PHP

      sudo yum install php
      sudo yum install php-fpm
    2. all php packages that are required

      • The iconv extension is required.

      • The mbstring extension is required.

      • The curl extension is required (required for networking and web services).

      • The openssl extension is recommended (required for networking and web services).

      • The tokenizer extension is recommended.

      • The xmlrpc extension is recommended (required for networking and web services).

      • The soap extension is recommended (required for web services).

      • The ctype extension is required.

      • The zip extension is required.

      • The gd extension is required.

      • The simplexml extension is required.

      • The spl extension is required.

      • The pcre extension is required.

      • The dom extension is required.

      • The xml extension is required.

      • The intl extension is required.

      • The json extension is required.

      • the opcache extension is not required but moodle displays a warning to be installed as well.

      • The appropriate extension for your chosen database is also required.

        • mysqlnd

      • The redis extension for our case needs to be installed as well. There is a case where amazon-linux-extras might not include redis into their packages and for that reason we need to go with a third party repository like remi.

        sudo yum install https://rpms.remirepo.net/enterprise/remi-release-7.rpm
          sudo yum-config-manager --enable remi-php81
          sudo yum install php-redis

        After installing redis it’s a good idea to go back to amazon-linux-extras repository.

        sudo amazon-linux-extras enable php8.1
        yum clean metadata

    After installing all the php packages it is mandatory to change the max_input_vars to 5000. This can be found in /etc/php.ini

It's always a good idea to check Moodle's phpinfo() page, as well as Moodle's environment page, to ensure that all services are enabled and functioning properly.

  • No labels