WHAT'S NEW?
Loading...

Laravel Project Setup in Windows

When working with Laravel in Windows, we need php-cli to be accessed from command line globally. So, here is how I installed 7.0 version of php in windows and able to run composer update for my laravel project.
1. Download zip version of php from here: http://windows.php.net/download/
2. Extract it to somewhere in our disk. I have extracted it to C:\php7
3. Inside the directory find php.ini-developement to php.ini and do the following:
    find extension_dir and un comment it as:
   
; On windows:
; extension_dir = "ext"
to
  
; On windows:
extension_dir = "ext"
Make another changes:
; extension=php_mbstring.dll
to
extension=php_mbstring.dll
The final one is to enable php_openssl extension by changing:
; extension=php_openssl.dll
 to
extension=php_openssl.dll
4. To access php-cli from command line, open Windows Explorer. On left pane, right click Computer and goto Properties >  Advanced System Settings > Environment Variables. Under system variables section select PATH variable and click  to  edit it.
Please note each path in the PATH variable is terminated with a semicolon(;). If you add any directory path in this variable, the commands in the directory can be accessed from anywhere inside command prompt.
So, for my case, I appended C:\php7 to the PATH variable.
Here's another thing to notice:
If you have previously installed WAMP, XAMPP or other packages for creating server on your machine, then make sure to add the path of your php7 directory before the path added by the installation of WAMP, XAMPP, etc.
I had installed WAMP Server previously and there was something like: C:\wamp\bin\php\php5.3.13 in the VALUE field of PATH variable. This can be removed if you no longer use this php version and add the new path.
Now navigate to command prompt and check your php version by: 
php -v
The new php is accessible from your command prompt.
Then navigate to your laravel directory and run: 
composer update

THE DEPENDENCIES FOR YOUR PROJECT ARE DOWNLOADED AND YOU ARE NOW READY TO RUN php artisan COMMAND.

0 comments:

Post a Comment