I’m trying laravel php framework recently. I’m using Windows 7 and XP (tries to install it on both), XAMPP 1.8.1 and PHP 5.4.7.
In many articles (including laravel’s documentation itself), I meet up many artisan codings.
What is artisan? I can’t define it myself so clear. I end up with articles that not giving any simple explanation.
I got commands tutorials like
php artisan key:generateand else.
But I always failed, with this error on Command Prompt :
'php' is not recognized as an internal or external command, operable program or batch file.
I got solution like “change directory to laravel root”,
chdir-ed to C:\xampp\htdocs\laravel\public\ but nothing works.
I that right to access my laravel site with browser via
So, if I try to upload it to my public site, I should place those items in my root folder (/)?
You are getting the error when calling php.exe because windows command prompt is not tracking your PHP installation. You can fix that by adding it into PATH environment variable:
Go to “My Computer” > “Properties” > “Advanced” > “Environment Variables” > “Path”, add a semicolon (;) at the end and then path to your PHP binaries folder, which in your case is C:\xampp\php
After you restart the command prompt PHP and Artisan should work fine.
As to your second question, “public” folder should be your server’s (or virtual host’s) DocumentRoot. There is no need to expose the whole framework on your web server.
artisancommand has to be parsed through a php interpreter, thats why you call it like
I think, you have to use the php.exe to make it work on Windows.
Some thing like
c:\path\to\php.exe artisan command