How to install apache/php/mysql on vista

Status
Not open for further replies.

silentbob

New member
Jul 10, 2007
159
5
0
It took me a couple of hours to figure it out so I hope by posting this I can save somebody some time.

Notes :
  • Turn off UAC
  • If something does not work try running it using an administrator console. You have elevated privileges there.
Installing Apache :
This is the easy one. Just run the installer and it works out of the box. To edit the httpd.conf I had to add some file permissions. Starting/Stopping the Apache service does not work through the shortcuts created by the apache installer. You start/stop/restart it through the services mmc (control panel->System management->Services)


Installing Php :
Do not use the installer. It does not work. You have to do a manual install.
  1. Download the php zip file and also the PECL file (extensions)
  2. Extract it to c:/php and extract the pecl file to c:/php/ext
  3. In a command prompt type :
    Code:
    cd c:\php
    mkdir upload
    mkdir session
    copy php.ini-recommended php.ini
  4. Edit php.ini to your liking. Shit that is absolutely necesarry :
    Code:
    upload_tmp_dir="C:\php\upload"
    session.save_path="C:\php\session"
    extension_dir ="C:\php\ext"
  5. Add the php and ext dir to the environment vars : Open the file explorer -> right click Computer -> Advanced -> Environment Variables. Add c:/php and c:/php/ext to the PATH variable. (I had to create that var on my frech install of vista)
  6. Edit the apache httpd.conf :
    Code:
    LoadModule php5_module "C:\php\php5apache2_2.dll"
    AddType application/x-httpd-php .php
    AcceptPathInfo on
    PHPIniDir "C:\php"
    Now find DirectoryIndex and add index.php.
  7. Restart apache and you're done.

Installing MySQL :
This is the hairy one and took me the longest.
  1. Download the mysql installer and install it. When the install is done there is a checkbox asking you to run the setup tool. Uncheck it. We will do this later.
  2. Download Resource Hacker. This is an app that allows you to edit the windows .res files. We will use this on the mysql setup tool to change the privileges needed to run it. After unzipping the files right click the exe and check Run as administrator
  3. Using resource hacker open the file C:\Program Files\MySQL\MySQL Server 5.0\bin\MySQLInstanceConfig.exe. Navigate to 24 / 1 / 1033 and in the left pane on line 6 you should change asAdministrator to requireAdministrator. Now click "Compile script" and save the file.
  4. Now run the the MySQLInstanceConfig.exe file. After hacking it will actually start. If you dont it will fail with an error. Now you are able to create the mysql service and actually get it working on vista
Enjoy :D
 


1. Download xampp.
2. Install xampp.
3. Start coding.

XAMPP is a complete Apache/MysQl/PHP + more environment in one download and all preconfigured. Using xampp and you'll have working environment in 15 minutes. No config file editing. It just works.
 
  • Like
Reactions: che1959
Status
Not open for further replies.