Setting custom path to php.ini (not in Apache) -


i'm trying learn symfony "requires" using php in command line / terminal tasks.

i store php.ini in /apache2/conf directory, have server configs @ 1 place (and not having deal windows' uac everytime change something). in apache, it's no problem set default php.ini location via

phpinidir "c:/apache2/conf" 

however, when running php terminal - not through apache server - looks file in c:\windows directory default, although there's none there:

c:\>php -i ... configuration file (php.ini) path => c:\windows loaded configuration file => (none) scan dir additional .ini files => (none) additional .ini files parsed => (none) ... 

of course, can bypass using php -c c:\apache2\conf ... everytime use i'd prefer more easy , permanent solution.

is possible? in advance!

http://www.php.net/manual/en/configuration.file.php

php.ini searched in these locations (in order):

  • sapi module specific location (phpinidir directive in apache 2, -c command line option in cgi , cli, php_ini parameter in nsapi, php_ini_path environment variable in thttpd)

  • the phprc environment variable. before php 5.2.0 checked after registry key mentioned below.

  • as of php 5.2.0, location of php.ini file can set different versions of php. following registry keys examined in order: [hkey_local_machine\software\php\x.y.z], [hkey_local_machine\software\php\x.y] , [hkey_local_machine\software\php\x], x, y , z mean php major, minor , release versions. if there value inifilepath in these keys, first 1 found used location of php.ini (windows only).

  • [hkey_local_machine\software\php], value of inifilepath (windows only).

  • current working directory (except cli)

  • the web server's directory (for sapi modules), or directory of php (otherwise in windows)

  • windows directory (c:\windows or c:\winnt) (for windows), or --with-config-file-path compile time option

in addition of php 5.3, can use per-directory .ini files. see http://php.net/manual/en/configuration.file.per-user.php


Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -