By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,587 Members | 1,071 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,587 IT Pros & Developers. It's quick & easy.

PHP is looking for php.ini file in c:\windows

P: n/a
As the installation txt suggests, I have left my php.ini file inside
the c:\php directory... but running phpinfo() shows that my php.ini
file is in c:\windows as shown below.

Configuration File (php.ini path) - C:\WINDOWS

Well there is no php.ini file in my windows directory, so I'm not sure
where it's getting it's configuration settings from... unless I suppose
they're built into the executable somewhere if no php.ini file is
found. My questions is - why php is not locating my php.ini file that
is located in the c:\php directory? I'd rather not move it to the
windows directory so I can keep everything nice and tidy like the
installation file suggests.

BTW - This is a brand new laptop I'm installing PHP on so there is (I
just double checked) no PHP.ini file in the c:\windows directory. The
path is set to include c:\php... and opening a DOS prompt and typing
"php" is a recognizable command regardless of my current directory.
This is the 2nd machine I have had this same problem with. I'm still
confused...

Any thoughts?

thanks

Jul 11 '06 #1
Share this Question
Share on Google+
17 Replies


P: n/a

~john wrote:
As the installation txt suggests, I have left my php.ini file inside
the c:\php directory... but running phpinfo() shows that my php.ini
file is in c:\windows as shown below.

Configuration File (php.ini path) - C:\WINDOWS

Well there is no php.ini file in my windows directory, so I'm not sure
where it's getting it's configuration settings from... unless I suppose
they're built into the executable somewhere if no php.ini file is
found. My questions is - why php is not locating my php.ini file that
is located in the c:\php directory? I'd rather not move it to the
windows directory so I can keep everything nice and tidy like the
installation file suggests.

BTW - This is a brand new laptop I'm installing PHP on so there is (I
just double checked) no PHP.ini file in the c:\windows directory. The
path is set to include c:\php... and opening a DOS prompt and typing
"php" is a recognizable command regardless of my current directory.
This is the 2nd machine I have had this same problem with. I'm still
confused...

Any thoughts?

thanks

Well.. either stop IIS then copy the php.ini to \windows, or change the
path setting in your config file.

Jul 11 '06 #2

P: n/a

~john wrote:
As the installation txt suggests, I have left my php.ini file inside
the c:\php directory... but running phpinfo() shows that my php.ini
file is in c:\windows as shown below.

Configuration File (php.ini path) - C:\WINDOWS

Well there is no php.ini file in my windows directory, so I'm not sure
where it's getting it's configuration settings from... unless I suppose
they're built into the executable somewhere if no php.ini file is
found. My questions is - why php is not locating my php.ini file that
is located in the c:\php directory? I'd rather not move it to the
windows directory so I can keep everything nice and tidy like the
installation file suggests.

BTW - This is a brand new laptop I'm installing PHP on so there is (I
just double checked) no PHP.ini file in the c:\windows directory. The
path is set to include c:\php... and opening a DOS prompt and typing
"php" is a recognizable command regardless of my current directory.
This is the 2nd machine I have had this same problem with. I'm still
confused...

Any thoughts?

thanks

Well.. either stop IIS then copy the php.ini to \windows, or change the
path setting in your config file.

Flamer.

Jul 11 '06 #3

P: n/a
Hi John,

Well there is no php.ini file in my windows directory, so I'm not sure
where it's getting it's configuration settings from... unless I suppose
they're built into the executable somewhere if no php.ini file is
found. My questions is - why php is not locating my php.ini file that
is located in the c:\php directory? I'd rather not move it to the
windows directory so I can keep everything nice and tidy like the
installation file suggests.
There are a few options to accomplish this. I usually use the
environment variable PHPRC. Set it to the folder where your php.ini
resides (C:\PHP in your case).
For other options see: http://nl3.php.net/manual/en/configuration.php
HTH.
Peter.
--
http://www.phpforums.nl
Jul 11 '06 #4

P: n/a
I don't want to move the php.ini file to my windows directory. As the
installation text suggests, I'd rather keep everything inside the
c:\php folder.

