#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2007
    Posts
    7
    Rep Power
    0

    Question about httpd conf


    Hi! I need to install apache and was told that PHPIniDir needs to be set. I downloaded apache_2.2.6-win32-x86-no_ssl.msi. However when I install apache, the httpd conf is different from what I was given as a sample and what I see as examples on the internet. There's no "Section 1: Global Environment" where the PHPIniDir is supposed to be set and in fact no
    The configuration directives are grouped into three basic sections:
    # 1. Directives that control the operation of the Apache server process as a
    # whole (the 'global environment').
    # 2. Directives that define the parameters of the 'main' or 'default' server,
    # which responds to requests that aren't handled by a virtual host.
    # These directives also provide default values for the settings
    # of all virtual hosts.
    # 3. Settings for virtual hosts, which allow Web requests to be sent to
    # different IP addresses or hostnames and have them handled by the
    # same Apache server process.
    Can someone tell me a possible reason why?
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2006
    Posts
    262
    Rep Power
    47
    httpd.conf has a history of being a -huge- file. Pushing 2000 lines, for a default install. Many, many people have had a try at making the file more approachable. On top of that, as different/newer versions of Apache have come out, the basic syntax and layout of the file has changed. 1.x has a radically different layout (and is generally the most likely to have exactly the comments you're looking for) than 2.0.x or 2.2.x.

    Some important general tips:

    1. The httpd.conf file can include other files by the line "Include /path/to/file.conf". So you can (and many people have) move large swaths of the file into other files, just to clean up the organization.

    2. Directives in httpd.conf files are parsed in order. So if you define something, then later in the file it is defined again, the later definition takes precedence. This can get confusing if you get really excited about breaking the configuration into files, but generally isn't a problem.

    3. With some exceptions, any directive can appear anywhere in any httpd.conf file. httpd.conf files have several directives which limit the scope of a directive, most notably <Directory> or <VirtualHost>. But, so long as you don't put the PHPIniDir in a container, you can make it the first or last line in the file. You don't need to hunt up a "proper" location for it. Where you can find it again is more important.

    4. The general layout of the file described in the comments you're looking for is just an organization of convenience, guided by an implicit logical flow. The basic structure is still followed, even if the comments are no longer there. It just gives you an idea where to look for a setting you want to change. Rather handy in a 2k text file. ^_^

    Comments on this post

    • jharnois agrees
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2007
    Posts
    7
    Rep Power
    0
    Thanks a lot!

    I also found a possible reason my sample file already has PHPIniDir. Installing PHP automatically edits httpd.conf and adds PHPIniDir. But I wouldn't have looked for that if not for your reply.
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2006
    Posts
    262
    Rep Power
    47
    Which is another odd thing with PHP installs. Sometimes it edits httpd.conf, sometimes it doesn't. Sometimes if you re-install PHP, it will add it's directives again (making 2 copies in httpd.conf) and sometimes it will detect that the directives are there and leave it alone.

    Generally, I just scratch my head at PHP, and make sure the directives are in there somewhere... ^_^
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2007
    Posts
    7
    Rep Power
    0
    I've been having problems with PHP install myself.

    Using this:
    msiexec /i php-5.2.5-win32-installer.msi /qn ADDLOCAL=apache22 APACHEDIR="C:\Program Files\Apache Software Foundation\Apache2.2\conf" /l*v error.log

    An error comes up that says Error trying access httpd.conf file. You will need to manually configure the web server.

    At the error log:
    PROPERTY CHANGE: Modifying APACHEDIR property. Its current value is 'C:\Program Files\Apache Software Foundation\Apache2.2\conf'. Its new value: 'C:\'.

    I don't know why it's trying to change this property.
  10. #6
  11. No Profile Picture
    I haz teh codez!
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Dec 2003
    Posts
    2,574
    Rep Power
    2342
    I'm not positive, but APACHEDIR probably needs to point to the root of the install (C:\Program Files\Apache Software Foundation\Apache2.2) rather the conf subdirectory. I'm betting it's looking for the conf file @ conf/conf/httpd.conf.
  12. #7
  13. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2007
    Posts
    7
    Rep Power
    0
    No, that doesn't work either. It still does that "Modifying APACHEDIR property".
  14. #8
  15. No Profile Picture
    I haz teh codez!
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Dec 2003
    Posts
    2,574
    Rep Power
    2342
    OK, I think I got to the bottom of this. The APACHEDIR is being reset because the MSI file may be wrong. To fix this, you need to do the following (after making a copy of the original MSI file):

    1. If you don't have the Windows SDK Windows Installer components, specifically Orca.exe, you will need to download the SDK. I suppose you could also google orca.exe and try to find it that way.

    2. Once you've got Orca installed, open the original MSI file with Orca.

    3. When the MSI is opened, click on the AppSearch table in the left frame. Now note in the right frame that there is an APACHEDIR property and its signature is apacheconf.

    4. Next, note that there is a signature table in the left frame. Click on that and you'll see only one signature, that of CheckFile. The apacheconf signature, i.e., the file to look for, is missing!

    5. With the signature table selected, select Add Row from the Tables menu.

    6. For the Signature field, type "apacheconf" (without the quotes).

    7. For the FileName field, type "httpd.conf" (without the quotes).

    8. Save the new MSI file.

    9. Run the new MSI as you did initially.
  16. #9
  17. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2007
    Posts
    7
    Rep Power
    0
    That seems to work. Thanks a lot!!

    (sorry for the late reply. went on vacation )
  18. #10
  19. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2009
    Posts
    3
    Rep Power
    0

    httpd.conf. The same problem as original poster but not working


    Originally Posted by ptr2void
    OK, I think I got to the bottom of this. The APACHEDIR is being reset because the MSI file may be wrong. To fix this, you need to do the following (after making a copy of the original MSI file):

    1. If you don't have the Windows SDK Windows Installer components, specifically Orca.exe, you will need to download the SDK[/url]. I suppose you could also google orca.exe and try to find it that way.

    2. Once you've got Orca installed, open the original MSI file with Orca.

    3. When the MSI is opened, click on the AppSearch table in the left frame. Now note in the right frame that there is an APACHEDIR property and its signature is apacheconf.

    4. Next, note that there is a signature table in the left frame. Click on that and you'll see only one signature, that of CheckFile. The apacheconf signature, i.e., the file to look for, is missing!

    5. With the signature table selected, select Add Row from the Tables menu.

    6. For the Signature field, type "apacheconf" (without the quotes).

    7. For the FileName field, type "httpd.conf" (without the quotes).

    8. Save the new MSI file.

    9. Run the new MSI as you did initially.
    Funny, I was having the same problem and I opened the .msi file with orca and there was no APACHEDIR property but was an APACHEREGDIR property whose signature is apacheRegistry. So I created an APACHEDIR property with signature apacheconf, and proceeded to the Signature table and added the row as you specified. I saved the installer and reran it and still get the same message. Can you help me at all?

    HOw would I go about manually configuring the web server
    because of something like the message "httpd.conf file. manually configure the web server". Can someone help point me to a source that will tell me?
    Last edited by EdCompSci; May 8th, 2009 at 01:16 AM. Reason: add moer to my question
  20. #11
  21. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2009
    Posts
    3
    Rep Power
    0

    Uh I think I found the answer at a website


    Originally Posted by EdCompSci
    Funny, I was having the same problem and I opened the .msi file with orca and there was no APACHEDIR property but was an APACHEREGDIR property whose signature is apacheRegistry. So I created an APACHEDIR property with signature apacheconf, and proceeded to the Signature table and added the row as you specified. I saved the installer and reran it and still get the same message. Can you help me at all?

    HOw would I go about manually configuring the web server
    because of something like the message "httpd.conf file. manually configure the web server". Can someone help point me to a source that will tell me?

    said to add this code to the httpd.conf file:

    CODE
    LoadModule php5_module "c:/php/php5apache2_2.dll"
    AddType application/x-httpd-php .php

    and also configure the path to php.ini and add this line:
    CODE
    PHPIniDir "C:/php/"

    Save and close the file and restart Apache. To test the installation, paste the following code
    CODE

    to wordpad, rename it to phpinfo.php and copy it to htdocs folder. In your browser type: http://localhost/phpinfo.php and you should have a screen with Server related information and variables.

IMN logo majestic logo threadwatch logo seochat tools logo