Trying to move to composer, still getting PHP errors

Following the instructions to move to composer (not happy about this move as I am completely lost).

ran the command

composer create-project mautic/recommended-project:^4 Mautic-new --no-interaction

After a few seconds, I was greeted with this.

PHP Fatal error:  Allowed memory size of 1610612736 bytes exhausted (tried to allocate 67108872 bytes) in phar:///usr/sbin/composer/src/Composer/DependencyResolver/RuleSet.php on line 83

Fatal error: Allowed memory size of 1610612736 bytes exhausted (tried to allocate 67108872 bytes) in phar:///usr/sbin/composer/src/Composer/DependencyResolver/RuleSet.php on line 83

Check for more info on how to handle out of memory errors.root@localhost:/home/runcloud/webapps#

I understood that the whole reason to move to composer was to avoid PHP and memory errors. So why am I still getting PHP memory errors!?!?!?

** Prepare for personal rant **

I will repeat myself from other posts I have made. This decision to move to composer for installs and updates, while it may be a good approach, was made by a developer, not by a user. I am not a developer. I don’t use Github to house my own projects. I have no idea how any of this works and most of the CLI stuff is beyond my current level of understanding. I can build websites and I know how to set up hosting. Transferring files via FTP and configuring the sites in my hosting. If CLI is the better way then why do we have WHM and cPanel and Plesk? Because not everyone is a developer and many people need a UI with options to choose from to make heads or tails of things.

I have nothing against learning but this topic is outside of my area of study nor am I particularly interested in going down that path. I am a small business owner (photographer) that looks after my own stuff. I don’t develop applications for a living nor do I manage networks or large IT installations.

In this situation, I am trying to decipher the manual and apply it to my installation which is managed by a third party, Runcloud. The directory structure is different and running into complications leaves me in the lurch. Runcloud will not advise as it’s not part of their support.

I am pleading with you. Simplify this process.

1 Like

This seems like a php memory setting issue.
Do you know how to check your php memory settings?
If yes, can you plz share here?

Hi Joeyk,

But PHP is not used when updating with composer. That was the whole point of moving to composer, to avoid the PHP problems people were having doing updates in the browser UI.

How can that be?

I am not sure about updating but composer is a dependency manager for php.

The error produced tells us that your php is lacking memory so try increasing memory in php.ini and try again.

And I do somewhat agree with your rant but oh well … I preferred to stay away from CLI. Cpanel or web management etc offer CLI as part of the package now. It depends on the host provider to have it enabled or not.

I had to enable my Cpanel terminal account then use a certain string with composer to install it in Cpanel’s tree structure directories since when I tried to install Mautic outside of the rootdoc folder, it wouldn’t function property and give off a bunch of errors in log.

So my Mautic PHP memory limit is set to 512MB.

It needs more than that in order to perform an upgrade?!

** UPDATE **

Going by the error message it is trying to take up 1.6GB of memory

Why does it need that much memory to update PHP files and possibly update a DB?

** UPDATE 2 **

So, mistake there. The error is saying it’s used 1.6GB of memory and could not allocate another 67MB it needed.

I checked my PHP settings and they are set to 512MB. So I have no idea how it was able to consume 1.6GB when it was set to 1/3 of that.

Reading this doc, I’m not quite sure what I need to do to resolve this.

Are these CLI commands that I am typing into an SSH session?

If so, in the instances where ‘<…>’ is in the command, is this supposed to be replaced with something? What is it expecting me to include?

To get the current memory_limit value, run:

php -r "echo ini_get('memory_limit').PHP_EOL;"

Try increasing the limit in your php.ini file (ex. /etc/php5/cli/php.ini for Debian-like systems):

; Use -1 for unlimited or define an explicit value like 2G
memory_limit = -1

Composer also respects a memory limit defined by the COMPOSER_MEMORY_LIMIT environment variable:

COMPOSER_MEMORY_LIMIT=-1 composer.phar <...>

Or, you can increase the limit with a command-line argument:

php -d memory_limit=-1 composer.phar <...>

This issue can also happen on cPanel instances, when the shell fork bomb protection is activated. For more information, see the documentation of the fork bomb feature on the cPanel site.

We had our hosting provider upgrade our memory to 4096 and it solved the problem above.

After following all the steps, we got a bunch of 500 errors and gave up.

If someone gets this working - we would love to know how…

500 error would be recorded in the httpd or php error logs …

Let us know what error was recorded in log and we may be able to assist you with this…

Hi Bill,

No log file was created. My assumption is that the local.php paths need to be updated after the move, but i’m not sure to where. I plan on doing a clean install so i can see how composer is handling the local.php paths when i have time.

Let you know 500 errors most of the time is a server side log file not the logs in Mautic. You need to check your web server for those two logs file and check browser console to see if any javascript error when loading a page too.

1 Like

Sorry, but what about the person that started this thread?