SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    midnight coder
    Join Date
    Dec 2000
    Location
    The flat edge of the world
    Posts
    838
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I don't wanna put the php.ini file in the Windows directory, I like to keep everything in the same place, how can I get PHP to read the php.ini file which is in the same place as php.exe

    Right now, when the php.ini file is in the php.exe folder, the changes I make doesn't show up in phpinfo.

    Running as module, restarted Apache everytime...

    Using Win2000, Apache, PHP4

  2. #2
    SitePoint Wizard
    Join Date
    Mar 2001
    Posts
    3,537
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    Contrary to what all the tutorials and istallation instructions say, it is totally unnecessary to put php.ini in your Windows directory. Leave it where you found it and php will check its own directory for php.ini before it goes looking in the Windows directory. At least that works for me, but I am running php4 as cgi, not a module, on win98.

  3. #3
    midnight coder
    Join Date
    Dec 2000
    Location
    The flat edge of the world
    Posts
    838
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That's what I thought, I would change the session.save_path, restart Apache, and phpinfo would still say /tmp...

    Maybe it does have something to do with module, I'll trying running as CGI...I'm running as module 'cos it's faster, and since it's only for testing, nothing heavy gets on it so it's completely stable.

  4. #4
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What is the problem with keeping the php.ini file in the Windows directory, god forbid you might have to navigate to the windows directory to edit it. That was where it was made to be.

    Why do you want to go from Module to CGI? Just so you can keep the ini file in your php dir? Just seems like a bad tradeoff, lose all my speed and stableness so I can keep my ini file in the php dir instead of the Windows dir.

    Just some stuff for you to chew on before changing everything around.
    Please don't PM me with questions.
    Use the forums, that is what they are here for.

  5. #5
    midnight coder
    Join Date
    Dec 2000
    Location
    The flat edge of the world
    Posts
    838
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It's just that I format my computer quite often, to do other tests on hardware/software. And it's kinda easy to forget to backup that php.ini file. But if I have it in my php dir, which is in another partition of the computer, I can format, and Apache, MySQL and PHP will still work perfectly straight away.

    I'm only using this machine for testing, and the only one Apache serving the pages to is me, so there isn't any heavy loads, and the MySQL db wouldn't have anything more than 10 rows in each table, 'cos well...it's a test.

    Of course, if there's a way to get the module PHP to read the php.ini file from it's dir, that would be the best alternative.

  6. #6
    SitePoint Wizard
    Join Date
    Jul 1999
    Location
    Chicago
    Posts
    2,629
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    In the top of php.ini, there is this comment:

    ; This file controls many aspects of PHP's behavior. In order for PHP to
    ; read it, it must be named 'php.ini'. PHP looks for it in the current
    ; working directory, in the path designated by the environment variable
    ; PHPRC, and in the path that was defined in compile time (in that order).
    ; Under Windows, the compile-time path is the Windows directory. The
    ; path in which the php.ini file is looked for can be overriden using
    ; the -c argument in command line mode.

    That should help a bit.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •