2

I just installed laravel. I use Windows Xampp. Currently I installed it in c:\users\user_name\laravel. Is that correct or should I put it in htdocs? If so how to do it? thanks for your help

Aidin
  • 57
  • 2
  • 7

3 Answers3

1

Cut paste you laravel project in path to xampp\htdocs . set root folder of xampp to xampp\htdocs\laravel\public

syam
  • 892
  • 8
  • 19
  • after cut and paste my project it leads me to another error, Access denied for user 'homestead'@'localhost' (using password: YES) – Aidin Sep 15 '18 at 03:57
  • I try to change env configuration about database and user name, then it leads me again to another error.. SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes – Aidin Sep 15 '18 at 04:09
  • in your AppServiceProvider.php in providers, inside boot method, you have to put this code Schema::defaultStringLength(191); its a laravel bug – syam Sep 15 '18 at 05:01
0

Thanks to syam who helped me to start finding a fix to my problem. Here is my solution

  1. Move laravel project to htdocs

  2. Change the env configuration DB_DATABASE=your_db_name DB_USERNAME=user_name DB_PASSWORD=user_password

  3. Edit AppServiceProvider.php and add this code

    use Illuminate\Support\Facades\Schema; public function boot() { Schema::defaultStringLength(191); }

  4. Then in command line move the active directory to your laravel project and execute this code

composer install

php artisan key:generate

php artisan cache:clear

php artisan migrate

Aidin
  • 57
  • 2
  • 7
0

On moving laravel project to another directory: To clear cache, sometimes permission problem may occur. Do this serially:

change env values then,

php artisan key:generate
php artisan config:clear
php artisan cache:clear
php artisan migrate
ochs.tobi
  • 3,214
  • 7
  • 31
  • 52