grav icon indicating copy to clipboard operation
grav copied to clipboard

Grav installation via composer not compatible with PHP 8.1 ?

Open r2ck-me opened this issue 2 years ago • 4 comments

Hi,

I've just installed a new version of Ubuntu and tried to create a grav project with composer. It seems to fail because of PHP 8.1

composer create-project getgrav/grav ./

                                                                                                                 
Creating a "getgrav/grav" project at "./"
Info from https://repo.packagist.org: #StandWithUkraine
Cannot use getgrav/grav's latest version 1.7.41.1 as it requires ext-curl * which is missing from your platform.
Installing getgrav/grav (1.0.8)
  - Downloading getgrav/grav (1.0.8)
  - Installing getgrav/grav (1.0.8): Extracting archive
Created project in /home/richard/code/goodeworkers/./
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
    - doctrine/cache is locked to version v1.6.0 and an update of this package was not requested.
    - doctrine/cache v1.6.0 requires php ~5.5|~7.0 -> your php version (8.1.2) does not satisfy that requirement.
  Problem 2
    - gregwar/image is locked to version v2.0.20 and an update of this package was not requested.
    - gregwar/image v2.0.20 requires ext-gd * -> it is missing from your system. Install or enable PHP's gd extension.

To enable extensions, verify that they are enabled in your .ini files:
    - /etc/php/8.1/cli/php.ini
    - /etc/php/8.1/cli/conf.d/10-opcache.ini
    - /etc/php/8.1/cli/conf.d/10-pdo.ini
    - /etc/php/8.1/cli/conf.d/20-calendar.ini
    - /etc/php/8.1/cli/conf.d/20-ctype.ini
    - /etc/php/8.1/cli/conf.d/20-exif.ini
    - /etc/php/8.1/cli/conf.d/20-ffi.ini
    - /etc/php/8.1/cli/conf.d/20-fileinfo.ini
    - /etc/php/8.1/cli/conf.d/20-ftp.ini
    - /etc/php/8.1/cli/conf.d/20-gettext.ini
    - /etc/php/8.1/cli/conf.d/20-iconv.ini
    - /etc/php/8.1/cli/conf.d/20-phar.ini
    - /etc/php/8.1/cli/conf.d/20-posix.ini
    - /etc/php/8.1/cli/conf.d/20-readline.ini
    - /etc/php/8.1/cli/conf.d/20-shmop.ini
    - /etc/php/8.1/cli/conf.d/20-sockets.ini
    - /etc/php/8.1/cli/conf.d/20-sysvmsg.ini
    - /etc/php/8.1/cli/conf.d/20-sysvsem.ini
    - /etc/php/8.1/cli/conf.d/20-sysvshm.ini
    - /etc/php/8.1/cli/conf.d/20-tokenizer.ini
You can also run `php --ini` in a terminal to see which files are used by PHP in CLI mode.
Alternatively, you can run Composer with `--ignore-platform-req=ext-gd` to temporarily ignore these required extensions.

r2ck-me avatar May 31 '23 00:05 r2ck-me

please check your lock composer,

doctrine/cache is locked to version v1.6.0 and an update of this package was not requested.

in grav project doctrine ^1.10 by default.

clear your composer log and use composer v2 and it's not grav problem.

mdestafadilah avatar Jun 05 '23 02:06 mdestafadilah

Hi :wave: !

Thank you for your answer !

I have no composer.lock, it's a freshly installed OS. Just installed PHP and Composer (v2.5.7)

r2ck-me avatar Jun 05 '23 04:06 r2ck-me

Hi 👋 !

Thank you for your answer !

I have no composer.lock, it's a freshly installed OS. Just installed PHP and Composer (v2.5.7)

can you try with PHP 7.4 ? just testing... and report here.

mdestafadilah avatar Jun 05 '23 06:06 mdestafadilah

@r2ck-me Just read the your log.

Your composer installs an ancient grav version.

Installing getgrav/grav (1.0.8)

Why?

Cannot use getgrav/grav's latest version 1.7.41.1 as it requires ext-curl * which is missing from your platform.

So the required php extentions are not enabled which are required by grav. See install guide for the required extentions.

Rotzbua avatar Jul 11 '23 21:07 Rotzbua