Instructions for Apache on Windows: FAQ

Description

These are not really traditional FAQ. This is more of a user provided hints, tips, and debugging help.
  • PHP not keeping sessions active between pages

    This can usually be solved by editing php.ini and changing session.use_trans_sid so the line looks like session.use_trans_sid = 1
  • When Apache launches, it gives error: No installed service named "Apache2"

    For some reason Apache doesn't always install the service. What you need to do is go into command prompt (start > run > type in cmd ) then type in: c:\apache2\bin\apache -k install

    Make sure change that path to the location you installed Apache to. That should put the service you need back in.

    A reader told me they also had the same problem and to fix it they went into the "Custom" option during Apache Install and changed the install location. He thought the problem was due to the old "space-in-the-name" problem. Reinstalling to a path without spaces fixed the problem for him. On the other hand, i've installed it many times with the spaces and never had a problem.
  • I get Fatal error: Call to undefined function mysql_connect() when trying to connect to a database.

    Your MySQL extension for PHP is not enabled from step #3 in Installing MysQL.
  • Apache gives the error Only one usage of the socket address (protocol/network address/port) is normally permitted.

    This message means that something else is already using your port 80 that apache wants to use. Check to make sure you don't have something like Microsoft's IIS (Internet Information Server), some file sharing program with a 'remote login' option, or some other type of server that might be using port 80.
  • MySQL won't start as a service

    A reader with this problem said he completely uninstalled MySQL then reinstalled changing the MySQL service name from the default to mysql41 (or any other name different than default) and it started right up after that.
  • How do I install a module for PHP like GD2

    In your php.ini file, make sure the "extension_dir" setting is correct (so php knows where to look for the GD extension), then just search for extension you want like ;extension=php_gd2.dll and remove the ; in front of it so Apache knows to load the module. Restart Apache and it should load the module and work.