What do you mean change the path? The path of "doc_root"? It's pointed
to c:\php. Plus It's not going to do much good to change anything in
the .ini file if it's looking for the .ini file in the wrong
location... ie nothing I do in the php.ini file is going to be noticed
since it's not using it unless I copy it to the windows directory.

~john
flamer di******@hotmail.com wrote:
~john wrote:
As the installation txt suggests, I have left my php.ini file inside
the c:\php directory... but running phpinfo() shows that my php.ini
file is in c:\windows as shown below.

Configuration File (php.ini path) - C:\WINDOWS

Well there is no php.ini file in my windows directory, so I'm not sure
where it's getting it's configuration settings from... unless I suppose
they're built into the executable somewhere if no php.ini file is
found. My questions is - why php is not locating my php.ini file that
is located in the c:\php directory? I'd rather not move it to the
windows directory so I can keep everything nice and tidy like the
installation file suggests.

BTW - This is a brand new laptop I'm installing PHP on so there is (I
just double checked) no PHP.ini file in the c:\windows directory. The
path is set to include c:\php... and opening a DOS prompt and typing
"php" is a recognizable command regardless of my current directory.
This is the 2nd machine I have had this same problem with. I'm still
confused...

Any thoughts?

thanks


Well.. either stop IIS then copy the php.ini to \windows, or change the
path setting in your config file.

Flamer.
Jul 11 '06 #5

P: n/a
>Peter van Schie wrote:
For other options see: http://nl3.php.net/manual/en/configuration.php
>From the link...
"Please note that the SetEnv PHPRC "directory/to/phpini/" only works
when using PHP as CGI"

I'm not using the CGI

Jul 11 '06 #6

P: n/a
~john schreef:
>Peter van Schie wrote:
For other options see: http://nl3.php.net/manual/en/configuration.php
>>From the link...

"Please note that the SetEnv PHPRC "directory/to/phpini/" only works
when using PHP as CGI"

I'm not using the CGI
Neither am I, that's simply a faulty statement. But if you really don't
want to use the PHPRC environment variable, use the registry key for
instance. There's enough options.

Peter.

--
http://www.phpforums.nl
Jul 11 '06 #7

P: n/a
On 11 Jul 2006 15:26:50 -0700, "~john" <So********@gmail.comwrote:
>>Peter van Schie wrote:
For other options see: http://nl3.php.net/manual/en/configuration.php
>>From the link...

"Please note that the SetEnv PHPRC "directory/to/phpini/" only works
when using PHP as CGI"

I'm not using the CGI
That user contributed note could be much better worded. It's saying that
SetEnv in httpd.conf won't have any effect on PHP as an Apache module, because
SetEnv in httpd.conf only affects subprocesses spawned by Apache - i.e. CGI.

PHPRC works fine for PHP as Apache module when you set it as an environment
variable for the Apache process itself, i.e. you set it before Apache starts
up.

--
Andy Hassall :: an**@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
Jul 11 '06 #8

P: n/a
Not to be prude but all these "work-arounds" go against what the
included instructions in the official PHP download say to do. It
explicitely says "leave the php.ini file in the c:\php folder"... Did
the PHP team just make a mistake in the installation instructions or is
this a bug with the current release of PHP 5.1.4? It just seems a
little aggravating...

~john
Andy Hassall wrote:
On 11 Jul 2006 15:26:50 -0700, "~john" <So********@gmail.comwrote:
>Peter van Schie wrote:
For other options see: http://nl3.php.net/manual/en/configuration.php
>From the link...
"Please note that the SetEnv PHPRC "directory/to/phpini/" only works
when using PHP as CGI"

I'm not using the CGI

That user contributed note could be much better worded. It's saying that
SetEnv in httpd.conf won't have any effect on PHP as an Apache module, because
SetEnv in httpd.conf only affects subprocesses spawned by Apache - i.e. CGI.

PHPRC works fine for PHP as Apache module when you set it as an environment
variable for the Apache process itself, i.e. you set it before Apache starts
up.

--
Andy Hassall :: an**@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
Jul 12 '06 #9

P: n/a
~john wrote:
Not to be prude but all these "work-arounds" go against what the
included instructions in the official PHP download say to do. It
explicitely says "leave the php.ini file in the c:\php folder"... Did
the PHP team just make a mistake in the installation instructions or is
this a bug with the current release of PHP 5.1.4? It just seems a
little aggravating...

