Switching to a Composer-based installation. Questions and/or Need Changes to instructions

Your software
My Mautic version is: 5.1
My PHP version is: 8.0.30
My Database type and version is: pdo_mysql 5.7.44

Your problem
My problem is:

I HAD Mautic working with Sparkpost.
Then I successfully upgraded self-hosted Mautic from 4.X to 5.X only to discover (after-the-fact) the Mailer changes and that it breaks my setup.
I did the Mautic upgrade using Command line Console (I used to use the GUI, but switched several upgrades ago after it was “recommended”). Initially I DIDN’T HAVE Composer setup.

Now with some awesome help from my hosting companies support, I’ve changed to Composer setup.

Only TWO issues at this point (having not yet tried the Plugin setup).

Are the SWITCH TO COMPOSER instructions outdated and/or missing now info???
The last step says " ```
Log in to Mautic, and in your global settings enable the switch to fully manage Mautic with Composer - this also enables you to work with the Mautic Marketplace."

"
![How_to_switch_to_Composer_—_Mautic_Documentation_0_20240717_074133|690x189](upload://rMKgRjavj5sC0vFu8af39eJ97sV.jpeg)

WHERE DID THIS GO? I can’t find it anywhere. Is it removed (and unnecessary) in Mautic 5? Then CHANGE the instructions!!!

Also, under SYSTEM INFO >>> Recomendations, I now have "mautic.install.cache.unwritable ".
So I need to fix that. How? (although I should get that figured out easy enough)
BTW, there’s a TYPO in that message “unwritable”.

I’m starting to wonder if these forums are a waste of time. Hopefully not, but…

Related to above, now that I changed to Composer, it’s also unclear, what is the proper folder location (Mautic 5.1) with Composer installation of the /var/cache and /var/logs
???

Are these now also located under /docroot/
or are they still outside of/docroot/
???
i.e. which is correct?
/public_html/docroot/var/cache and /public_html/docroot/var/logs
or
/public_html/var/cache and /public_html/var/logs
???

Hmmm… These are community forums, not paid support forums with SLAs. As a consequence, they rely on the likes of you and me (unpaid volunteers who are community minded) to answer peoples posts.

I expect there is supposed to be a screenshot in your original post, but it looks like the formatting may be wrong. did the screenshot and formatting appear correctly in the preview view?

This is what I can see currently in your original post:

By the looks of the 3 back-tics at the end of the line starting with

The last step "

I’m guessing the formatting is messed up in your original post.

If there is supposed to be a screenshot, will you please edit your original post so it shows correctly?

Also, I am new to Mautic, and have just completed a fresh install of 5.1.0 using composer on a self-hosted server using debian 12 and nginx, and my:

  • Mautic is installed in /var/www/mautic
  • logs folder is in /var/www/mautic/var/logs
  • cache folder is in /var/www/mautic/var/cache

Due to my new-ness, I cannot comment on your cache unwritable error, but I can comment on the “TYPO” issue.
Unwritable is the correct spelling. I assume that this is what you TYPO is referring to, as you didn’t suggest what you think solution issue is, and I don’t have the time to read that line for the fourth time to find the issue - I’m not being paid for this - I’m just trying to help.


Edit: Make image stand out clearer from my reply by quoting it.

Hi @okdnet,

As mentioned above these forums are community supported, and demanding an answer within 24 hours and claiming they are a waste of time isn’t likely to go down well. as regards having people help you.

If you require support with an SLA, you’ll need to work with an organisation providing such support. Otherwise, please be respectful of the time of our volunteers (and perhaps, try to answer some questions while you wait - which helps us to all grow!) - in case it’s helpful (as I appreciate some folks join without reading it), our Code of Conduct outlines expected and unwelcome behaviour.

That being said, the setting is still in Mautic 5.1, I just checked that it’s present at the bottom of the System Settings:

Regarding the other questions, did you read and follow all the instructions which are written in the documentation about switching to Composer? I think it pretty much explains all the directory paths, but perhaps it might be helpful to add a full directory tree of where things are with a Composer-based installation, what do you think?

Here’s that page, for reference: How to switch to Composer — Mautic Documentation 0.1 documentation - I see the response above has answered some of those questions already, thanks for that @itnavigate and welcome to the commun ity! :mautibot:

The error about the cache being unwritable means that you have an issue with your files and folders permissions which you (or your hosting provider) will want to rectify. This is documented here: File ownership and permissions — Mautic Documentation 0.1 documentation.

Hope that helps you move forward and get it so you can install Acquia’s Sparkpost integration plugin.

2 Likes

Hey, so I just want to state that you guys did and are doing a great job. It’s not easy to give up your time for people who don’t appreciate your talent and dedication. And to all the Dev who give of your time. I thank you.

Thank you!!!
I don’t know how I missed the setting (I looked several times).
As for the paths, we did follow the directions, but the cache folder isn’t specifically mentioned, after looking again it seems clearer, it should be in
/public_html/docroot/var/cache/

I will take the permissions issue to my hosting support team.

And everybody, I’m sorry if I seemed unappreciative. I absolutely appreciate the talent and dedication of those behind Mautic, and I certainly appreciate it’s voluntary to offer help. But please relax, I was just wondering aloud if the forums were perhaps “not active”. Clearly I should have wondered to myself and waited longer to see one way or the other though. My bad.

And yes, I do think it would be helpful to add a full directory tree of where things are with a Composer-based installation.
It’s one of those situations where it needs to be REALLY CLEAR, and it is easy enough to accomplish, it certainly can’t hurt, so why not.

Tech support for my VPS hosting is phenomenal, yet at this point they don;t understand what the cause of this problem / error is.

When I run the command
"composer require ts-navghane/sparkpost-plugin "
It fails with this message

In PackageDiscoveryTrait.php line 376:

  Could not find a matching version of package ts-navghane/sparkpost-plugin. Check
   the package spelling, your version constraint and that the package is available
  in a stability which matches your minimum-stability (dev).

I even tried (being a Composer illiterate) modifying the command to be
"composer require acquia/mc-cs-plugin-sparkpost " but that didn’t help (same message but specifically

In PackageDiscoveryTrait.php line 376:

  Could not find a matching version of package acquia/mc-cs-plugin-sparkpost. Check
   the package spelling, your version constraint and that the package is available
  in a stability which matches your minimum-stability (dev).

Anyone know what the problem might be or have any suggestions?

UPDATE:

My tech support fixed and explained the following, which I don’t yet fully understand, but am posting here for anyone else who might experience this type issue.

There were two issues.

  1. the repository seemed to be missing. composer.json doesn’t mention your Git URLs but did have a few others listed. I added yours:
  "repositories": [
    {
      "type": "git",
      "url": "https://github.com/acquia/mc-cs-plugin-sparkpost.git"
    },
    {
      "type": "git",
      "url": "https://github.com/mautic/FOSOAuthServerBundle.git"
    },
    {
      "type": "git",
      "url": "https://github.com/mautic/SpBundle.git"
    },
    {
      "type": "git",
      "url": "https://github.com/mautic/SymfonyBridgeBundle.git"
    }
  ],
  1. This brought us back to the PHP version error:
    - ts-navghane/sparkpost-plugin dev-main requires php >=8.0.0 which does not match your installed version 7.3.33.

php is aliased to php8.0 binary in .bashrc, however composer is its own executable and won’t use this alias. You can get around that by running php to run composer as following:

php $(which composer) require ts-navghane/sparkpost-plugin

In order to keep this problem at bay in the future, I have added a new alias for composer:

# User specific aliases and functions
alias php='/usr/local/php80/bin/php'
alias composer='/usr/local/php80/bin/php /usr/local/bin/composer'

You should be using the Acquia version (acquia/mc-cs-plugin-sparkpost), rather than Tejas’ original proof of concept - it’d be sensible to update that sooner rather than later.

Yes, it looks like it would not install because your PHP versions weren’t at the minimum level needed - glad to hear you got it sorted out! FYI, we will be dropping support for 8.0 soon (probably the 5.2 release), so you’ll need your host to update it (after testing etc) to 8.1 at least. 8.2 support is coming in 5.2.

Another option, if you are running on a VPS that only you are on, would be to set the system wide default php version.

on Debian it is

sudo update-alternatives --config php

How can I tell which version of the plugin I have running?
acquia/mc-cs-plugin-sparkpost or ts-navghane/sparkpost-plugin ???
It would be nice if the Mautic Plugins GUI showed more.

And if I ended up with the ts-navghane/sparkpost-plugin version, is it easy to switch? How? Now that it’s working, I’m a little nervous about trying to change it. I read that Composer makes it all “easier”, but it seems that’s only true if you “know” Composer. If not, it seems like I can’t do anything myself and need to ask my hosting support. Yes, I know I need to learn Composer, but in the meantime…

Looking at my composer.json file
(see screenshot here http://okdn.us/4N )
, I THINK this means I have the correct plugin installed, the acquia/mc-cs-plugin-sparkpost plugin rather than the original proof of concept ts-navghane/sparkpost-plugin >

Am I correct, and is the configuration entry correct?
If not, what needs to be done to correct it all?

This topic was automatically closed 36 hours after the last reply. New replies are no longer allowed.