• 0

How to setup Apache/PHP/MySQL -on Windows


Question

I saw Mr. Magoo's thread, and didn't believe it went "in depth" with setting up Apache - PHP and MySQL. So I've decided to create a tutorial on how to do this, it also includes pictures! :p

Mr magoo adds that the reason why it didn't have much detail was that it was a package, requiring simply an unzip. If you would pefer this simplicity, download phpdev here. Else, learn more about apache and php below :).

Update 25/3/04 : Image links removed.

Ok, so here we go:

-----------------------------------

Introduction.

Why would you want to setup Apache, PHP and MySQL on your Windows computer?

Simple, really. What if you wanted to run a local server for testing out your PHP scripts, or if your creating skins for a forum board? Having a local server can be very useful for many things. What you do with it is up to you. Infact, if your connection is fast enough. You could host your website straight from your computer!

Now, before we start we will need 3 programs:

Note: All releases are the latest from creation of this tutorial

Installing + Configuring.

Now we firstly want to install MySQL. After you've downloaded the file (should be named mysql-4.0.17.exe (or later)) you should then run the installer. Running the installer will result in an easy and fast configuration.

Note: If you want to install the file to a different directory you should read the warning screen

After MySQL has installed successfuly, you need to run it. You should go to the MySQL directory "x:\mysql\" by default. - "x:" being your default hard drive letter

Now your in the "mysql" folder, you should head to the "bin" folder and run "winmysqladmin.exe". Upon first running it, it will prompt for you to enter a username and password.

Once MySQL has installed, we should now go on to installing Apache.

Installing Apache is as easy as running the installer file (apache_2.0.48-win32-x86-no_ssl.msi)

Now, when we install Apache, we will come across a screen which will ask you some information. If you havn't already setup a domain towards your computer you should keep everything as shown in the screen "127.0.0.1"

Once Apache has been setup, you will need to head to "C:\Program Files\Apache Group\Apache2\conf\httpd.conf". In this file, search for the following line

# DocumentRoot: The directory out of which you will serve your

A few lines under there should be a line which begins with "DocumentRoot", replace/edit the directory next to it, to where your website files are stored. And do so with the "<Directory" line found underneath

# This should be changed to whatever you set DocumentRoot to.

Once edited and saved, go to your apache monitor, and restart the service.

Now we have done all this it's time to test the server before we carry on. Open up your favourite web-browser and enter this into the address bar http://localhost If your website shows up, or the directory of the place you configured, then it's working. Congratulations, now it's time to continue. If it's not working, go back and see if you've missed anything.

Now, you should have the PHP zip file. Extract it to your hard drive root directory. In our case it's "x:"

So now extract "php-4.3.4-Win32" to "x:\" to create "x:\php-4.3.4-Win32\" -Note: All direcotry files should be in "x:\php-4.3.4-Win32".

Once this is done, you should head to that directory and rename "php.ini-dist" to "php.ini" -Copy this file to "X:\Windows".

Now copy "php4ts.dll" to "X:\Windows\System\".

Now we need to integrate PHP with Apache. To do this, we need to edit the "httpd.conf" file again.

Find

# Example:

# LoadModule foo_module modules/mod_foo.so

#

LoadModule access_module modules/mod_access.so

LoadModule actions_module modules/mod_actions.so

LoadModule alias_module modules/mod_alias.so

LoadModule asis_module modules/mod_asis.so

LoadModule auth_module modules/mod_auth.so

#LoadModule auth_anon_module modules/mod_auth_anon.so

#LoadModule auth_dbm_module modules/mod_auth_dbm.so

#LoadModule auth_digest_module modules/mod_auth_digest.so

LoadModule autoindex_module modules/mod_autoindex.so

#LoadModule cern_meta_module modules/mod_cern_meta.so

LoadModule cgi_module modules/mod_cgi.so

#LoadModule dav_module modules/mod_dav.so

#LoadModule dav_fs_module modules/mod_dav_fs.so

LoadModule dir_module modules/mod_dir.so

LoadModule env_module modules/mod_env.so

#LoadModule expires_module modules/mod_expires.so

#LoadModule file_cache_module modules/mod_file_cache.so

