When referring to this post here:
http://net.tutsplus.com/tutorials/javascript-ajax/start-using-html5-websockets-today/
it tells you to run php -q path\to\server.php from shell using XAMPP, is there an alternative for WAMP?
When referring to this post here:
http://net.tutsplus.com/tutorials/javascript-ajax/start-using-html5-websockets-today/
it tells you to run php -q path\to\server.php from shell using XAMPP, is there an alternative for WAMP?
It might be useful to register php.exe as an ENVIRONMENT VARIABLE so the command line can recognize the 'php' command instead of needing to enter the full path '\wamp\bin\php\php5.3.8\php' as the command.
To do this, you can follow the steps outlined on this page: http://windows.fyicenter.com/view.php?ID=60. Except for Step 5, enter the path of WAMP's php.exe instead. For example, just add in
$;C:\wamp\bin\php\php5.3.8
to the Variable value field. And each time you open up your command line, just run php using..still keeping in mind that the pageYouAreRunning.php is relative to the current path in your command line.
It's essentially the same thing as described. You will need to open the windows cmd shell, and then you just need to find the location of the php file on your particular installation.
In the wamp installation I have it's located at
\wamp\bin\php\php5.3.8\php
. So to run the php script I want, I would call...Keep in mind
pageYouAreRunning.php
is relative to the path you are currently in in your shell console.Not tested, but I would say it is the same...
There is a "php.exe" in your wamp/php folder...
Run it through commandline :
It's no longer recommended to edit your environment path to directly point to the path to the PHP exe. This can cause you headaches further down the line.
A moderator named RiggsFoley over at the WampServer forum shared the following file called
phppath.cmd
:As per the instructions, you need to edit the
baseWamp
anddefaultPHPver
variables. Check Wamp'sbin\php
directory for the available PHP version numbers.Put the file in your
C:\Windows
directory, then open a new command window, and typephppath
. You will now havephp
available during that window's session.If php isn't running at all, create a batch file with the following code, and save it in your global folder as 'php'.
Of course replace php7.0.29 with whatever your php version on your machine is
Then just run any php command like normal, e.g.
If you need more arguments, just keep adding them as optional e.g. ${5} ${6}