Problem/Motivation

Some Install profiles could need more resources - PHP requirements in terms to run.
Because of
- packages/libraries used,
- amount of packages/libraries
- coding
- processes resources
So maybe we need a specific minimum PHP version and/or a specific minimum PHP memory limit.

Steps to reproduce

It's just not possible this overriding - not implemented.

Proposed resolution

Update system_requirements to get install profile "PHP requirements".
And if they exists and use them, overriding Drupal default "PHP requirements".

Remaining tasks

- Do we need a change record for this?

User interface changes

API changes

Data model changes

Release notes snippet

Original Summary report

imho there should be a way to change the constants defined for the system requirements
as 'DRUPAL_MINIMUM_PHP' or 'DRUPAL_MINIMUM_PHP_MEMORY_LIMIT'.
there could be some complex install profiles that requires "more power" from the system.
for example there's a Commerce Kickstart issue about this : #1763632: The install needs to check Kickstart requirements before starting.

Issue fork drupal-1772316

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

vasike’s picture

Status: Active » Needs review
FileSize
605 bytes

here is a patch that allows that
bad approach

are there other system requirements constants that could be changed?

vasike’s picture

Title: Allow install profiles to change the system requirements constants » Allow install profiles to change the system requirements
FileSize
3.8 KB

here is a new approach for changing the php system requirements.
it uses the install_profile_info definition.

so what it's needed it's to specify new values in the info file of the profile

php = 5.3.12
php_memory_limit = 1234M

Status: Needs review » Needs work

The last submitted patch, allow_change_system-requirements-1772316-2.patch, failed testing.

vasike’s picture

Status: Needs work » Needs review
FileSize
3.88 KB

rebuilt the patch, i hope it's the right one

vasike’s picture

Version: 7.x-dev » 8.x-dev
FileSize
3.83 KB

and here is the patch for Drupal 8

sun’s picture

Component: configuration system » install system
saltednut’s picture

Issue tags: +Needs reroll

Looks like some D7 install profiles have been using #4 and it no longer applies to HEAD as of 7.22. :(

Added tags Needs reroll but there's no way to specify thats a D7 reroll since this is also being tracked as an 8.x issue - sorry.

cweagans’s picture

Status: Needs review » Needs work
Issue tags: +Needs reroll

The last submitted patch, allow_change_system-requirements-1772316-5.patch, failed testing.

cweagans’s picture

Status: Needs work » Needs review

We need to get this into D8 before we worry about D7. I requeued the patch in #5 (I doubt it'll pass - last test run was in September). If that fails, lets reroll that, get it committed, then deal with D7.

cweagans’s picture

Status: Needs review » Needs work

Ah, cross posted with the bot. So yeah, need to reroll that patch.

cweagans’s picture

Let's give this a try. I moved around your new block of code in system.install so that we're not calling drupal_get_profile() multiple times - now it's just called once at the beginning of the function and used throughout.

cweagans’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 1772316_12-allow-profiles-to-override-php-requirements.patch, failed testing.

tobyontour’s picture

Status: Needs work » Needs review
Issue tags: -Needs reroll

Made system.install default to DRUPAL_MINIMUM_PHP_MEMORY_LIMIT if it's not set in the profile (this is what caused the previous patch to fail).

tobyontour’s picture

Patch failed to attach to last post.

Tor Arne Thune’s picture

I'm not sure about "Drupal requires at least PHP %version.", as this is not true if the profile uses a different max version than Drupal. Drupal with [name of profile] requires this version, yes. Also the same issue in the message about the memory limit.

jsacksick’s picture

Here's the rerolled patch for d7, against the latest dev

Status: Needs review » Needs work

The last submitted patch, drupal7-allow_change_system-requirements-1772316-18.patch, failed testing.

hswong3i’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, drupal7-allow_change_system-requirements-1772316-18.patch, failed testing.

jsacksick’s picture

The issue is tagged with the 8.x version which means that the patch will obviously fail..., that's why I didn't change the status earlier... I rerolled the patch for Commerce Kickstart

hswong3i’s picture

hswong3i’s picture

Status: Needs work » Needs review
David_Rothstein’s picture

Note: #309040: Add hook_requirements_alter() is another way to do this that should be a lot more flexible.

David_Rothstein’s picture

manuelBS’s picture

In some installations we have problems with mysql max_allowed_packet size set to low. Wouldn't ist make sense to set this settings also as requirement if needed?

xtfer’s picture

Updated for D7, as the patch was not applying.

Status: Needs review » Needs work

The last submitted patch, 28: drupal-7.x-allow_profile_change_sys_req-1772316-28.patch, failed testing.

xtfer’s picture

Version: 8.x-dev » 7.x-dev
Status: Needs work » Needs review

