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

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • ~john

    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

  • flamer die.spam@hotmail.com

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


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

    Comment

    • flamer die.spam@hotmail.com

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


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

      Comment

      • Peter van Schie

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

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

        Comment

        • ~john

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

          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 die.spam@hotmai l.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.

          Comment

          • ~john

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

            >Peter van Schie wrote:
            >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

            Comment

            • Peter van Schie

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

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

              --

              Comment

              • Andy Hassall

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

                On 11 Jul 2006 15:26:50 -0700, "~john" <SonVoltMMA@gma il.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 :: andy@andyh.co.u k :: http://www.andyh.co.uk
                http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool

                Comment

                • ~john

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

                  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" <SonVoltMMA@gma il.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 :: andy@andyh.co.u k :: http://www.andyh.co.uk
                  http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool

                  Comment

                  • Jerry Stuckle

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

                    ~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" <SonVoltMMA@gma il.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 :: andy@andyh.co.u k :: 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.
                    jstucklex@attgl obal.net
                    =============== ===

                    Comment

                    • Chung Leong

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

                      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.

                      Comment

                      • Ksu

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


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

                        Comment

                        • ImOk

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

                          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

                          Comment

                          • otrWalter@gmail.com

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


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

                            Comment

                            • Peter van Schie

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

                              otrWalter@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.
                              --

                              Comment

                              Working...