Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatically setup php.ini entries #155

Merged
merged 18 commits into from
Dec 23, 2024
Merged

Conversation

asgrim
Copy link
Collaborator

@asgrim asgrim commented Dec 12, 2024

Fixes #20

  • ensure auto setup can be disabled with --skip-enable-extension flag
  • set up single php.ini
  • set up 00-extname.ini in additional php files path
  • set up with docker-php-ext-enable for Docker users
  • set up with phpenmod for ppa:ondrej/php users

@asgrim asgrim added the enhancement New feature or request label Dec 12, 2024
@asgrim asgrim added this to the 0.3.0 milestone Dec 12, 2024
@asgrim asgrim self-assigned this Dec 12, 2024
@remicollet
Copy link
Member

remicollet commented Dec 17, 2024

IMHO, tasks wording should be

  • set up with phpenmod for ppa:ondrej/php users => set up for DEB packages users (AFAIK, nothing specific to ondrej ppa)
  • set up for Remi repo users (need to check how this is done) => set up for RPM packages users (at least Fedora / RHEL / centOS and clones, don't know for other distros such as suse / mageia....)

At least for RPM, the numerical prefix is NOT related to "priority" but really to "load order". This prefix was introduced to ensure proper load order, according to declared dependencies, to ensure all symbols are resolved (PHP is build using the --enable-rtld-now option).

I think distribution package users, should not mix with other installation methods.

If really needed (not available as package), any number greater than what packages use should be fine

For RPM, numbers are described in Guidelines

Ping @oerdnj for DEB

@oerdnj
Copy link

oerdnj commented Dec 17, 2024

20 is a baseline, but if extensions stack upon each other, it usually goes in increments of 5, so memcached is something like 30.

phpenmod works with ;priority=nn comment in the ini file.

@asgrim
Copy link
Collaborator Author

asgrim commented Dec 17, 2024

* set up with phpenmod for ppa:ondrej/php users => set up for DEB packages users (AFAIK, nothing specific to ondrej ppa)

the ppa:ondrej/php is special, because it uses phpenmod to enable extensions. My plan is to check if phpenmod exists in the path, and to try to enable the extension using that, instead of the standard approach of enabling the extension.

* set up for Remi repo users (need to check how this is done) => set up for RPM packages users (at least Fedora / RHEL / centOS and clones, don't know for other distros such as suse / mageia....)

I suppose my question is: is there anything similar to phpenmod for the Remi repo? If not, then there is nothing to do here IMO.

At least for RPM, the numerical prefix is NOT related to "priority" but really to "load order". This prefix was introduced to ensure proper load order, according to declared dependencies, to ensure all symbols are resolved (PHP is build using the --enable-rtld-now option).

The configuration priority that PIE-compatible extension maintainers can optionally specify will use that. If not specified by the extension author, the priority used is 80. The priority is only used where the additional INI file directory is specified (shown as Scan this dir for additional .ini files in the info).

@remicollet
Copy link
Member

remicollet commented Dec 18, 2024

I suppose my question is: is there anything similar to phpenmod for the Remi repo?

Again, there is nothing specific to my repository.
All RPM works the same way: installed = enabled (so no phpenmod or similar)

@asgrim
Copy link
Collaborator Author

asgrim commented Dec 18, 2024

@remicollet thanks for confirming! :)

@asgrim asgrim force-pushed the 20-detect-setup-php-ini branch from 8e537ba to d22b827 Compare December 20, 2024 11:34
@asgrim asgrim marked this pull request as ready for review December 20, 2024 11:41
@asgrim asgrim force-pushed the 20-detect-setup-php-ini branch from d22b827 to 5329ebe Compare December 23, 2024 08:08
@asgrim asgrim force-pushed the 20-detect-setup-php-ini branch from dbe0c8a to 8887791 Compare December 23, 2024 09:35
@asgrim asgrim merged commit dc299c3 into php:main Dec 23, 2024
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Detect and automatically set up php.ini entry for installation
3 participants