~john
Andy Hassall wrote:
>>On 11 Jul 2006 15:26:50 -0700, "~john" <So********@gmail.comwrote:

>>>>Peter van Schie wrote:
For other options see: http://nl3.php.net/manual/en/configuration.php

From the link...

"Please note that the SetEnv PHPRC "directory/to/phpini/" only works
when using PHP as CGI"

I'm not using the CGI

That user contributed note could be much better worded. It's saying that
SetEnv in httpd.conf won't have any effect on PHP as an Apache module, because
SetEnv in httpd.conf only affects subprocesses spawned by Apache - i.e. CGI.

PHPRC works fine for PHP as Apache module when you set it as an environment
variable for the Apache process itself, i.e. you set it before Apache starts
up.

--
Andy Hassall :: an**@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool

No, it's unclear documentation at all. All versions of PHP I've used
have been that way.

Personally I leave it in the C:\Windows folder, along with other
configuration files. But if you want to leave it in C:\php, you can
either set the environment variable or edit the registry.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Jul 12 '06 #10

P: n/a
Andy Hassall wrote:
That user contributed note could be much better worded. It's saying that
SetEnv in httpd.conf won't have any effect on PHP as an Apache module, because
SetEnv in httpd.conf only affects subprocesses spawned by Apache - i.e. CGI.

PHPRC works fine for PHP as Apache module when you set it as an environment
variable for the Apache process itself, i.e. you set it before Apache starts
up.
But now you have to restart the machine in order to change the path,
since services get their environment from the service manager. A typo?
Another restart.

Really, just stick the file into C:\Windows. People have doing been
this since PHP 3.

Jul 12 '06 #11

P: n/a
Ksu

~john wrote:
Peter van Schie wrote:
For other options see: http://nl3.php.net/manual/en/configuration.php
From the link...

"Please note that the SetEnv PHPRC "directory/to/phpini/" only works
when using PHP as CGI"

I'm not using the CGI
did you try?
autoexec.bat
SET PATH= "directory/to/phpini/"

Jul 12 '06 #12

P: n/a
Follow these steps for Windows

Click Start
Right Click on My Computer and Click Properties
Choose Advanced from the Tabs
Click Environmenr Variables
In the bottom window labeled System Variables look for PATH
Highlight PATH and click Edit
At the end of the path settings add the following assuming php is in
the c:\php folder.

;c:\php

(Caution: Dont erase anything else that was there!

Just in case, check if there is already a path for PHP in the path
settings before you add it.
)

Click Ok until you exit everything.

Restart your computer.


~john wrote:
As the installation txt suggests, I have left my php.ini file inside
the c:\php directory... but running phpinfo() shows that my php.ini
file is in c:\windows as shown below.

Configuration File (php.ini path) - C:\WINDOWS

Well there is no php.ini file in my windows directory, so I'm not sure
where it's getting it's configuration settings from... unless I suppose
they're built into the executable somewhere if no php.ini file is
found. My questions is - why php is not locating my php.ini file that
is located in the c:\php directory? I'd rather not move it to the
windows directory so I can keep everything nice and tidy like the
installation file suggests.

BTW - This is a brand new laptop I'm installing PHP on so there is (I
just double checked) no PHP.ini file in the c:\windows directory. The
path is set to include c:\php... and opening a DOS prompt and typing
"php" is a recognizable command regardless of my current directory.
This is the 2nd machine I have had this same problem with. I'm still
confused...

Any thoughts?

thanks
Jul 12 '06 #13

P: n/a

~john wrote:
As the installation txt suggests, I have left my php.ini file inside
the c:\php directory... but running phpinfo() shows that my php.ini
file is in c:\windows as shown below.

Configuration File (php.ini path) - C:\WINDOWS
Please do as "Paul" suggests...
>use the environment variable PHPRC.
Be sure to restart your PC, since Apache needs to read this env var
after each PC start.

Don't ask, I can't stand it either.

Well there is no php.ini file in my windows directory,
As it shouldn't!!!

