473,883 Members | 1,741 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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
17 15596
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 "instructio ns 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
12323
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 directory from where I install windows service. I dont want to give an absolute path to the location of file. When I try to start windows service, it is expecting the XML file to be in c:\windows\system32\. Please let me know whether there is a...
2
4506
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 Thanks in advance Yogi
2
1886
by: Steven.Xu | last post by:
how to launch .exe file when windows starting?
3
1574
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 it. Can you suggest any method for that. Its urgent. Thanks.
0
1030
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 this. Anyone have any experience around this? Any help? Thanks in heaps ! Rav
9
9982
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. a sample code will be a huge help.. ive tried a few times but to no avail and im running out of ideas thanks in advance
6
4385
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 project that contains the reference it gave me that error : Error 8 :Could not find file 'Microsoft.Windows.CommonLanguageRuntime, Version=2.0.50727.0 And another question: If I will use the project 1 with all my project is it correct to make...
0
1738
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 same solution, When I tried to publish the project that contains the reference it gave me that error : Error 8 :Could not find file 'Microsoft.Windows.CommonLanguageRuntime, Version=2.0.50727.0
1
2324
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 file in Windows Service. my config file name as <appName>.exe.config. Even I placed it in the System32 folder also. Plz help me out how to handle config file in Windows Service. I'm using VS2008, C#. Thanks in advance.
1
2496
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% directory. For example, this script is to delete newlines and create a sigle line and write into another file in %TEMP% I have script which deletes the newlines but the output goes to STDOUT I am not able to create a file in %TEMP% and redirect the...
0
9944
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
11153
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10860
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7975
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7134
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5804
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4620
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4225
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3239
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.