harry_ord Posted July 17, 2018 Share Posted July 17, 2018 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 More sharing options...
justsomeguy Posted July 17, 2018 Share Posted July 17, 2018 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 More sharing options...
harry_ord Posted July 17, 2018 Author Share Posted July 17, 2018 I checked and i have version 7.1.6 Where can i see the error log? Link to comment Share on other sites More sharing options...
justsomeguy Posted July 17, 2018 Share Posted July 17, 2018 I think the XAMPP control panel has options to view the various logs. Link to comment Share on other sites More sharing options...
harry_ord Posted July 17, 2018 Author Share Posted July 17, 2018 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 More sharing options...
justsomeguy Posted July 17, 2018 Share Posted July 17, 2018 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 More sharing options...
harry_ord Posted July 18, 2018 Author Share Posted July 18, 2018 I made a phpinfo.php file with: <?php phpinfo(); ?> And the page header says PHP Version 7.1.6 in bold. Could you try download it and install it yourself? i'm suspecting that the app is not actually working. Link to comment Share on other sites More sharing options...
justsomeguy Posted July 18, 2018 Share Posted July 18, 2018 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 More sharing options...
harry_ord Posted July 18, 2018 Author Share Posted July 18, 2018 This is my MySQL version: C:\xampp\mysql\bin>mysql -h localhost -V mysql Ver 15.1 Distrib 10.1.24-MariaDB, for Win32 (AMD64) Link to comment Share on other sites More sharing options...
justsomeguy Posted July 18, 2018 Share Posted July 18, 2018 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now