Jump to content

Downloading and installing a Laravel project from github


harry_ord

Recommended Posts

I dowloaded the following project from github:

https://github.com/deadwheel/FoodDelivery

I did the following steps:

1- Downloaded the files via git bash to my xamppp'shtdocs folder: $ git clone https://github.com/deadwheel/FoodDelivery.git

2- Created the database forge on phpmyadmin.

3- I modified the config/database.php on the project's folder leaving it like this:

 

'mysql' => [
            'driver' => 'mysql',
            'host' => env('DB_HOST', '127.0.0.1'),
            'port' => env('DB_PORT', '3306'),
            'database' => env('DB_DATABASE', 'forge'),
            'username' => env('DB_USERNAME', 'root'),
            'password' => env('DB_PASSWORD', ''),
            'unix_socket' => env('DB_SOCKET', ''),
            'charset' => 'utf8mb4',
            'collation' => 'utf8mb4_unicode_ci',
            'prefix' => '',
            'strict' => false,
            'engine' => 'innoDB',
        ],

4- Input the following commands:

$ composer update $ php artisan migrate

With this, all the tables apperead on the database, but i got the following errors.

 

Connection.php line 664:

SQLSTATE[HY000]: General error: 1825 Failed to add the foreign key constraint on table 'order_driver'. Incorrect options in FOREIGN KEY constraint 'forge/order_driver_deliverer_id_foreign' (SQL:
alter table `order_driver` add constraint `order_driver_deliverer_id_foreign` foreign key (`deliverer_id`) references `users` (`id`) on delete NO ACTION)


 PDOStatement.php line 143:

SQLSTATE[HY000]: General error: 1825 Failed to add the foreign key constraint on table 'order_driver'. Incorrect options in FOREIGN KEY constraint 'forge/order_driver_deliverer_id_foreign'


 PDOStatement.php line 141:

SQLSTATE[HY000]: General error: 1825 Failed to add the foreign key constraint on table 'order_driver'. Incorrect options in FOREIGN KEY constraint 'forge/order_driver_deliverer_id_foreign'

I ignored the errors and tried opening the project on my browser going to:

https://laravel.test/FoodDelivery/public/

and i got the following error:

"Whoops, looks like something went wrong."

Is something missing? what else do i need to fix?

Link to comment
Share on other sites

That error may have stopped other code after it from running.  You'll want to fix the foreign key issue, but that's not exactly a breaking error by itself, but if it stopped things after it from executing then that's a problem.  I would check your version of MySQL and see if you're up to date.  Additionally, there should be an error log with the actual error message.

Link to comment
Share on other sites

I got this:

 

Fatal error: Uncaught ReflectionException: Class config does not exist in C:\xampp\htdocs\FoodDelivery\vendor\laravel\framework\src\Illuminate\Container\Container.php:752 Stack trace: #0 C:\xampp\htdocs\FoodDelivery\vendor\laravel\framework\src\Illuminate\Container\Container.php(752): ReflectionClass->__construct('config') #1 C:\xampp\htdocs\FoodDelivery\vendor\laravel\framework\src\Illuminate\Container\Container.php(631): Illuminate\Container\Container->build('config') #2 C:\xampp\htdocs\FoodDelivery\vendor\laravel\framework\src\Illuminate\Container\Container.php(586): Illuminate\Container\Container->resolve('config', Array) #3 C:\xampp\htdocs\FoodDelivery\vendor\laravel\framework\src\Illuminate\Foundation\Application.php(732): Illuminate\Container\Container->make('config', Array) #4 C:\xampp\htdocs\FoodDelivery\vendor\laravel\framework\src\Illuminate\Foundation\helpers.php(110): Illuminate\Foundation\Application->make('config', Array) #5 C:\xampp\htdocs\FoodDelivery\vendor\laravel\framework\src\Illuminate\Foundation\hel in C:\xampp\htdocs\FoodDelivery\vendor\laravel\framework\src\Illuminate\Container\Container.php on line 752

 

Link to comment
Share on other sites

I'm not sure how you would fix that, although there were obviously some problems during installation.  

Are you sure about your MySQL version?  From what I can tell they went straight from 5.6 to 8.0, for whatever reason.

Link to comment
Share on other sites

I'm referring to the MySQL version, not the PHP version.  The error message from setup is a MySQL error, so if it is saying that the options for that alter table statement are not correct, then I would check the MySQL version.  When I look up the syntax for adding foreign key constraints, that syntax looks fine to me.  So if MySQL is telling you the options are not correct, then it sounds like it is not using the same rules that I see in the MySQL documentation, which suggests it is not the same version.

Link to comment
Share on other sites

I don't see a reason why adding that foreign key should cause a problem, maybe try running that alter table statement in phpMyAdmin to see if you get the same error.  If that works though, you'll need to look through the setup scripts to figure out what else you might need to do after that if the setup is going to fail to finish correctly.  It might eventually copy some files also and if those are missing then that might be the cause of your second error.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...