Edit report at https://bugs.php.net/bug.php?id=62797&edit=1

 ID:                 62797
 Updated by:         larue...@php.net
 Reported by:        mathias at qiwi dot be
 Summary:            Add a CLI parameter to override php.ini settings for
                     a web server instance
-Status:             Open
+Status:             Not a bug
 Type:               Feature/Change Request
 Package:            Built-in web server
 Operating System:   OS X 10.8
 PHP Version:        5.4.6RC1
 Block user comment: N
 Private report:     N

 New Comment:

php54 -d include_patch=".:/foo/bar:/baz/qux"   -S localhost:8000


Previous Comments:
------------------------------------------------------------------------
[2012-08-11 11:13:29] 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.



------------------------------------------------------------------------



-- 
Edit this bug report at https://bugs.php.net/bug.php?id=62797&edit=1

Reply via email to