How To Install PHP MySQL And Laravel Framework In Windows Step By Step
n this tutorial i will guide you through the installation of PHP and MySQL in windows , and additionally how to setup PHP framework laravel and Composer with git . php5.4 and later versions have inbuilt development server so in this tutorial i won’t be cover all the webserver setup and all just simple php and mysql with composer and inbuilt development web-server . so lets get started .
Setup overview
- PHP ( Server Side Scripting Language )
- MySQL ( Database )
- Composer ( Dependency manager )
- Git ( Version Control System )
Installation
PHP :
Download PHP
and extract the php file in C:\php or anywhere just remember the location , after extracting the php lets setup windows PATH variable , so we can access php from CMD ( command prompt ) . How to setup Environment Variable in windows : just simply follow the steps
- open My Computer and click on properties
- click on advance system settings
- Click on the Environment Variables From System Properties window
- Choose System variables and select PATH and click edit
- Add ” ; ” ( without quotes ) and add php location
- Click OK and OK again and Press Windows + R and type CMD and type php -vif you are getting that kind of output , Congrats now php is installed and accessible from CMD
MySQL :
MySQL comes with windows installer but i will show you how to install using zip package . Download and extract zip in C:\MySQL and setup environment variable exactly like how we did setup for PHP .
now secure the mysql initial user account see this guide : http://dev.mysql.com/doc/refman/5.5/en/default-privileges.html
MySQL Service in windows
if you want to start mysql when you log on then install mysql service and select automatic start ,
click on start >>all programs >> accessories > then right click and open Command prompt as admin
if you want to start mysql when you log on then install mysql service and select automatic start ,
click on start >>all programs >> accessories > then right click and open Command prompt as admin
and now open service manager and find MySQL service then click on properties set automatic start
now php and mysql is installed lets install composer . Download windows installer and install like another windows package . just choose correct php location when installing .
now php and mysql is installed lets install composer . Download windows installer and install like another windows package . just choose correct php location when installing .
open CMD and type ” composer –version ” and make sure it print version otherwise troubleshoot your installation .
Laravel
Now lets setup laravel , Laravel is php based MVC framework if you are confuse its like ASP MVC and Ruby On Rails framework just written in PHP . let’s install , open CMD and paste
wait for time it will take some time to install all the dependencies , if you are getting openssl error then simply open php.ini file and fix extension dir path ( see the php folder that we extracted at the time of installation )
and change
then try again , i am sure it gonna work . now wait until it finish setting up dependencies .
after that lets start development server . open CMD cd to project root and laravel comes with a tool calle artisan
lets fire up dev server using artisan
then open browser and open http://localhost:8000 , and you will see default laravel page .
Some important links