473,396 Members | 2,014 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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

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
17 15540

~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

~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
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
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
>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
~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
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
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
~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
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
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
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

~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
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
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

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

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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: SP | last post by:
Please advice. I am not familiar with the concepts of windows service. I am trying to access a xml configuration file from windows service. But it is failing. configuration file is in the same...
2
by: muttu2244 | last post by:
hi all could anybody please tell me how can i copy a file from windows file systems like FAT12, FAT16,FAT32 and NTFS to EXT2, and EXT3. Is their any function in python that we can do the above ...
2
by: Steven.Xu | last post by:
how to launch .exe file when windows starting?
3
bajajv
by: bajajv | last post by:
Hi, I have linux and windows xp on my machine. I have a 1 GB file on linux. And I want to access it from windows. I tried by mapping but I am able to get only read only access. But I need to copy...
0
by: zitizonx | last post by:
Hello all, I am looking a way to read the .MBOX file in Windows environment using .Net and write the file content in to HTML files. But I cant find any library files or documentation around...
9
by: akoymakoy | last post by:
Good Day: as the title says i am creating a program that will copy a file from windows to a linux machine. any help would be appreciated. i tried looking for it on google but i dont see a real help....
6
JustRun
by: JustRun | last post by:
I have two windows application projects in the same solution, The solution contains an application that has a reference to another application in the same solution, When I tried to publish the...
0
JustRun
by: JustRun | last post by:
Hi All This is a very urget, Plz answer me I have two windows application projects in the same solution, The solution contains an application that has a reference to another application in the...
1
by: TechBabu | last post by:
I'm trying to read data from config file in windows service in OnStart(), but it is throwing error "Object reference not set to an instance of an object". Is there any seeting required to use config...
1
by: Praveen St | last post by:
Hi, I need a perl script on windows which deletes the newline characters from a file and merges all the lines into one line and then write into another file in windows system %temp%...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.