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.

Leave a Reply

5 Comments on "Quick Tip: Adding mySQL and PHP to Your Windows Path"

Notify of
avatar

BSchwarz
Guest
8 years 6 months ago

I hope this tip is helpful. Post a comment and let me know if it was.

Demono
Guest
Demono
7 years 5 months ago

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?

BSchwarz
Guest
7 years 5 months ago

No. You do that with IIS manager.

Lukas Panek
Guest
Lukas Panek
4 years 9 months ago

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.

Vinay Joshi
Guest
Vinay Joshi
3 years 28 days ago

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

this working fine for me… on windows7 ultimate with symfony2

wpDiscuz