Quick Tip: Adding mySQL and PHP to Your Windows Path

Here is a quick tip showing you how to add mySQL and PHP to your Windows Server path. Many people ask how to do this and while it is included in the Installing mySQL and Installing PHP tutorials I thought I would make it easier for everyone to get the information.

Lets get to it.

First thing to do is right click My Computer and select Properties:

Start advanced-tab.GIF

Select Advanced tab and you’ll see what is shown in figure 2 above. Now click Environment variables button.

environment-variables.GIF add-to-path.GIF

In the bottom box select Path as shown in figure 1 above. Click edit. You’ll get a box like figure 2 above with path highlighted. Click into the box at the end of the path and add:

;C:\path\to\mysql\bin for mySQL

;C:\path\to\php for PHP

Don’t forget the leading ” ; ” when adding the paths. Those are the path seperators.

That’s all there is to it. If you have any question post a comment. If you need one on one help visit the forum.

5 thoughts on “Quick Tip: Adding mySQL and PHP to Your Windows Path”

  1. Should we also add any of the filetypes into ‘PATHEXT’ variable such as .PHP and .PL? If so, are there any other types that should be added?

  2. Thank you, this put an end to my most-part-of-the-day MySQL install suffering :)

    To anyone who may benefit from this – it also works in windows 7, you only have to click “Advanced system settings” in the computer properties.

    Also note that if you have a shell already open, then you will have to restart it to put the changes done to the PATH variable into effect.

  3. try this after this
    C:xamppphp>php C:xampphtdocssymfonyappconsole

    this working fine for me… on windows7 ultimate with symfony2

Add Comment Register

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>