Skip to content

Instantly share code, notes, and snippets.

@hootlex
Last active March 15, 2024 07:22
Show Gist options
  • Save hootlex/da59b91c628a6688ceb1 to your computer and use it in GitHub Desktop.
Save hootlex/da59b91c628a6688ceb1 to your computer and use it in GitHub Desktop.
Run laravel project locally

##Windows users:

cmder will be refered as console

##Mac Os, Ubuntu and windows users continue here:

  • Create a database locally named homestead utf8_general_ci
  • Download composer https://getcomposer.org/download/
  • Pull Laravel/php project from git provider.
  • Rename .env.example file to .envinside your project root and fill the database information. (windows wont let you do it, so you have to open your console cd your project root directory and run mv .env.example .env )
  • Open the console and cd your project root directory
  • Run composer install or php composer.phar install
  • Run php artisan key:generate
  • Run php artisan migrate
  • Run php artisan db:seed to run seeders, if any.
  • Run php artisan serve

#####You can now access your project at localhost:8000 :)

If for some reason your project stop working do these:

  • composer install
  • php artisan migrate
@ahtashamilyas
Copy link

Got this error "PHP Warning: require(C:\Users\ahtasham\OneDrive\Desktop\Laravel\first/vendor/autoload.php): Failed to open stream: No such file or directory in C:\Users\ahtasham\OneDrive\Desktop\Laravel\first\artisan on line 18

Warning: require(C:\Users\ahtasham\OneDrive\Desktop\Laravel\first/vendor/autoload.php): Failed to open stream: No such file or directory in C:\Users\ahtasham\OneDrive\Desktop\Laravel\first\artisan on line 18
PHP Fatal error: Uncaught Error: Failed opening required 'C:\Users\ahtasham\OneDrive\Desktop\Laravel\first/vendor/autoload.php' (include_path='C:\xampp\php\PEAR') in C:\Users\ahtasham\OneDrive\Desktop\Laravel\first\artisan:18
Stack trace:
#0 {main}
thrown in C:\Users\ahtasham\OneDrive\Desktop\Laravel\first\artisan on line 18

Fatal error: Uncaught Error: Failed opening required 'C:\Users\ahtasham\OneDrive\Desktop\Laravel\first/vendor/autoload.php' (include_path='C:\xampp\php\PEAR') in C:\Users\ahtasham\OneDrive\Desktop\Laravel\first\artisan:18
Stack trace:
#0 {main}
thrown in C:\Users\ahtasham\OneDrive\Desktop\Laravel\first\artisan on line 18" after running this command "php artisan serve".

@Judekiing
Copy link

Thanks, this has been very resourceful

@fan0512
Copy link

fan0512 commented Aug 31, 2023

Thank you.
Your github was helpful for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment