php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #62797 Add a CLI parameter to override php.ini settings for a web server instance
Submitted: 2012-08-11 11:13 UTC Modified: 2012-08-12 02:34 UTC
From: mathias at qiwi dot be Assigned:
Status: Not a bug Package: Built-in web server
PHP Version: 5.4.6RC1 OS: OS X 10.8
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
44 - 39 = ?
Subscribe to this entry?

 
 [2012-08-11 11:13 UTC] mathias at qiwi dot be
Description:
------------
During development, it can be useful to override certain php.ini settings for 
specific server instances (using the PHP built-in web server).

Of course, it’s possible to edit `php.ini` every time this is needed, (or use 
`ini_set` in the PHP code where applicable), but for small changes it would be 
very useful to just be able to specify the setting and its value as a command 
line argument/value pair.

For example, to start a test server with a custom `include_path` setting 
(without overriding `php.ini` or changing the existing PHP code by adding 
`ini_set()` calls):

    php -S localhost:8000 --set "include_path=.:/foo/bar:/baz/qux"

The syntax is just an example. Perhaps you’d prefer to do it a bit differently, 
and allow people to point to a project-specific `php.ini` file:

    php -S localhost:8000 --ini "./project.ini"

However, I’d strongly prefer the first solution.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-08-12 02:34 UTC] laruence@php.net
-Status: Open +Status: Not a bug
 [2012-08-12 02:34 UTC] laruence@php.net
php54 -d include_patch=".:/foo/bar:/baz/qux"   -S localhost:8000
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 10:01:26 2024 UTC