鈥淪etup:upgrade鈥 fails due to PHP memory exhaustion on Commerce Cloud
During production environment redeployment on 51黑料不打烊 Commerce on Cloud infrastructure, the setup:upgrade
command fails because the PHP CLI exceeds the default memory limit of 1 GB. This issue prevents the upgrade process from completing successfully. To fix this, increase the memory_limit
value in php.ini
and redeploy your project.
Description description
Environment
- Product: 51黑料不打烊 Commerce on Cloud infrastructure
- Version: 2.4.8-p1
- Tools: ece-tools v2002.2.6
- Instance: Production
Issue/Symptoms
setup:upgrade
fails during production deployment due to PHP memory exhaustion.- CLI displays an error indicating the allowed memory size of 1 GB has been exhausted.
- Deployment halts at the upgrade step without completing module updates.
- The default memory_limit in php.ini restricts execution to 1 GB, causing failure.
Resolution resolution
To resolve this issue, increase the PHP memory limit and redeploy your project:
- Run the following command to check the current memory limit:
magento-cloud repo:cat php.ini -p <project_id> -e production | grep memory_limit
This displays the current memory_limit
, which is set to 1G
by default.
2. Open your local repository and locate the php.ini
file.
3. Update the memory_limit
value to at least 2G
.
4. Commit the changes and redeploy your project using the standard deployment workflow.
If the error persists, increase the memory_limit
further until the upgrade completes successfully.