#LoadModule headers_module modules/mod_headers.so

At the end of this section, add the following:

LoadModule php4_module c:/php-4.3.4-Win32/sapi/php4apache2.dll

then find

#

# AddType allows you to add to or override the MIME configuration

# file mime.types for specific file types.

#

Add the following lines:

AddType application/x-httpd-php .php .phtml .html

DONE!

-----------------------------------

That's it, your basic server is complete. It can run PHP/MySQL driven websites and your basic HTML. Now enjoy it, experiment with it, have fun with it!

24 answers to this question

Recommended Posts

  • 0
  NIMASoft said:
now here's my problem, how do i create db and stuff for mysql. like for example, when installing lets say IPB, what do i put for dbname, dbpass, dbhost, and stuff like that!

if you get the gui mysql app you can create them pretty easily or search for some mysql tuts

  • 0

Are you scottish? I saw the post and i was like 'jeez, even n00bish moi knows how to do that', but you highlighted my lack of putting a file in x:\windows\system and it is now there and happy. I wasnt experiencing any problems without it right enough, and i doubt it's gonna make my login script work, but it is a huge weight off my shoulders :p

  • 0

I want to say THANK YOU for posting this, I'm running an APACHE server with mySQL and PHP 4. I'm on a cable modem, so bandwidth is no problem. You can check out the template site I made last night (it sucks badly, I know...but I'll be working on it more later...

  • 0
  gdub2611 said:
Are you scottish? I saw the post and i was like 'jeez, even n00bish moi knows how to do that', but you highlighted my lack of putting a file in x:\windows\system and it is now there and happy. I wasnt experiencing any problems without it right enough, and i doubt it's gonna make my login script work, but it is a huge weight off my shoulders :p

Nope lol. Just use Aye alot :blink:

Anyways, glad you all like the guide. Expect more! :happy:

  • 0
  SYBOLD said:
ah well it can be done with just a few clicks if you use appserv, it will install apache, php, mysql at once.

http://www.appservnetwork.com/

I just looked at that site. And I have to disagree with the guy on 1 point. I had PHP 4.x.x running under Apache 2.0.46 a while back and it was lightning fast. Yet he says it was slow? To me it sounds like he just has a slower comp which is no big deal but to call that type of setup slow is just not 100% true.

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • Azure Linux 2.0 reaches end of life, requiring AKS Arc users to upgrade by Paul Hill Microsoft has warned that Azure Linux 2.0, used in Azure Kubernetes Service (AKS) enabled by Azure Arc, will reach its end of life on July 31, 2025, necessitating users to upgrade. After this date, Microsoft will no longer provide updates, security patches, or support for Azure Linux 2.0. The longer it is used after this date, the more vulnerable systems will become due to a lack of patches. Azure Linux 3.0 brings significant upgrades to core components that enhance performance, security, and the developer experience. The Linux kernel is upgraded from version 5.15 to 6.6, bringing performance and hardware compatibility improvements. The Containerd package has been updated from version 1.6.26 to 1.7.13, improving container management. The SystemD package has been upgraded from version 250 to 255, streamlining system and service management, and OpenSSL has jumped from version 1.1.1k to 3.3.0, providing enhanced encryption and security. Azure Linux 3.0 also brings more packages and better tooling. Major versions of Azure Linux are typically supported for three years, with Azure Linux 3.0’s EOL projected for Summer 2027. It became generally available in August 2024.Microsoft said that users must migrate to Azure Linux 3.0 by upgrading their Azure Local instances to the 2507 release when it becomes available. After the Azure Local instance has been upgraded, users can then upgrade their Kubernetes clusters. Microsoft gives you the option to remain on the same Kubernetes version during this upgrade by providing the same version number on the aksarc upgrade command. After upgrading, you can verify the kernel version on your Linux nodes by adjusting the file path in this command: kubectl --kubeconfig /path/to/aks-cluster-kubeconfig get nodes -o wide This upgrade is mandatory for continued support. If you want to learn more, check out Microsoft’s announcement which also includes how to reach out to the AKS Arc team if you need to.
    • PDF-XChange Editor 10.6.1.397 by Razvan Serea PDF-XChange Editor is a comprehensive PDF editor that allows you to create, view, edit, annotate, and digitally sign PDF documents with ease. With advanced features like OCR, document security, and PDF optimization, PDF-XChange Editor is a powerful tool for both personal and professional use. Whether you need to edit text, images, or links, or add comments, stamps, or watermarks, PDF-XChange Editor provides all the necessary tools to make your PDFs look perfect. Additionally, it supports a wide range of file formats, including PDF, XPS, and DOCX, making it easy to convert and share your documents. PDF-XChange Editor key features: Edit text and images in PDF documents Add and remove pages from PDF files Annotate and markup PDFs with comments, highlights, and stamps Use OCR to convert scanned documents into searchable text Create and fill out PDF forms Sign and certify PDF documents digitally Add and edit hyperlinks within PDFs Extract text and images from PDF files Batch process multiple PDF files at once Customize the interface to your preferences Work with multiple documents in tabs Convert PDFs to other formats such as Word, Excel, and HTML Use advanced redaction tools to permanently remove sensitive information Add customizable headers and footers to PDFs Merge multiple PDF documents into a single file Split PDF documents into multiple files Add watermarks to PDF documents Use the measurement tools to calculate distances and areas in PDFs ....and much more PDF-XChange Editor 10.6.1.397 changelog: New Features Added offline support for MIP-protected documents. Bug Fixes & Improvements Fixed some security and stability issues. Click here for further information. Fixed an issue with DocuSign when a document name is very long. Fixed a very rare issue when opening password-protected files. (46285) Fixed an issue with moving content items in some cases, where arrow keys became unexpectedly deselected under certain conditions. (T# 7476) (40279) Fixed an issue with disabling the Zoom In/Out tool after using the Snapshot tool. (46330) Fixed an issue with an unintentional button press when the Autoscroll command was executed under specific conditions. (46289) Fixed an issue with resetting object selections when panning with mouse middle button. (46358) Fixed an issue with adding a highlight when starting to drag directly above the comment that is itself above base content text. (46410) Fixed an issue with adding a guideline by dragging from the ruler while a text comment or base content is being edited. (45858) Fix the call to app.clearTimeOut after the timeout handler was executed and the associated timer was unregistered. Improved static XFA support. Fixed an issue when adding Insert/Replace text markup comments to the first word in a text line. (47120) For a complete list of changes and more detailed information, please refer to the official PDF-XChange Editor Version History. Download: PDF-XChange Editor (64-bit) | Portable ~300.0 MB (Shareware) Download: PDF-XChange Editor (32-bit) | Portable ~200.0 MB Download: PDF-XChange ARM64 | 264.0 MB Download: PDF-XChange Portable @PortableApps.com | 97.0 MB View: PDF-XChange Editor Website | Screenshot Get alerted to all of our Software updates on Twitter at @NeowinSoftware
    • many people specially intel users stick with 23h2 because for some 24h2 have degraded performance, meanwhile they took 4 years to fix ryzen performance, amd and microsoft put the work to optimize but now crippling intel. for me windows 11 it feels like a beta OS, its not stable or reliable, every patch tuesday you have to pray that they dont break something.
    • Hi all! My motherboard is Gigabyte x570 Gaming X, and believe it or not I just realised it has two M2 slots 😅 So I wanna buy a new SSD, which would mostly be used for gaming. What would you recommend I buy? Is 990 Evo Plus good choice?
  • Recent Achievements

    • Explorer
      DougQuaid went up a rank
      Explorer
    • Week One Done
      MIghty Haul earned a badge
      Week One Done
    • One Month Later
      MIghty Haul earned a badge
      One Month Later
    • Collaborator
      KD2004 earned a badge
      Collaborator
    • One Month Later
      ataho31016 earned a badge
      One Month Later
  • Popular Contributors

    1. 1
      +primortal
      597
    2. 2
      Michael Scrip
      201
    3. 3
      ATLien_0
      192
    4. 4
      +FloatingFatMan
      140
    5. 5
      Xenon
      127
  • Tell a friend

    Love Neowin? Tell a friend!