SitePoint Sponsor

User Tag List

Results 1 to 25 of 25
  1. #1
    SitePoint Guru
    Join Date
    Feb 2002
    Location
    NZ
    Posts
    620
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Installing Apache/PHP

    This is a new install on windows XP (or a re-install after the first didn't go well)

    I'm installing Apache_1.3.27-win32-x86-no_src.msi

    All seems to be fine with the installation as I get no complaints from Apache on startup.

    I've installed php-4.3.0-win32

    I have put php4ts.dll into the sapi folder with php4apache.dll (apache gave me problems with it anywhere else)

    I have put my php.ini file into C:\windows and changed these lines:
    Removed the ; from: Colors for Syntax Highlighting mode

    Not sure if I uncommented this or if it was already done:
    ; Windows: "\path1;\path2"
    include_path = ".;c:\php\includes"

    Added this:
    ; Directory in which the loadable extensions (modules) reside.
    extension_dir = c:\php\extensions

    Also added:
    doc_root = C:\Program Files\Apache Group\Apache\htdocs

    Set sessions.save_path:
    session.save_path = C:/windows/tmp (for some reason we went from backslash \ to forwardslash / here)

    And thats about it for my ini file

    Now for my httpd.conf file I changed (or added)
    Underneath LoadModule I placed this:

    LoadModule php4_module C:/php/sapi/php4apache.dll
    AddType application/x-httpd-php .php4 .php .php3
    AddType application/x-httpd-php-source .phps

    Should I comment this out as its only for test purposes:
    # AccessFileName: The name of the file to look for in each directory
    # for access control information.
    #
    AccessFileName .htaccess

    Thats about it, problem is if I put info.php into the address bar all I get is a box for a file download.Funny thing is that if I click open, it opens my info.php file and I get to see: <?php phpinfo(); ?>

    Thanks to all who have helped to date.
    Last edited by Motivated; Jan 2, 2003 at 03:50.

  2. #2
    ********* Wizard silver trophy Cam's Avatar
    Join Date
    Aug 2002
    Location
    Burpengary, Australia
    Posts
    4,495
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)
    You haven't set up PHP as an application type in the Apache config.

    Although there can be a few variations of configuring PHP
    under Apache, these are simple enough to be used by the
    newcomer. Please consult the Apache Docs for further
    configuration directives.

    Now that version 4.1 introduces a safer sapi module, we recommend
    that you configure PHP as a module in Apache.

    To do this, you should move php4ts.dll to the windows/system (for Windows 9x/Me)
    or winnt/system32 (for Windows NT/2000/XP) directory, overwriting any
    older file. Then you should add the following three lines to your Apache
    conf file: (swap c:/php/ for your PHP install path)

    LoadModule php4_module c:/php/sapi/php4apache.dll
    AddModule mod_php4.c
    AddType application/x-httpd-php .php

    If you wish to install PHP as a CGI binary, (the sapi is much better)
    you need to enable the apache security fix in your php.ini by
    setting cgi.force_redirect = 1. Then, insert these lines to your conf file:

    ScriptAlias /php/ "c:/php/"
    AddType application/x-httpd-php .php
    Action application/x-httpd-php "/php/php.exe"

  3. #3
    SitePoint Guru
    Join Date
    Feb 2002
    Location
    NZ
    Posts
    620
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Am I reading something wrong ??

    Isn't this:
    ScriptAlias /php/ "c:/php/"
    AddType application/x-httpd-php .php
    Action application/x-httpd-php "/php/php.exe"

    needed if you are setting php as a cgi binary.

    I'm trying to set this up as a module.

    Some-one please clarify

  4. #4
    ********* Wizard silver trophy Cam's Avatar
    Join Date
    Aug 2002
    Location
    Burpengary, Australia
    Posts
    4,495
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)
    Did you read the install.txt file? It says to copy files from the SAPI directory to the SYSTEMROOT, either C:\WINDOWS\SYSTEM or C:\WINNT\SYSTEM32.

    Also, php4ts.dll needs to be in the SYSTEMROOT as well and no other place will work.

  5. #5
    SitePoint Guru
    Join Date
    Feb 2002
    Location
    NZ
    Posts
    620
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes I did read the install.txt, but I also read a trouble shooting thread that suggested that if you get errors (which I was) the install dll's into sapi folder, this removed the errors I was getting. I also uninstalled "QoS packet scheduler"

    I know I'm missing something and I appreciate the time you are putting in.

  6. #6
    ********* Wizard silver trophy Cam's Avatar
    Join Date
    Aug 2002
    Location
    Burpengary, Australia
    Posts
    4,495
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)
    Well the problem that you are having suggests to me that you haven't got the ApplicationType setup correctly but your first posts shows that you do so I'm sorry but I can't help.

  7. #7
    ********* wombat firepages's Avatar
    Join Date
    Jul 2000
    Location
    Perth Australia
    Posts
    1,717
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    DJ P@CkMaN sticking the php4ts.dll & php4ts.lib in the PHP/SAPI directory is about as foolproof as it gets. (it also lets you run multiple versions of PHP across different servers/apps should you wish to do such a thing.)

  8. #8
    SitePoint Guru
    Join Date
    Feb 2002
    Location
    NZ
    Posts
    620
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hey Firepages

    From our previous thread (quote from you)
    if not you have other config problems with apache, to check the configuration open a dos prompt and type

    c:\path\to\apache\apache.exe -t

    and note any errors reported there.

    So tell me if I'm doing this correct:
    Start
    Programs
    Accessories
    Command Prompt

    Now I'm guessing thats what you meant ??

    I have the full path in my browser which is:
    C:\program files\apache group\apache

    Now if I put into my command prompt:
    C:\>program files\apache group\apache\apache.exe -t

    All I get is:
    apache is not recognised as an internal or external command,operable program or batch file

    So tell me I'm an idiot and what I'm doing wrong.
    Last edited by Motivated; Jan 2, 2003 at 20:36.

  9. #9
    ********* wombat firepages's Avatar
    Join Date
    Jul 2000
    Location
    Perth Australia
    Posts
    1,717
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi, perhaps its an issue with DOS names ? save the following as tester.bat (save it anywhere)

    Code:
    cd C:\PROGRA~1\APACHE~1\APACHE
    apache.exe -t
    PAUSE
    then double-click it for an error message, if you dont even get the error message (or a Syntax OK msg) then you have a bigger problem.

    to see what else you can do from the command line change the '-t' to '-help'

  10. #10
    SitePoint Guru
    Join Date
    Feb 2002
    Location
    NZ
    Posts
    620
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Heres the results:
    C:\program files\apache group\apache\htdocs>cd C:\PROGRA~1\APACHE~1\APACHE
    The system cannot find the path specified
    C:\program files\apache group\apache\htdocs>apache.exe -t
    'apache.exe' is not recognised as an internal or external command,operable program or batch file.
    C:\program files\apache group\apache\htdocs>pause
    Press any key to continue.

    I uninstalled my firewall, I've disconnected from the internet and am using another computer for outside contact, and I cant see that either my anti-virus (AVG) or firewall (OUTPOST) would be causing any problems as I used these on win98 with no probs

    If I put http://localhost in the address bar I get that good looking apache window.

    Heeeeeeeeeeelp
    Last edited by Motivated; Jan 3, 2003 at 01:01.

  11. #11
    ********* Wizard silver trophy Cam's Avatar
    Join Date
    Aug 2002
    Location
    Burpengary, Australia
    Posts
    4,495
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)
    Type this in when you first open the Command Prompt.
    cd\Program Files\Apache Group\Apache
    and then hit Enter and it should look something like this -
    Code:
    C:\Program Files\Apache Group\Apache>
    Then type in
    apache -t
    and you will see the error messages or any other problems Apache recognises.

  12. #12
    SitePoint Guru
    Join Date
    Feb 2002
    Location
    NZ
    Posts
    620
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yep, I feel like a dork ! (forgot about cd)

    Anyways thanks.

    Heres the results:
    C:/Program Files/Apache Group/Apache/conf/httpd.conf:SYNTAX OK
    [fri JAN 03 20:36:14 2003] [error] cannot remove module mod_php4.C: not found in module list


    And that just about does it.

  13. #13
    ********* wombat firepages's Avatar
    Join Date
    Jul 2000
    Location
    Perth Australia
    Posts
    1,717
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    here ... http://www.firepages.org/public/httpd.conf.txt is a simple httpd.conf which should work for your setup, make a backup of your existing httpd.conf then save the page contents as httpd.conf - & see if that works.

  14. #14
    SitePoint Guru
    Join Date
    Feb 2002
    Location
    NZ
    Posts
    620
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well that didn't work, all I get is a complaint about a SYNTAX ERROR and I cant even bring up the test page for apache. I replaced the original httpd.conf and I get the test page back with localhost but I'm still getting the pop up for a file download with localhost/info.php.

    This has got me screwed.
    Give me back win98

  15. #15
    No. Phil.Roberts's Avatar
    Join Date
    May 2001
    Location
    Nottingham, UK
    Posts
    1,142
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    How a about you post a link to your own httdp.conf, then someone can add the neccessary lines and post it back again?
    THE INSTRUCTIONS BELOW ARE OLD AND MAY BE INACCURATE.
    THIS INSTALL METHOD IS NOT RECOMMENDED, IT MAY RUN
    OVER YOUR DOG. <-- MediaWiki installation guide

  16. #16
    SitePoint Guru
    Join Date
    Feb 2002
    Location
    NZ
    Posts
    620
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If this keeps up I'll go to a free site and post it there, but I would rather not abuse their service like that.

    Could it be something in my Administrative Tools:
    Component services
    Computer Management
    Data Sources
    Performance
    Services (looks like a shortcut to a driver)

    I've found others with the same problem but no answers.

  17. #17
    No. Phil.Roberts's Avatar
    Join Date
    May 2001
    Location
    Nottingham, UK
    Posts
    1,142
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No, you're most likely just not doing it correctly. Nothing in the control panel has a direct effect on Apache.

    And why do you consider posting your apache conf to a free server "abusing their services"?? Its just a text file, they wont care.

    Originally posted by Motivated
    If this keeps up I'll go to a free site and post it there, but I would rather not abuse their service like that.

    Could it be something in my Administrative Tools:
    Component services
    Computer Management
    Data Sources
    Performance
    Services (looks like a shortcut to a driver)

    I've found others with the same problem but no answers.
    THE INSTRUCTIONS BELOW ARE OLD AND MAY BE INACCURATE.
    THIS INSTALL METHOD IS NOT RECOMMENDED, IT MAY RUN
    OVER YOUR DOG. <-- MediaWiki installation guide

  18. #18
    SitePoint Guru
    Join Date
    Feb 2002
    Location
    NZ
    Posts
    620
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    With nothing better to do I went into a couple of old httpd.conf files I had from previous installs on win98.

    PHP just wasn't being started/recognised or something.
    Anyway I've added a line:

    LoadModule php4_module C:/php/sapi/php4apache.dll
    AddType application/x-httpd-php .php4 .php .php3
    AddType application/x-httpd-php-source .phps

    Action application/x-httpd-php /php/sapi/php.exe

    Now with localhost/info.php I dont get the download file box but instead get a 404 error.

    I went to C:/php and double clicked php.exe,another box opens up and says "This application failed to start because php4ts.dll was not found." So I moved it to the sapi folder where php4ts.dll is and it worked. Back to my browser after starting Apache again, and another 404 error.

    I have since found there are posts all over the internet about this problem. I would say it is quite probably this version of Apache but that doesn't fix my problem.

  19. #19
    ********* wombat firepages's Avatar
    Join Date
    Jul 2000
    Location
    Perth Australia
    Posts
    1,717
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    <bright_red>DOH, sorry dude there was an error in that file !</bright_red>

    I tested the one thats there now though

    & you could upload your httpd.conf as a zipfile attatchment to your post if you want.

  20. #20
    SitePoint Guru
    Join Date
    Feb 2002
    Location
    NZ
    Posts
    620
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I didn't think it was a fault in your file, more likely a fault with apache. I've been reading heaps and there are so many people having this problem and people with a lot more experience than me.

    I'll try your other conf and a completely different way of installing and setting up and see how that goes. It might just be easier to re-install an earier version of both that was working as it only has to be for testing on my machine. Although on saying that I had hoped to host a small site just for the experience.

    Thanks to all for your time, really appreciate it.
    Now, as we look further................

  21. #21
    SitePoint Guru
    Join Date
    Feb 2002
    Location
    NZ
    Posts
    620
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    For anyone interested I solved the problem.

    The solution is very simple:
    Install an older version of both Apache and PHP.

    Had it working in 15 mins.

    Hey, I would like to say a BIG thankyou for all the help.
    Thanks guys.

  22. #22
    SitePoint Member
    Join Date
    Jan 2003
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    CORRECT line LOCATIONS

    HERE IS THE HTTPD CONFIG for APACHE 1.3.27
    -------------------------------------------
    THE 2 uncommented lines SHOULD BE PLACED at the right location in the httpd.conf:

    # Dynamic Shared Object (DSO) Support
    LoadModule php4_module c:/php/sapi/php4apache.dll

    #AddModule mod_usertrack.c
    #AddModule mod_unique_id.c
    # etc etc
    AddModule mod_php4.c

    THE 2 lines below can be placed right at the bottom of httpd.conf:

    AddType application/x-httpd-php .php
    AddType application/x-httpd-php-source .phps

    -----------------------------------------

    The above works for PHP 4.3.0 on APACHE 1.3.27 as a MODULE.
    Eventhough its a bit late, I hope anyone looking for answers can use it.

    Thanx

  23. #23
    SitePoint Guru
    Join Date
    Feb 2002
    Location
    NZ
    Posts
    620
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hey thanks azman, I'm still planning on 1.3.27 soon as I finish doing what I am working on now.

    Much appreciated.

  24. #24
    FreeBSD The Power to Serve silver trophy pippo's Avatar
    Join Date
    Jul 2001
    Location
    Italy
    Posts
    4,514
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,
    thanks for your post.

    but,
    >> AddModule mod_php4.c
    could be or could not be needed.

    AddModule is necessary if inside your httpd.conf you have ClearModuleList un-commented.
    If it's commented then AddModule is not necessary.
    I think it's important to remark that.


    :-)
    pippo
    Mr Andrea
    Former Hosting Team Advisor
    Former Advisor of '03

  25. #25
    SitePoint Member
    Join Date
    Jan 2003
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi Pippo,

    Indeed you're correct:

    ClearModuleList <-- it needs to be uncommented
    # AddModule etc etc
    AddModule mod_php4.c


    Thanx for the tip.


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
  •