# First time Composer Mautic 4 Install - HELP

**URL:** <https://forum.mautic.org/t/first-time-composer-mautic-4-install-help/22901>\
**Category:** Mautic 4 Install/Upgrade Support\
**Created:** [March 3, 2022, 12:45pm UTC](https://forum.mautic.org/t/first-time-composer-mautic-4-install-help/22901 "2022-03-03T12:45:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mikew](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mikew/32/5156_2.png) [@mikew](https://forum.mautic.org/u/mikew)\
**Post date:** [March 3, 2022, 12:45pm UTC](https://forum.mautic.org/t/first-time-composer-mautic-4-install-help/22901/1 "2022-03-03T12:45:19Z")

</div>

**Your software**  
_My PHP version is_ : 7.4  
_My MySQL/MariaDB version is_ (delete as applicable): mysql Ver 15.1 Distrib 10.3.34-MariaDB, for debian-linux-gnu (x86\_64) using readline 5.2

**Installing Errors**  
_I am_ : Installing  
_installing via_ : Command Line

My first time using composer and it has not been as easy as I would have hoped. Firstly I installed composer but see it was composer 1 and had to find out how to upgrade to composer 2.

Then went ahead and ran the command:

```auto
composer create-project mautic/recommended-project:^4 mautic --no-interaction

```

_These errors are showing in the installer_ :

I got a number of warnings and errors, pasting them below:

```auto
 - Installing composer/installers (v1.12.0): Extracting archive
For additional security you should declare the allow-plugins config with a list of packages names that are allowed to run code. See https://getcomposer.org/allow-plugins
You have until July 2022 to add the setting. Composer will then switch the default behavior to disallow all plugins.
  - Installing composer/package-versions-deprecated (1.11.99.1): Extracting archive

```

then

```auto
107/223 [=============>--------------] 47% Failed to extract ip2location/ip2location-php: (9) '/usr/bin/unzip' -qq '/var/www/mautic/vendor/composer/tmp-7e864c5dda329a48d596c26859840338' -d '/var/www/mautic/vendor/composer/1194d3be'

[/var/www/mautic/vendor/composer/tmp-7e864c5dda329a48d596c26859840338]
  End-of-central-directory signature not found. Either this file is not
  a zipfile, or it constitutes one disk of a multi-part archive. In the
  latter case the central directory and zipfile comment will be found on
  the last disk(s) of this archive.
unzip: cannot find zipfile directory in one of /var/www/mautic/vendor/composer/tmp-7e864c5dda329a48d596c26859840338 or
        /var/www/mautic/vendor/composer/tmp-7e864c5dda329a48d596c26859840338.zip, and cannot find /var/www/mautic/vendor/composer/tmp-7e864c5dda329a48d596c26859840338.ZIP, period.

    The archive may contain identical file names with different capitalization (which fails on case insensitive filesystems)
    Unzip with unzip command failed, falling back to ZipArchive class
Package misd/phone-number-bundle is abandoned, you should avoid using it. Use odolbeau/phone-number-bundle instead.
Package swiftmailer/swiftmailer is abandoned, you should avoid using it. Use symfony/mailer instead.
Package symfony/inflector is abandoned, you should avoid using it. Use EnglishInflector from the String component instead.
Package symfony/swiftmailer-bundle is abandoned, you should avoid using it. Use symfony/mailer instead.
Generating autoload files

                                                                                                                                                          
  [RuntimeException]                                                                                                                                      
  Could not scan for classes inside "/var/www/mautic/vendor/ip2location/ip2location-php/IP2Location.php" which does not appear to be a file nor a folder  
                                                                                                                                                          

```

**Your problem**  
_My problem is_ : What do I do now ? 🙂

_Steps I have tried to fix the problem_ :

---

<div class="post-metadata">

**Author:** ![2io](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/2io/32/7383_2.png) [@2io](https://forum.mautic.org/u/2io)\
**Post date:** [April 18, 2022, 3:35pm UTC](https://forum.mautic.org/t/first-time-composer-mautic-4-install-help/22901/2 "2022-04-18T15:35:19Z")

</div>

Hey, I am also almost new to all this. I succeeded “upgrading” to `composer 2` by following these steps:

1 Step: I removed `composer` completely (also `php` and so on)  
[https://stackoverflow.com/questions/30396451/remove-composer](https://stackoverflow.com/questions/30396451/remove-composer)  
`sudo apt-get purge --auto-remove composer`

2 Step: I installed `php` and `composer` afterwards:  
[https://www.digitalocean.com/community/tutorials/how-to-install-php-7-4-and-set-up-a-local-development-environment-on-ubuntu-20-04](https://www.digitalocean.com/community/tutorials/how-to-install-php-7-4-and-set-up-a-local-development-environment-on-ubuntu-20-04)

3 Step: Because I could not run composer simply by typing composer (instead `/usr/local/bin/composer`), than I found a way to “alias” it:

> <https://askubuntu.com/questions/116960/global-installation-of-composer-manual>

alias composer=‘/usr/local/bin/composer’

Step 3 I really do not understand. By typing `echo $PATH` gives me:

> /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin

so the path `/usr/local/bin` is in the `$PATH` , so `composer` could be found…

Strange is that all over says that inside `/usr/local/bin` should be `composer.phar`, which I do not have, but only the `composer`.

Hope it helps.  
DuckDuckGo is my friend 🙂

---

<div class="post-metadata">

**Author:** ![Yosu\_Cadilla](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/yosu_cadilla/32/6206_2.png) [@Yosu\_Cadilla](https://forum.mautic.org/u/Yosu_Cadilla)\
**Post date:** [May 21, 2023, 3:31pm UTC](https://forum.mautic.org/t/first-time-composer-mautic-4-install-help/22901/3 "2023-05-21T15:31:47Z")

</div>

I can confirm, M4.4.8 install is broken.

> [@Mautic 4.4.8 composer install is broken](https://forum.mautic.org/t/mautic-4-4-8-composer-install-is-broken/28097):
>
> My PHP version is : 8.0 My MySQL/MariaDB version is: MariaDB 10.6 I am Installing with composer: Following the instructions found here: These messages and errors are showing in the CLI : composer create-project mautic/recommended-project:^4 some-dir --no-interaction PHP Deprecated: Return type of Symfony\Component\Console\Helper\HelperSet::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used …
