Я настраивал среду Laravel.Итак, я скачал XAMPP и настроил свои файлы vhost соответственно.Затем я установил MySQL и выполнил следующие команды:
- установка композитора
- установка npm
- php artisan (чтобы подтвердить, что у меня был artisan)
- php artisan migrate
После выполнения номера 4 я получаю следующую ошибку на картинке:
C:\Users\Aslam\Desktop\Pfera_application\pfera-web>php artisan migrate -v
Illuminate\Database\QueryException : SQLSTATE[HY000] [1045] Access denied for user 'forge'@'localhost' (using password: YES) (SQL: select * from information_schema.tables where table_schema = forge and table_name = migrations)
at C:\Users\Aslam\Desktop\Pfera_application\pfera-web\vendor\laravel\framework\src\Illuminate\Database\Connection.php: 664
660: // If an exception occurs when attempting to run a query, we'll format the error
661: // message to include the bindings with SQL, which will make this exception a
662: // lot more helpful to the developer instead of just the database's errors.
663: catch (Exception $e) {
664: throw new QueryException(
665: $query, $this->prepareBindings($bindings), $e
666: );
667: }
668:
669: return $result;
Exception trace:
1 Doctrine\DBAL\Driver\PDOException::("SQLSTATE[HY000] [1045] Access denied for user 'forge'@'localhost' (using password: YES)")
C:\Users\Aslam\Desktop\Pfera_application\pfera-web\vendor\doctrine\dbal\lib\Doctrine\DBAL\Driver\PDOConnection.php : 50
Пожалуйста, помогите !!!Большое спасибо!
PS, вот файл database.php:
<?php
return [
/*
|--------------------------------------------------------------------------
| Default Database Connection Name
|--------------------------------------------------------------------------
|
| Here you may specify which of the database connections below you wish
| to use as your default connection for all database work. Of course
| you may use many connections at once using the Database library.
|
*/
'default' => env('DB_CONNECTION', 'mysql'),
/*
|--------------------------------------------------------------------------
| Database Connections
|--------------------------------------------------------------------------
|
| Here are each of the database connections setup for your application.
| Of course, examples of configuring each database platform that is
| supported by Laravel is shown below to make development simple.
|
|
| All database work in Laravel is done through the PHP PDO facilities
| so make sure you have the driver for your particular database of
| choice installed on your machine before you begin development.
|
*/
'connections' => [
'sqlite' => [
'driver' => 'sqlite',
'database' => env('DB_DATABASE', database_path('database.sqlite')),
'prefix' => '',
],
'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', 'forge'),
'password' => env('DB_PASSWORD', ''),
'unix_socket' => env('DB_SOCKET', ''),
'charset' => 'utf8mb4',
'collation' => 'utf8mb4_unicode_ci',
'prefix' => '',
'strict' => true,
'engine' => null,
],
'pgsql' => [
'driver' => 'pgsql',
'host' => env('DB_HOST', '127.0.0.1'),
'port' => env('DB_PORT', '5432'),
'database' => env('DB_DATABASE', 'forge'),
'username' => env('DB_USERNAME', 'forge'),
'password' => env('DB_PASSWORD', ''),
'charset' => 'utf8',
'prefix' => '',
'schema' => 'public',
'sslmode' => 'prefer',
],
'sqlsrv' => [
'driver' => 'sqlsrv',
'host' => env('DB_HOST', 'localhost'),
'port' => env('DB_PORT', '1433'),
'database' => env('DB_DATABASE', 'forge'),
'username' => env('DB_USERNAME', 'forge'),
'password' => env('DB_PASSWORD', ''),
'charset' => 'utf8',
'prefix' => '',
],
],
/*
|--------------------------------------------------------------------------
| Migration Repository Table
|--------------------------------------------------------------------------
|
| This table keeps track of all the migrations that have already run for
| your application. Using this information, we can determine which of
| the migrations on disk haven't actually been run in the database.
|
*/
'migrations' => 'migrations',
/*
|--------------------------------------------------------------------------
| Redis Databases
|--------------------------------------------------------------------------
|
| Redis is an open source, fast, and advanced key-value store that also
| provides a richer set of commands than a typical key-value systems
| such as APC or Memcached. Laravel makes it easy to dig right in.
|
*/
'redis' => [
'client' => 'predis',
'default' => [
'host' => env('REDIS_HOST', '127.0.0.1'),
'password' => env('REDIS_PASSWORD', null),
'port' => env('REDIS_PORT', 6379),
'database' => 0,
],
],
];
Вот мой файл .env:
## REAL KEY REMOVED FOR PLAIN TEXT TRANSFER
## SEE http://laravel-recipes.com/recipes/283/generating-a-new-application-key FOR GENERATING YOUR OWN KEY, DO THIS BEFORE RUNNING ANY SEEDS
APP_NAME=Pfera
APP_ENV=staging
APP_KEY=base64:E8vEONwbkikyy/7IsRpNg/kakuRy3/JCUjetkpH1EzE=
APP_DEBUG=false
APP_LOG_LEVEL=debug
APP_URL=pfera.local
## THESE ARE DB CREDS THAT ARE SPECIFIC TO YOUR OWN DATABASE
## REAL PASSWORD REMOVED FOR PLAIN TEXT TRANSFER
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=forge
DB_USERNAME=forge
DB_PASSWORD=password
BROADCAST_DRIVER=log
CACHE_DRIVER=file
SESSION_DRIVER=file
QUEUE_DRIVER=sync
REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379
## REAL MAILGUN SECRET REMOVED FOR PLAINT TEXT TRANSFER
## THIS IS FOR CODE AND MORTAR'S DEVELOPMENT ACCOUNT, UNIQUE CREDENTIALS WILL
## NEED TO BE CREATED FROM YOUR OWN ACCOUNT FOR PRODUCTION, LOCAL DEVELOPMENT,
## AND ONCE THE STAGING ENVIRONMENT IS FULLY TRANSITIONED
MAIL_DRIVER=mailgun
MAILGUN_DOMAIN=mg.codeandmortar.com
MAILGUN_SECRET=12345678
MAIL_FROM_NAME="Pfera"
MAIL_FROM_ADDRESS="no-reply@pfera.ca"
MAIL_FROM="no-reply@pfera.ca"
## THESE ARE ALL VARIABLES FOR SPARK FEATURES NOT IMPLEMENTED IN THIS PHASE
PUSHER_KEY=
PUSHER_SECRET=
PUSHER_APP_ID=
AUTHY_SECRET=
STRIPE_MODEL=App\User
STRIPE_KEY=
STRIPE_SECRET=
BRAINTREE_MODEL=App\User
BRAINTREE_ENV=
BRAINTREE_MERCHANT_ID=
BRAINTREE_KEY=
BRAINTREE_SECRET=
## END NON-IMPLEMENTED SPARK VARIABLES
## PAGINATION
HORSES_PER_PAGE=20
EVENTS_PER_PAGE=20
TESTS_PER_PAGE=20
USERS_PER_PAGE=20
## ESTIMATED ESTROUS CYCLE LENGTH IN DAYS
ESTROUS_CYCLE=21
## VARIABLES THE POINT OUT:
## 1) THE PATH TO THE `Rscript` EXECUTABLE TO RUN R CODE
## 2) THE PATH TO THE R CODE REPO
## 3) THE FILENAME OF THE R CODE TO RUN
## NOTE THAT ON THE SERVER WE'RE USING `chroot` SINCE THE R AND PHP UBUNTU
## BINARIES HAD CONFLICTING DEPENDENCIES, THIS IS WHY THE "RELATIVE" PATH FOR
## THE R SCRIPT IS JUST `.`, BECAUSE IT IS WITHIN THE ROOT OF THE CHROOT JAIL.
## THIS WILL ALMOST DEFINITELY NOT BE THE CASE IN LOCAL DEVELOPMENT. FOR LOCAL
## DEVELOPMENT, I WOULD STRONGLY RECOMMEND PROVING `R_PREDICT_PATH` A FULL PATH
## TO THE DIRECTORY THAT CONTAINS THE R CODE (THIS PATH MUST NOT INCLUDE THE R
## FILE ITSELF)
RSCRIPT_BIN="chroot /var/chroot Rscript"
R_PREDICT_PATH=/c/Users/Aslam/Desktop/Pfera_application/pfera-r
R_PREDICT_FILE=predict.R