Forums | Mahara Community

Support /
Help Upgrading from 22.10 to 24.04 git


13 June 2024, 4:05

Hi all

          Up until now we've been using the open source version of mahara we have version 22.10 installed from git the source is https://git.mahara.org/mahara/mahara.git  when i do a git branch -a i see were on branch remotes/origin/22.10_STABLE  which is expected. 

 

Our Organization has purchased a subscrption for Mahara so i believe that gives us access to Mahara 24.04 from git but im not exactly sure how to move from the current git repo we're connected to. To the subscription one.  Im not sure what needs changing so i can connect via git and update to the newest version of mahara. Any assistance would be most appricated. 

 

Regards

Anthony 

13 June 2024, 22:15

Actually ive gotten around the issue below switching to the git branch ive pulled to code down so ive updated to 24.04 ive ran the make css but when i go to run make initcomposer i get this message 

 

# make initcomposer
-----------------------------------------------------------------------------
📦 INSTALLING COMPOSER
-----------------------------------------------------------------------------
Composer is already installed!
-----------------------------------------------------------------------------
📚 INSTALLING COMPOSER PLUGINS FOR external/...
-----------------------------------------------------------------------------
Installing dependencies from lock file (including require-dev)
Verifying lock file contents can be installed on current platform.
Your lock file does not contain a compatible set of packages. Please run composer update.

  Problem 1
    - symfony/deprecation-contracts is locked to version v3.4.0 and an update of this package was not requested.
    - symfony/deprecation-contracts v3.4.0 requires php >=8.1 -> your php version (7.4.33) does not satisfy that requirement.
  Problem 2
    - symfony/event-dispatcher-contracts is locked to version v3.4.0 and an update of this package was not requested.
    - symfony/event-dispatcher-contracts v3.4.0 requires php >=8.1 -> your php version (7.4.33) does not satisfy that requirement.
  Problem 3
    - symfony/deprecation-contracts v3.4.0 requires php >=8.1 -> your php version (7.4.33) does not satisfy that requirement.
    - symfony/service-contracts v2.5.2 requires symfony/deprecation-contracts ^2.1|^3 -> satisfiable by symfony/deprecation-contracts[v3.4.0].
    - symfony/service-contracts is locked to version v2.5.2 and an update of this package was not requested.

make: *** [Makefile:243: initcomposer] Error 2
#

 

Not sure why i cant run make initcomposer 

13 June 2024, 22:16

Sorry i should have mentioed running composer update i get this 

 

# composer update


PHP Parse error:  syntax error, unexpected '|', expecting variable (T_VARIABLE) in /usr/share/php/Composer/IO/BaseIO.php on line 163

Parse error: syntax error, unexpected '|', expecting variable (T_VARIABLE) in /usr/share/php/Composer/IO/BaseIO.php on line 163

 

and the version of php i have 

 

# php8.3 -v
PHP 8.3.8 (cli) (built: Jun  8 2024 21:34:22) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.3.8, Copyright (c) Zend Technologies
    with Zend OPcache v8.3.8, Copyright (c), by Zend Technologies

Kristina Hoeppner's profile picture
Posts: 4819

14 June 2024, 8:42

Hi Anthony,

Great that you could switch your branch. In case somebody else has a similar question, I would do the following, which is the fastest to switch to the current repository:

  1. Find your Git config. It's in the hidden folder '.git'.
  2. In there, you'll most likely have '[remote "origin"]' that has the old repository as 'url'. Switch that URL to [email protected]:catalyst/mahara.git
  3. In GitLab, upload your SSH key if you haven't already done so. That makes it easier to access the code as you don't need to create an access token for access via https. Since two-factor authentication is activated, you can't use your password alone, but need an access token.

Looking at the error output you shared, it says that your version of PHP is still 7.4 and not PHP 8.3: "your php version (7.4.33)". Mahara 24.04 is not supported on PHP 7.4. Do you happen to run Mahara in a virtual environment that has a different version of PHP than your operating system?

Cheers

Kristina

2 posts by Doris ⚡ were deleted

Doris ⚡'s profile picture
Posts: 94

14 June 2024, 13:46

Hi Anthony,

Adding onto Kristina's questions:

Can you please check that your Apache server's PHP version matches your CLI PHP version?

You can test this by putting the attached file into your htdocs folder. 

Then go https://<your_mahara_site>/phpinfo.php to see what version of PHP your Apache server is running.

Kind regards,

Doris

16 June 2024, 2:32

Hi Kristina / Doris 

                           Thank you for getting back to me im grateful for the help to answer you questions. Its an ubuntu Server running 2 versions of PHP, our mahara instance shares with another legacy web app that needs php 7.4

You can see below when i run php -v i get the 7.4 version when i get the php8.3 -v i get its version. 

root@mahara:/home# php8.3 -v
PHP 8.3.8 (cli) (built: Jun  8 2024 21:34:22) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.3.8, Copyright (c) Zend Technologies
    with Zend OPcache v8.3.8, Copyright (c), by Zend Technologies

root@mahara:/home# php -v
PHP 7.4.33 (cli) (built: Sep  2 2023 08:03:46) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
    with Zend OPcache v7.4.33, Copyright (c), by Zend Technologies
root@maharatest:/home/anthonymc#

Ive also get in apache to use php8.3 this is a snippet from the conf file in apache 

 <VirtualHost *:443>
   ServerAdmin [email protected]
   ServerName mahara.******.****
   DocumentRoot /***/***/***/mahara/htdocs


<FilesMatch "\.php$">
    SetHandler "proxy:unix:/run/php/php8.3-fpm.sock|fcgi://localhost"
</FilesMatch>

that should set php files for mahara to use 8.3 (i think) 


Relating to Doris's question about apache php matching php cli ive attached a screenshot of some of the phpinfo. as much as our security team would let me. it does appear to be using 8.3 but as i said above we have 2 versions of PHP installed on the server and php -v returns 7.4 you have to envoke php8.3 -v to get its version not sure if that makes a difference 

 

if you need any more information please let me know 

Doris ⚡'s profile picture
Posts: 94

16 June 2024, 12:05

Hi Anthony,

Thank you for providing the extra information.

Knowing that you must invoke PHP 8.3 to use it and that PHP 7.4 is your default, all you need to do is update the Makefile that lives in the root of your Mahara directory so that all the ‘php’ commands are changed to ‘php8.3’.

Kind regards,

Doris

18 June 2024, 22:50

Hi Doris

            Thanks a million for all your help that worked a treat. just replaced all instances that called php with php8.3 and i was able to make css just fine. for anyone that wanted to know. 

I just vim'ed the Makefile and then pressed i for edit mode then used this command 

%s/php/php8.3/gc 

you'll have to go line by line and check every instance replacing some and not others as some of the instances of php in the makefile call libraries and you dont want to change those. only the instances where php itself is called. 

I think we'll look at moving that legacy app off the mahara servers as ive modified the Makefile now so if we ever do a git pull for a new version id end up having to make all those changes again. but thanks a million as that seemed to work just fine were on the latest version now.

Kind Regards

Anthony 

24 results