So basically this is a rewrite of my previous guide but with a more proper method and beside you can find all the information you need on installing Apache, MySQL and PHP on a single page without going to another page unless you’re running Windows Vista / 7 of course
Anyway to make things short, let’s begin the guide on Installing Apache, PHP, and MySQL on Windows XP so i don’t waste your precious time ;)
The other day I was looking for a tutorial to install Apache, php and MySQL on Windows and I wasn’t really able to find anything that cover most basic issues.
- Configure PHP to Access MySQL. Open the c: php php.ini file with your favorite text editor. Uncomment the following lines by removing the semicolon: extension=php_mysqli.dll extension=php_mbstring.dll extension=php_mcrypt.dll Restart the IIS service by clicking on Start, selecting the Search Field, typing iisreset, and then pressing ENTER.
- On a local Windows machine, I’d probably just use a pre-configured WAMP (Windows, Apache, MySQL, PHP). You should download and install the URL Rewrite module in.
Prerequisite
Apache HTTP Server – Download Apache – See the update right below this before downloading
PHP for Windows – Download PHP – See the update right below this before downloading
Make sure to download the Thread Safe version
Make sure to download the Thread Safe version
Item # 22740HPN • 5-30 lbs RF: 20-40 lbs FF: 30-80 lbs BPB • 5 Point harness with up-front harness adjustment • 2-piece push-button harness retainer • 1-position crotch strap • 4 position adjustable headrest • Removable cup/juice holder on seat • Adjustable body pad • 2-position belt positioner guides on either side • Removable, full-wrap tailored fabric pad • Extra-wide roomy seat with comfort support seat • Use in vehicle with either automotive or UAS belts • UAS equipped for use with harness system. Eddie bauer car seat 22 740 hpn manual treadmill.
MySQL – Download MySQL
If you have slow connection you can use the Essential version to save your time :)
If you have slow connection you can use the Essential version to save your time :)
At the time i wrote this the latest version of Apache is 2.2.15, PHP 5.3.2, and MySQL 5.1.45
Update
Because PHP no longer provide the PHP VC6 binary since version 5.3.6 directly on their website, there are two options for you to choose from:1. Stick with PHP 5.3.5 VC6 and Apache binaries from official Apache website (the last version of PHP that is compiled using VC6) and can be downloaded from here. This is perhaps a preferred way if you’re just going to use it for development purpose or anything that is not really important
2. Use the VC9 version of PHP 5.3.6 or higher and Apache VC9 binaries built by www.apachelounge.com
If you’re going with option 1 then you can just simply follow the guide above, but if you choose option 2, the easiest way to install it is:
1. Download Apache binary from apachelounge.com and then download VC9 PHP from PHP website
2. Extract the apache into C: (so the apache directory ended up in C:Apache2)
3. Open httpd.conf in C:Apache2conf and:
4. Now run command prompt as administrator and then type:
5. As for the rest (PHP and MySQL setup) you can follow the guide below :)
Installing Apache on Windows XP
1. Begin by running the apache installer until you reached this screen that prompt you to insert your Apache server information
2. Then when the installer asked you for the setup type, choose Typical
3. And then when asked to choose the installation directory, make sure to use the default path as shown below (otherwise you’ll need to adjust everything else to match your Apache installation directory later)
4. And finally you’re done installing Apache. After installing Apache you would notice there’s a new icon installed on the System Tray (where the clock displayed in Windows), the new icon is called Apache Service Monitor, which is basically a tool to help you to Start/Stop/Restart Apache quickly and when you double click on it you’ll see this
Configuring PHP with Apache on Windows XP
1. Create a new directory named PHP5 in C: so it’ll end up like below image for an example (you’re free to use other path, but if you choose to put it in different path, make sure to adjust them accordingly because in this guide i assume the PHP is extracted to C:PHP5)
2. Locate php.ini-production in C:PHP5 then rename it to php.ini
Install Mysql On Windows 10
3. Open php.ini and locate extension_dir directives, uncomment and change the value into
4. Still with php.ini, next you need to find output_buffering and change it to
5. Locate php_bz2.dll, php_mbstring.dll, php_mysql.dll, and php_mysqli.dll and uncomment it
6. Now we are done with the php.ini configuration, the next step would be locating Apache httpd.conf(if you didn’t change the default Apache installation directory it can be found at C:Program FilesApache Software FoundationApache2.2conf or C:Apache2confhttpd.conf if you choose to use Apachelounge version)
7. Open httpd.conf and uncomment expires_module, headers_module, rewrite_module and then add
8. Still in httpd.conf, inside
add:
9. Still in httpd.conf once again, locate
and replace with
10. Now we’re done with httpd.conf the next step is opening System Properties (Windows Key + Pause/Break or by right clicking My Computer and then choose Properties) and then choose Advanced tab and finally click on Environment Variables
11. Locate Path under System Variables and then double click on it then add
Student guide complete sentences. Similar ways can be used with iframe (with contentWindow.print()). However, you may find that these solutions may not work - for example, there is no PDF plugin to display the PDF inline (or user has chosen always open file externally).
12. Still in Environment Variables, next you need to click New System Variables and then add
13. We’re finished with adding and editing System Variables, now go to C:Program FilesApache Software FoundationApache2.2htdocs and then create a new text file inside that directory named test.php and open it with notepad then add this
14. Now we’re done with the PHP Apache integration. Save your work and then restart your computer
15. Finally after finished booting into Windows XP, now open your favorite browser (in this example i use Internet Explorer 6 which is the default browser for a freshly installed Windows XP installation) and then type
And you’re done with Apache PHP integration process :) … the next step would be Installing MySQL on Windows XP
Installing MySQL on Windows XP
1. Run the MySQL Installer, then choose Typical setup type when asked to install it to default path
2. And continue with the installation process
3. When you reached this screen after MySQL installation process finished, check Configure the MySQL Server Now and uncheck Register the MySQL Server now
4. When asked for the configuration type, choose Detailed
5. Then choose Developer Machine as the server type to make sure MySQL doesn’t use too much memory (well if you have plenty of RAM then feel free to choose other server type to suit your needs)
6. And then choose MultiFunctional Database when prompted
7. When asked for the InnoDB storage location, choose C:MySQL InnoDB Datafiles
8. And when asked for the max concurrent connection that MySQL would accept choose Decission Support (DSS)/OLAP(but if you think that you’re going to have many concurrent connection later especially if you’re running a popular WoW Private server then you can choose Manual Setting and choose what would be the best value for your application)
9. When you reached the MySQL networking options, just leave it at default value
10. As for the MySQL default character set, choose Best Support for Multilingualism to make UTF8 as the default charset
11. And then when you reached Windows options, don’t forget to check Include Bin Directory in Windows PATH so you can access MySQL easily from the command line
12. Now comes the most important part of the MySQL installation, and that is setting a root password for MySQL(root is the superuser in MySQL, make sure to remember root password and don’t give it to anyone else)
13. Now you’re done installing MySQL
You’re done installing Apache 2.2, PHP 5.3 and MySQL 5.1 on your Windows XP computer. Hopefully you enjoy this quick guide and of course if i missed something, please do let me know in the comment area below :)
Note: Updated because the VC6 version for PHP 5.3 series is no longer listed on PHP website and replaced by VC9
Active5 months ago
How do I install Apache with PHP support and the MySQL server on Windows without using any ready-to-use packages like WAMPServer or XAMPP ?
user256743
2 Answers
First, I recommend you read the Platform Specific Notes of Apache for Windows - it explains some Windows-specific features like running as a service that you don't have on other OSes and you probably have never used before.
As mentioned in these platform specific notes, Apache doesn't provide binaries for Windows, however they have links to several third-party sites that provide binaries, for example Apache Lounge.
From that website, we can download either the 32-Bit version (win32) or the 64-Bit one (Win64) - if your OS is 64-Bit you should always try to install 64-Bit versions of software, but note that you'll need to use 64-Bit modules as well, that means if you only have a 32-Bit module then download the 32-Bit Apache.
Here's the version that I used when writing this : Apache 2.4.10 Win64. The latest version when this answer was last updated: Apache 2.4.38 Win64 (look at the edit date at the bottom of the post).
Once downloaded, just extract the
Apache24
folder to the root of your hard drive, so that you have a path like C:Apache24bin
.Open a command line window (Windows+R and type
cmd
then press Enter), change directory into C:Apache24bin
and run httpd.exe
, normally it shouldn't print any errors.If you get an error dialog stating that
MSVCR110.dll
is missing on your system, you'll need to install the Visual C++ Redistributable for Visual Studio 2012 - as always, when prompted, select the appropriate bit-version : vcredist_x86.exe
for 32-Bit systems and vcredist_x64.exe
for 64-Bit ones.If you get an error saying that it can't bind to port 80, check if another application uses that port - also Skype is known to use ports 80 and 443 by default; uncheck 'Use port 80 and 443 as alternatives for incoming connections' in its advanced connection settings, restart Skype to apply the changes, and then you should be able to start Apache without issues.
A warning like
Could not reliably determine the server's fully qualified domain name
can be ignored for now.Windows Firewall may prompt you to allow Apache to communicate on specific networks, I recommend you use the default settings : allow it on home and work networks, but not on public/untrusted networks.
Then, open a browser and browse to
http://localhost
, if you see a page saying It works !
then it means your Apache installation is working.You can now stop the currently running Apache by pressing Ctrl+C in the command prompt.
If you got a warning about not being able to determine the system's fully qualified domain name, fix it by editing
C:Apache24confhttpd.conf
and editing the ServerName
variable (it should be already there in a comment, just uncomment it and change it) :Replace
<yourhostname>
with either the system's host name or localhost
.Finally, if you want to run the server automatically when the system starts (even if nobody logs in), you'll need to run it as a service - in a new elevated (as an administrator) command prompt, type :
That's it, now you have a new service in Services (Windows+R then type 'services.msc' then press Enter) named 'Apache2.4' that you can control just like any other Windows service.
Restricting Apache access to localhost
only - optional
If you're setting this up for development purposes you want to make sure that no one except you can access it, your firewall should already take care of that but let's add another layer of security to it by telling Apache to accept requests from the local machine only.
Open Apache's configuration file
C:Apache24confhttpd.conf
, search for the default directory block <Directory 'c:/Apache24/htdocs'>
.At the end if it, there should be a line
Require all granted
, this means that anyone can access this server. Let's make that Require local
which only allows access from the local machine.Also, you can tell Apache to only bind to the loopback interface, that way even if both your firewall and the access control directives mentioned above fail, the server still won't be open to the whole internet.
For this, locate the
Listen
directive (by default it's set to 80
) and change it to the following :The first line is self explanatory, the second one is the first one's IPv6 equivalent, the brackets are used in the IPv6 notation to separate the address and the port.
Save the file, if you're already running the server then restart it in order to take our changes into account, and now only
localhost
has access, everyone else will get a 403 Forbidden
.I suggest you read the official PHP documentation about installing it on Windows systems.
Download the latest PHP binaries from the official PHP for Windows download page, choose the thread-safe version that matches your Apache installation's bit-version (x86 for 32-Bit, x64 for 64-Bit).
The non thread-safe version is only when running as a CGI binary - more info here.
The version I used is this : PHP 5.6.2 VC11 x64 Thread Safe. The latest version when this answer was last updated: PHP 7.3.3 VC15 x64 Thread Safe (look at the edit date at the bottom of the post).
Create an empty
PHP
folder at the root of your hard drive, and extract the previously downloaded archive there, you should have a path like C:PHPext
, otherwise you did something wrong.In
C:PHP
, rename the php.ini-production
or php.ini-development
(depending on what you want) to php.ini
.Open that
php.ini
file, search for extension_dir = 'ext'
and uncomment that line (remove the first ;
). This sets the default extension dir to ext
(which resolves to C:PHPext
and avoids having to prepend ext/
to all extension's paths manually like in previous versions of this post.Now configure Apache to use that PHP, by editing
C:Apache24confhttpd.conf
- after all the LoadModule
lines, add the following :(The follow is for PHP 7 only)
(The following is for PHP 5 only)
Now try to start Apache manually by opening a command prompt in
C:Apache24bin
and running httpd.exe
- if you see no errors, it means your configuration file is valid and PHP is most likely working.You can test your PHP installation by creating a file like
info.php
with <?php phpinfo();
inside and going to http://localhost/info.php
- you should see quite a bit of info about your system and your PHP installation and all its modules. If you get something else like an 'Internal server error' that means something's wrong.You can now kill your current Apache process (Ctrl+C in the console) and start the service - the following part doesn't interact with Apache and can be done with the server already started.
Composer - optional
Composer is a tool for dependency management in PHP, like a package manager. It allows to easily install PHP packages and even entire frameworks.
Composer requires the PHP OpenSSL extension to be enabled, so let's enable it in
C:PHPphp.ini
.Use your text editor's search function to search for
php_openssl.dll
, there should already be a commented line for it, just uncomment that line.Now download Composer's Windows installer from their download page - or just use this direct link.
Follow the instructions, when prompted for the path to PHP, browse to
C:PHP
and select php.exe
.That's it, Composer is now installed system-wide and can be used from anywhere - you can try it out, just open a new command prompt (you can't use one that's already open since it needs to read the new
PATH
variable set by Composer's installer) and type composer
.You should get a nice ASCII-art logo and something like this :
PHP MySQL extensions - optional
Setup Mysql On Windows
If you want to access your MySQL database from PHP, you'll need to enable extensions that allow you to do so, like
php_mysqli
or php_pdo_mysql
- I recommend enabling them both.Open PHP's configuration file
C:PHPphp.ini
in your text editor and search for php_mysqli
or php_pdo_mysql
- they should already be there, uncomment them.Done, now you can access any MySQL database using either
mysqli
or PDO
.On the MySQL Installer download page download the web installer
mysql-installer-web-community-xxxxx.msi
.I used mysql-installer-web-community-5.6.21.1.msi. The latest version when this answer was last updated: mysql-installer-web-community-8.0.15.0.msi (look at the edit date at the bottom of the post).
The installer will automatically install the appropriate version (32-Bit or 64-Bit) depending on your system, even though MySQL's bit version doesn't have to match Apache's and PHP's one but it's still beneficial to use the 64-bit version of your system supports it to take advantage of more than 3 GB of RAM, that's quite important as database servers tend to use a lot of RAM.
Follow the steps in the installer, if you're installing this for development then the
Developer default
will be your best option, it'll also install MySQL Workbench which is a native GUI client, thus avoiding you having to install slow web-based tools such as PHPMyAdmin if you aren't comfortable with using the command line client.Once everything is installed the installer will ask your for some basic configuration values, I recommend disabling 'Open firewall port for network access' unless you want to access the database from another machine on the network.
Set the root password - if it's only for development purposes and your firewall blocks incoming connections from the network then a strong password isn't necessary.
Finally, you can disable the useless MySQL Notifier by right-clicking the tray icon, going into Actions -> Options, then untick the
Run at Windows Startup
checkbox and apply. That'll save you a few MBs of RAM and avoid slowing your machine down when it's booting.And that's it, you now have a fully functional WAMP server that runs as a service and doesn't depend on any user (accessible even if no one is logged in).
Note that I have no idea about the security of this, for development purposes I'd say this is pretty safe since your firewall should block incoming connections for both Apache (port 80 and or 443) and MySQL (port 3306).
This was tested on a Windows 7 installation, it should also work just fine on Vista, Windows 8 and possibly Windows Server 2008/2012 - feel free to comment and/or downvote if that's not the case.
user256743
The instructions in the above answer work perfectly as of July 2017, however, if you wish to use PHP 7, you must add the following lines to
C:Apache24confhttpd.conf
, instead of the ones in that answer (which work only for PHP 5) [Add the following after all the LoadModule
lines]:Ensure that all paths are correct. If you don't have
rahuldottechrahuldottechphp7apache2_4.dll
in your PHP directory, you probably downloaded the wrong package.4,04055 gold badges2727 silver badges5353 bronze badges
protected by Mokubai♦Jul 2 '16 at 21:59
Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).
Would you like to answer one of these unanswered questions instead?
Would you like to answer one of these unanswered questions instead?