And on your note of...
"Please note that the SetEnv PHPRC "directory/to/phpini/" only works
when using PHP as CGI"
Sorry John, this is not correct. Use that ENV VAR.

And Peter, no need to use the registry! I have a complete "linux" type
install with PHP, Perl, mySQL, Apache, all without ANYTHING in the
WINDOWS nor anything in the REGISTRY. (web.torres.ws/walters_way)

And as for the "instructions in the official PHP download", I never
worry about those. So many times they are written by WINDOW-centric
folks, with no thought to installation, backup, maintiance, etc. They
do it the "Windows Way".

I have a complete set of install documents on how set up a PC for PHP
(and other apps) with complete disregard for "The Windows Way".

In regards to Jerrys advice of leaving things in the WINDOWS directory.
All well an good, but, back your system up, replace your OS (from
scratch) and then restore Apache, PHP, Perl, and mySQL less than 10
minutes. Not.

And as for "ImOK' advice on the PATH, don't touch it, unless your going
to use PHP from the command line. (which I do from time to time). IF
you do than I suggest placing this in the PATH var...

;%PHPRC%

That way to change the path in one place and it cascades across as
needed.

Hope this helps you.

PS: I have virutal hosts running on my PC for Apache as well. Helps me
test things better.

Jul 12 '06 #14

P: n/a
ot*******@gmail.com schreef:
And Peter, no need to use the registry! I have a complete "linux" type
install with PHP, Perl, mySQL, Apache, all without ANYTHING in the
WINDOWS nor anything in the REGISTRY. (web.torres.ws/walters_way)
I didn't say he *had* to. ;) It was just another suggestion besides
using the PHPRC env var, because he seemed reluctant using it. Not sure
why though.

Regards,
Peter.
--
http://www.phpforums.nl
Jul 12 '06 #15

P: n/a
I already did that when I first installed PHP... I've installed PHP
many many times on both Windows and Linux systems.

~john
ImOk wrote:
Follow these steps for Windows

Click Start
Right Click on My Computer and Click Properties
Choose Advanced from the Tabs
Click Environmenr Variables
In the bottom window labeled System Variables look for PATH
Highlight PATH and click Edit
At the end of the path settings add the following assuming php is in
the c:\php folder.

;c:\php

(Caution: Dont erase anything else that was there!

Just in case, check if there is already a path for PHP in the path
settings before you add it.
)

Click Ok until you exit everything.

Restart your computer.


~john wrote:
As the installation txt suggests, I have left my php.ini file inside
the c:\php directory... but running phpinfo() shows that my php.ini
file is in c:\windows as shown below.

Configuration File (php.ini path) - C:\WINDOWS

Well there is no php.ini file in my windows directory, so I'm not sure
where it's getting it's configuration settings from... unless I suppose
they're built into the executable somewhere if no php.ini file is
found. My questions is - why php is not locating my php.ini file that
is located in the c:\php directory? I'd rather not move it to the
windows directory so I can keep everything nice and tidy like the
installation file suggests.

BTW - This is a brand new laptop I'm installing PHP on so there is (I
just double checked) no PHP.ini file in the c:\windows directory. The
path is set to include c:\php... and opening a DOS prompt and typing
"php" is a recognizable command regardless of my current directory.
This is the 2nd machine I have had this same problem with. I'm still
confused...

Any thoughts?

thanks
Jul 13 '06 #16

P: n/a

ot*******@gmail.com wrote:
And as for "ImOK' advice on the PATH, don't touch it, unless your going
to use PHP from the command line. (which I do from time to time). IF
you do than I suggest placing this in the PATH var...

;%PHPRC%

That way to change the path in one place and it cascades across as
needed.

Hope this helps you.


Thanks, I'll give this a shot.

~john

Jul 13 '06 #17

P: n/a

Peter van Schie wrote:
I didn't say he *had* to. ;) It was just another suggestion besides
using the PHPRC env var, because he seemed reluctant using it. Not sure
why though.

Regards,
Peter.

Not reluctant... I guess my main concern was why the official
instructions were off I suppose :P

thanks for all your help,

~john

Jul 13 '06 #18

This discussion thread is closed

Replies have been disabled for this discussion.