Skip to content

[Plugin Update] PHP Plugin should include a basic php.ini in the user's project #1035

@Lagoja

Description

@Lagoja

First reported by @jrseliga in the Devbox Discord

Current Experience

  • The PHP Nix package installs the php.ini file in the Nix Store, where it cannot be edited through normal means.

Desired Experience

  • Developers should have a way to modify the settings in php.ini for their project.

Current Workarounds

  • Developers can currently install PHP extensions by including them in their package list. This should work for installing any PHP extensions that do not require additional php.ini config. See our example for more details
"packages": [
     "php@latest",
     "phpExtensions.xdebug"
]
  • If developers want to add a custom extension or modify the config via Nix, they can do this with a Flake as shown in this example.

Some Ideas for Improvement:

  1. Users can configure a .user.ini file in their local project to override some settings for their local project. This is a bit limited in which settings can be overridden, but may work for most cases. We can update our plugin to create this file by default + point PHP to it's location.
  2. Our plugin can modify PHP so that it looks for the php.ini file in the local project directory. This would make it editable, but would also result in a copy of PHP being installed for each project. Might be best to set as an option
  3. Add a way to pass a php.ini file or additional config that will be added to the php.ini file in the Nix store when building PHP for the project.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions