Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

php with apache as a module

Options
  • 03-01-2007 1:38pm
    #1
    Closed Accounts Posts: 15


    Hi there,

    I am trying to set up php with an apache server on windows.
    I installed php version 5 and it works fine for me using php.exe on the command bar with my php files as an argument.
    However, when I try to use apache (version 1.3) I get problems.
    I added php4apache as a module using loadModule and addmodule in my apache httpd.conf file. I also added php.ini file to the c:/windows directory.
    I can get to the .php pages alright, they come up in internet explorer, but non of my php stuff is processed, even echo "hello" is ignored. I get no errors in my log file about it.
    Please help!!!

    Laura


Comments

  • Registered Users Posts: 304 ✭✭PhantomBeaker


    You also need to set up your handlers.

    the line
    AddType application/x-httpd-php .php

    needs to be in one of your <Directory> sections in your httpd.conf
    Like:
    <Directory "c:\windows\wwwdocs">
            # Other stuff goes here.
            AddType application/x-httpd-php .php
    </Directory>
    

    Hope that Helps,
    Aoife


  • Registered Users Posts: 68,317 ✭✭✭✭seamus


    First, check your handlers, as the woman above says.

    Did you restart apache after changing httpd.conf?

    You should get a handy little link in your Start Menu for "Test Configuration file". This will tell if there are any errors in the httpd.conf file.


  • Closed Accounts Posts: 884 ✭✭✭NutJob


    Or if ur lazy like me and you gave up on hour two try
    http://www.wampserver.com/en/

    or just steal the config(i did after some tweaking)


  • Closed Accounts Posts: 8,866 ✭✭✭Adam


    Or if you're even more lazy, google xampp, I use it for my installations, it will install apache automatically, as a service if you wish, and also install mysql, also as a service if you wish. No faults to it and it has a nice little localhost control panel to manage, including phpMyAdmin!

    Also, congrats on being a girl, and a software developer! Geek chicks ftw! Geek IS the new chic, is it not?!


  • Registered Users Posts: 3,568 ✭✭✭ethernet


    Let me get this right: you're running PHP 5 and Apache 1.3 but have loaded a module for PHP 4?

    I suggest you install Apache 2 instead. It's meant to be more efficient than Apache 1.x.


  • Advertisement
  • Registered Users Posts: 68,317 ✭✭✭✭seamus


    ethernet wrote:
    Let me get this right: you're running PHP 5 and Apache 1.3 but have loaded a module for PHP 4?
    D'oh! :o
    Missed. Probably the issue right there.
    I suggest you install Apache 2 instead. It's meant to be more efficient than Apache 1.x.
    Having done both in the past, I would suggest installing Apache 1.3.x. Getting Apache 2 & PHP 5 working on Windows is a bit of a black art, whereas 1.3.x is much easier.

    If this is a production machine and not a development machine, using a Lunix box or IIS may be a better choice.


  • Registered Users Posts: 304 ✭✭PhantomBeaker


    Yeah I missed the php4 bit as well, I just read it as "php for apache".

    (So not used to apache on windows - mainly because I've never tried it)


    Oh, addendum on my advice above:
    Also, because I'm rusty, I decided to look it up (I remember Apache having some big gripe about the php folk recommending one line, when the apache folk said "Yeah, you can do that because we're letting you, but come the revolution, when we tighten this up, it won't work any more. Do this....") (my source: http://www.roundridge.com/hs/apache-php-homesite05.php) and they recommend adding:
    Action application/x-httpd-php /path/to/php.exe
    

    But so far, on the servers I'm on, with apache 1.3 I don't have that in there, nor do I have an AddHandler directive for it (which really should be there from what I understand), so you can probably just ignore it, but just thought it's worth knowing anyway.

    Aoife


Advertisement