Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to access the command line for xampp on windows

I am running Xampp on my Windows 7 machine and was wondering if and how I could run commands for xampp via a command line. commands like php phpfile.php

Any advice would be appreciated.

like image 596
Somk Avatar asked May 25 '12 10:05

Somk


People also ask

How do I open the command line in XAMPP?

type: cd c:\xampp\mysql\bin then press enter. type: in mysql -u root -p then press enter.

How do I run XAMPP Control Panel in Windows?

If the XAMPP icon is in your system tray, you can click it to open the Control Panel. If you don't have the icon in your system tray, you can open the Control Panel by choosing Start All Programs Apache Friends XAMPP XAMPP Control Panel.

Where is MySQL console in XAMPP?

Your MySQL binaries should be somewhere under your XAMPP folder. Look for a /bin folder, and you'll find the mysql.exe client around. Let's assume it is in c:\xampp\mysql\bin, then you should fireup a command prompt in this folder. If you want to use mysqldump.exe, you should also find it there.


2 Answers

XAMPP does not have a pre build console to run php or mysql commands, so, you have to add to windows PATH environment variables, these 2: ;C:\xampp\mysql\bin;C:\xampp\php;

Then you should be able to execute php and mysql commands from the CMD.

UPDATE

I tested it, and it works.

like image 106
Alex Avatar answered Oct 09 '22 15:10

Alex


  • You can set environment variables as mentioned in the other answers (like here)

    or

  • you can open Start > CMD as administrator and write

    C:\xampp\php phpfile.php

like image 29
Micheal Mouner Mikhail Youssif Avatar answered Oct 09 '22 16:10

Micheal Mouner Mikhail Youssif