Switching to 7 to run the test.

xtfer’s picture

xtfer’s picture

Version: 7.x-dev » 8.x-dev

Back to 8.x

jhedstrom’s picture

Status: Needs review » Needs work
Issue tags: +Needs reroll
rpayanm’s picture

Status: Needs work » Needs review
Issue tags: -Needs reroll
FileSize
3.81 KB

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.6 was released on August 2, 2017 and is the final full bugfix release for the Drupal 8.3.x series. Drupal 8.3.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.4.0 on October 4, 2017. (Drupal 8.4.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.4.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.4 was released on January 3, 2018 and is the final full bugfix release for the Drupal 8.4.x series. Drupal 8.4.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.5.0 on March 7, 2018. (Drupal 8.5.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.5.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.6 was released on August 1, 2018 and is the final bugfix release for the Drupal 8.5.x series. Drupal 8.5.x will not receive any further development aside from security fixes. Sites should prepare to update to 8.6.0 on September 5, 2018. (Drupal 8.6.0-rc1 is available for testing.)

Bug reports should be targeted against the 8.6.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.8.x-dev

Drupal 8.6.x will not receive any further development aside from security fixes. Bug reports should be targeted against the 8.8.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.9.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.7 was released on June 3, 2020 and is the final full bugfix release for the Drupal 8.8.x series. Drupal 8.8.x will not receive any further development aside from security fixes. Sites should prepare to update to Drupal 8.9.0 or Drupal 9.0.0 for ongoing support.

Bug reports should be targeted against the 8.9.x-dev branch from now on, and new development or disruptive changes should be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.2.x-dev

Drupal 8 is end-of-life as of November 17, 2021. There will not be further changes made to Drupal 8. Bugfixes are now made to the 9.3.x and higher branches only. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.2.x-dev » 9.3.x-dev
immaculatexavier’s picture

Status: Needs review » Needs work
Issue tags: +Needs reroll

Patch does not apply

immaculatexavier’s picture

The patch no longer applies, so adding tag for re-roll.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.15 was released on June 1st, 2022 and is the final full bugfix release for the Drupal 9.3.x series. Drupal 9.3.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.4.x-dev branch from now on, and new development or disruptive changes should be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Rassoni’s picture

Status: Needs work » Needs review
FileSize
4.39 KB
1.27 KB
4.39 KB

Reroll against 9.4.x dev branch.

Rassoni’s picture

ranjith_kumar_k_u’s picture

Re-rolled #34 for 9.5

ranjith_kumar_k_u’s picture

immaculatexavier’s picture

Custom Commands have been fixed, and an interdiff against #51 has been attached for 9.5.x

Bhanu951’s picture

Version: 9.4.x-dev » 10.1.x-dev

Bhanu951’s picture

Issue tags: -Needs reroll

Rajeshreeputra made their first commit to this issue’s fork.

needs-review-queue-bot’s picture

Status: Needs review » Needs work
FileSize
150 bytes

The Needs Review Queue Bot tested this issue. It either no longer applies to Drupal core, or fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".

Apart from a re-roll or rebase, this issue may need more work to address feedback in the issue or MR comments. To progress an issue, incorporate this feedback as part of the process of updating the issue. This helps other contributors to know what is outstanding.

Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.

Bhanu951’s picture

Status: Needs work » Needs review
smustgrave’s picture

Category: Task » Feature request
Status: Needs review » Needs work
Issue tags: +Needs Review Queue Initiative, +Needs tests, +Needs issue summary update

This issue is being reviewed by the kind folks in Slack, #needs-review-queue-initiative. We are working to keep the size of Needs Review queue [2700+ issues] to around 400 (1 month or less), following Review a patch or merge request as a guide.

FYI didn't read all the comments but #56 appeared to be a rebase.

This could use an issue summary update as I'm not fully understanding the use case or the "why" maybe the test case will have show that. But the issue summary should mention the proposed solution and other fields per default template.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

vasike’s picture

Issue summary: View changes
Status: Needs work » Needs review

Updated the MR
- Fix for php_memory_limit
- Test for overriding PHP version and memory limit

Update also the issue summary

smustgrave’s picture

Status: Needs review » Needs work
Issue tags: -Needs tests, -Needs issue summary update +Needs change record

Cleaning up tags.

Think the last thing is to get a change record written with an example how this would be set.

vasike’s picture

Unfortunately, i think the MR is not ready ... yet

2 things:
1. It would be nice to have also RECOMMENDED_PHP ... overridden.
2. What if the values are less than "default" - Drupal provided? Should we allow that.

Another thought:
Wondering if Drupal\Core\Utility\PhpRequirements shouldn't be the place or getting the "right" PHP Requirements
instead of system.install ...

but maybe i'm just "overthinking" ...