ID:               21783
 User updated by:  [EMAIL PROTECTED]
 Reported By:      [EMAIL PROTECTED]
 Status:           Wont fix
 Bug Type:         *Configuration Issues
 Operating System: Windows NT 4.0
 PHP Version:      4.3.0
 New Comment:

Thank you for that link.  None the less, people reading the
features.commandline.php won't necessarily read the configuration.php
page.

Gee, take me for example! :)  I spent a significant amount of time
trying to figure out what was going on.  Checked the command line page
in the manual, all of the user comments, the newsgroup archives and the
bug database.  All of which turned up nothing, hence my bug report.

So, a simple mention of the situation and a cross reference link to
configuration.php would be helpful.

Heck, I'm fairly PHP literate and a good sleuth, but wound up using
your time anyway.  This minor documentation tweak will save everyone
grief in the long run.

Of course, I could add a user comment, but that doesn't have the same
impact.

Thanks for your consideration,

--Dan


Previous Comments:
------------------------------------------------------------------------

[2003-01-20 19:51:29] [EMAIL PROTECTED]

PHPRC environmental variable (and other ways of finding it) are
documented at:

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

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

[2003-01-20 19:44:22] [EMAIL PROTECTED]

Okay.  Then, can you please change this into a documentation bug?  The
features.commandline.php pages should really explain this.

For the clarity of other people reading this, the simple, long-term
solution is creating an environment variable named PHPRC and setting it
to the path of where your php.ini file resides.  For example,
"c:\progra~1\php"

Thanks,

--Dan

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

[2003-01-20 19:05:54] [EMAIL PROTECTED]

This is how cli is designed to work (not to look for php.ini in the
current working directory) and it won't change.

You can achieve the desired behaviour by issuing:

set PHPRC=.

on the command line, or setting this environmental variable elsewhere
in the system.

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

[2003-01-20 17:29:50] [EMAIL PROTECTED]

Hi:

Please pardon the initial background if it's irrelevant, but I figured
it may come into play somehow...

Been using PHP for years, just fine.  It's installed in
f:\progra~1\php.  That dir is in my Path, so I keep the php.ini and
various dll's there to make upgrading easy.

Installed latest version, 4.3.0, by moving old version to backup
directory and unzipping binaries into f:\progra~1\php.

Edited php.ini to my tastes.

After running into problems with CLI not finding my php.ini file, I ran
some tests.  The test script contains:

   echo 'include_path...  ' . ini_get('include_path') . "\n";
   echo 'cfg_file_path... ' . get_cfg_var('cfg_file_path') . "\n";

Now I open up command line window and execute:
   > cd progra~1\php
   > php ./script

Has the right output:
   include_path...  .;f:\progra~1\pear
   cfg_file_path... F:\PROGRA~1\php\php.ini

But, running the CLI does not:
   > cli\php ./script

   include_path...  .;c:\php4\pear
   cfg_file_path...

If I copy php.ini to the cli directory, the expected results are
obtained.

One assumes the CLI version would be smart enough to look up one
directory level or in the Path for the php.ini.

Of course, I can specify the config file via the -c flag, but that's
awkward for general use and is counter-intuitive.

I hope the behavior of the CLI executable will be changed accordingly,
please.

Thanks,

--Dan

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


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

Reply via email to