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

Alternate location for php.ini

P: n/a
Is there a way to set php.ini to the alternate location?

I'm trying to use 2 version of PHP(php4 and php5), but php.ini is in the
way. Anyone knows how to circumvent this issues? Perhaps there is an env
variable we can set.

Thanks
Jul 17 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
Artco News <ar*******@verizon.net> wrote:
Is there a way to set php.ini to the alternate location?

I'm trying to use 2 version of PHP(php4 and php5), but php.ini is in the
way. Anyone knows how to circumvent this issues? Perhaps there is an env
variable we can set.


http://uk.php.net/manual/en/configuration.php

Second paragraph.

JOn

--
You cannot propel yourself forward by patting yourself on the back.

Jul 17 '05 #2

P: n/a
Are you using in CGI mode or SAPI mode? I'm using the SAPI mode. So, when I
run the phpinfo() it still look at my C:\WINDOWS directory.

I did the above definition and stop/start the apache2 and still no go. Any
idea where should you look. Thanks a bunch.

"Andy Hassall" <an**@andyh.co.uk> wrote in message
news:ok********************************@4ax.com...
On Tue, 04 Nov 2003 19:09:57 GMT, "Artco News" <ar*******@verizon.net> wrote:
I did set the PHPRC(c:\php\config) env var as well as
PHP_INI(c:\php\config\php4.ini) env var but still no go.
PHPRC certainly works, I'm using it right now.

FWIW I used / instead of \, i.e. d:/php

Also make sure that your web server actually gets PHPRC in its

environment; it may be different from yours, particularly if it's running as LocalSystem
instead of a named user.

--
Andy Hassall (an**@andyh.co.uk) icq(5747695) (http://www.andyh.co.uk)
Space: disk usage analysis tool (http://www.andyhsoftware.co.uk/space)

Jul 17 '05 #3

P: n/a
On Tue, 04 Nov 2003 19:58:45 GMT, "Artco News" <ar*******@verizon.net> wrote:
Are you using in CGI mode or SAPI mode? I'm using the SAPI mode. So, when I
run the phpinfo() it still look at my C:\WINDOWS directory.

I did the above definition and stop/start the apache2 and still no go. Any
idea where should you look. Thanks a bunch.


As a module under Apache2.

The Apache service will run as a child of SERVICES.EXE; unless you restart
that it's not going to see the new environment. Rebooting is a fairly sure way
of getting it to restart. ;-)

--
Andy Hassall (an**@andyh.co.uk) icq(5747695) (http://www.andyh.co.uk)
Space: disk usage analysis tool (http://www.andyhsoftware.co.uk/space)
Jul 17 '05 #4

P: n/a
I follow your lead and still no go.

First I remove/rename c:\windows\php.ini
Then I created a directory: c:\apps\php\config\php.ini
Then I set envar phprc=c:\apps\php\config(then c:/apps/php/config). And no
luck as well.

I also rebooted my machine. Any ideas. Oh, BTW, I'm running php-4.3.4RC1
"Andy Hassall" <an**@andyh.co.uk> wrote in message
news:vj********************************@4ax.com...
On Tue, 04 Nov 2003 19:58:45 GMT, "Artco News" <ar*******@verizon.net> wrote:
Are you using in CGI mode or SAPI mode? I'm using the SAPI mode. So, when Irun the phpinfo() it still look at my C:\WINDOWS directory.

I did the above definition and stop/start the apache2 and still no go. Anyidea where should you look. Thanks a bunch.
As a module under Apache2.

The Apache service will run as a child of SERVICES.EXE; unless you

restart that it's not going to see the new environment. Rebooting is a fairly sure way of getting it to restart. ;-)

--
Andy Hassall (an**@andyh.co.uk) icq(5747695) (http://www.andyh.co.uk)
Space: disk usage analysis tool (http://www.andyhsoftware.co.uk/space)

Jul 17 '05 #5

P: n/a
On Tue, 04 Nov 2003 21:14:14 GMT, "Artco News" <ar*******@verizon.net> wrote:
I follow your lead and still no go.

First I remove/rename c:\windows\php.ini
Then I created a directory: c:\apps\php\config\php.ini
Then I set envar phprc=c:\apps\php\config(then c:/apps/php/config). And no
luck as well.


It's PHPRC, not phprc.

Is the server picking it up in the environment? Echo out $_ENV['PHPRC'] in a
script.

If not - where did you set it?

--
Andy Hassall (an**@andyh.co.uk) icq(5747695) (http://www.andyh.co.uk)
Space: disk usage analysis tool (http://www.andyhsoftware.co.uk/space)
Jul 17 '05 #6

P: n/a
Thanks, that did it. When in doubt, REBOOT!
Thanks a bunch.

By the way, I was trying to install the latest snaps of PHP5 beta2. I had no
such luck. Perhaps you can give me some pointers. I did exactly what the
install.txt said but still got the following error:

The Apache service named reported the following error:
Cannot load X:/Apps/php/php5/php4apache2.dll into server: The specified
module could not be found. .

For more information, see Help and Support Center at
http://go.microsoft.com/fwlink/events.asp.

"Andy Hassall" <an**@andyh.co.uk> wrote in message
news:ut********************************@4ax.com...
On Tue, 04 Nov 2003 21:14:14 GMT, "Artco News" <ar*******@verizon.net> wrote:
I follow your lead and still no go.

First I remove/rename c:\windows\php.ini
Then I created a directory: c:\apps\php\config\php.ini
Then I set envar phprc=c:\apps\php\config(then c:/apps/php/config). And
noluck as well.


It's PHPRC, not phprc.

Is the server picking it up in the environment? Echo out $_ENV['PHPRC']

in a script.

If not - where did you set it?

--
Andy Hassall (an**@andyh.co.uk) icq(5747695) (http://www.andyh.co.uk)
Space: disk usage analysis tool (http://www.andyhsoftware.co.uk/space)

Jul 17 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.