Phar allows you to put an entire PHP application into a PHP Archive. It is not a direct executable as you may assume.
To install Laravel 4.1 successfully on Windows 7, you need Composer -a package manager.
First install Composer. This will install globally on your system. Composer can now be called through your command prompt via 'composer'.
Next, go to where your WAMP or XAMP project folder is -generally, this would be your www folder (i.e. C:wampwww).
Make a new project directory: www
ew_project. Now go to your start menu and run cmd as admin. Next you need to change your directory to the C drive and then into your www
ew_project folder:
C:> cd wampwww
ew_project
Now you can take advantage of composer by calling:
composer create-project laravel/laravel --prefer-dist
Call the above statement in that new_project folder because that is where laravel will install. The above will make your directory path as:
C:wampwww
ew_projectlaravel
Laravel is now available on your system. You can verify a successful install by going to:
http://localhost/new_project/laravel/public/
Based on the above question edit regarding making a .phar globally available for command:
The directory your looking for is
C:in
--the equivalent folder to /usr/bin
on Linux.
Copy the laravel.phar
file in the C:in folder
. Or , you can put it in a folder, such as, C:phplaravel.phar
. Then you need to make a batch file somewhere within the PATH called laravel.bat
which will then do the following:
@ECHO OFF
php "%~dp0laravel.phar" %*
The "%*" repeats all of the arguments passed to the shell script.
Thus, you can run 'laravel new project'. Hope this points you in the right direction.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…