Install PHP, Apache 2, Mysql 5, and Memcache on Windows 7
What You Need:
Getting Started:
- Download and extract the distribution file Apache Mysql PHP Memcache - For Windows 7.zip to your desktop.
- Open the Instructions.txt or continue reading the install instructions from below.
Instructions:
Here are the steps for creating and deploying a Windows Apache Mysql PHP Server with Memcache on windows vista
32bit or windows vista 64bit. This will also work on windows 7 32bit and windows 7 64bit.
Step 1:
Install Mysql
- Open MYSQL/mysql-essential-5.1.42-win(your windows type).msi
- Install ALL Mysql Features.
- During Instance Config Enable TCP/IP port 3306 and Strict Mode
- Install as a windows service and Include the bin directory in windows path
- set your root mysql password to something non blank that you will remember.
Install Apache
- Open Apache/apache_2.2.14-win32-x86-openssl-0.9.8k.msi
- Install every available option
Install Memcache
- Open Memcache folder
- Create a folder in your windows program files directory named "Memcache"
- Copy the contents of the Memcache folder into your Program Files/Memcache/ folder.
- Open command prompt and cd to your program files/ memcache folder.
- Run the following command to install the memcache service (memcached -d install)
- Memcached is now installed and will run as a windows service when your computer starts
Install PHP
- Open the PHP folder and install php-5.2.11-win32-installer.msi
- Make sure that MYSQL is running and Apache is NOT running.
- Install only the basic options and be sure to check mysql you can modify options later
- Setup for apache 2.2x
- If all goes well php should install and configure apache 2.2
- If apache 2.2 configuration fails then open up your program files/apache*/apache*/conf/httpd.conf
- inside the httpd.conf at the very bottom add the following be sure to link it to your program files directory
LoadModule php5_module "c:/Program Files (x86)/PHP/php5apache2_2.dll"
AddType application/x-httpd-php .php
PHPIniDir "c:/Program Files (x86)/PHP/"
ScriptAlias /php/ "c:/Program Files (x86)/PHP/"
Action application/x-httpd-php "c:/Program Files (x86)/PHP/php.exe"
Installing PHP Modules
- Copy the contents of the PHP/ext folder to your Program Files/PHP/ect folder
- Open up your Program Files/PHP/php.ini file
- look for extension=php_mysql.dll (if you can't find it find the list of dll modules and add that to the end)
- after extension=php_mysql.dll add extension=memcache.dll
- Save the php.ini config
Finishing Up
- Restart your computer to make sure all the changes take effect.
- Upon restart open up your system services and make sure apache / memcache / mysql are running
- Now in your windows firewall allow the incoming ports of 11211 and 3306 this will allow php to talk to mysql and memcache
- If you get errors open command prompt and try running php.exe and httpd.exe from there. if you see errors fix them.
Congrats
Now you should have a working Windows Apache PHP Mysql Memcache setup. Enjoy!