SQL Issues
I use SQL Server 2008 in my network and I updated the database .php file to reflect this, but when I run "php artisan app:install" it returns:
"Application key [HIDDEN] set successfully.
[InvalidArgumentException] Database [] not configured.
app:install C:\inetpub\techweb\snipe-it> "
Here is my database php file:
/* |-------------------------------------------------------------------------- | 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' => 'sqlsrv',
/*
|--------------------------------------------------------------------------
| 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' => array(
'sqlite' => array(
'driver' => 'sqlite',
'database' => __DIR__.'/../database/production.sqlite',
'prefix' => '',
),
'mysql' => array(
'driver' => 'mysql',
'host' => 'localhost',
'database' => 'snipeit_laravel',
'username' => 'snipeit_laravel',
'password' => '',
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
),
'pgsql' => array(
'driver' => 'pgsql',
'host' => 'localhost',
'database' => 'database',
'username' => 'root',
'password' => '',
'charset' => 'utf8',
'prefix' => '',
'schema' => 'public',
),
'sqlsrv' => array(
'driver' => 'sqlsrv',
'host' => 'HIDDEN',
'database' => 'snipeit',
'username' => 'snipeit',
'password' => 'HIDDEN',
'prefix' => '',
),
What do I need to do to get things working here?
What this usually means is that whatever environment your install thinks it's running in, there is no database.php in there. Where is that database.php file that you're referring to?
it is under c:\inetpub\wwwroot\Snipe-it\app\config\local\
Can you confirm that your app actually thinks it's in local mode?
If the hostname in the bootstrap/start.php doesn't match the actual hostname, it will default to production.
Can you show me what you have in that file for:
$env = $app->detectEnvironment(array(
'local' => array('YourLocalDevHostname','AlisonMBP'),
'staging' => array('staging.yourserver.com'),
'production' => array('www.yourserver.com')
));
(Another way to tell is if the debugbar is showing up - it won't show up in production mode)
Or you can just move the database.php into app/config. That should also work.
I did determine that it was trying to use the production environment. However now running the same install command, I am getting an error from line 99 in the database.php file: PHP Parse error: syntax error, unexpected 'migrations' (T_STRING), expecting ')
I've honestly never tried this with SQL server, but that's a PHP Parse error. Can you confirm what version of PHP you're using?
(Also, can you show me what line 90-100 are in that file for you? Obv obscure any passwords)
It just contains: 'migrations' => 'migrations',
The PHP version on the server is 5.6.3
Any updates in regards to this?
Can you give that line along with a few lines before, and a few lines after - for context?
I wonder if there's a syntax error on the previous line, which is why it's erroring on that line.
Here are lines 90-105
| 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 have not actually be run in the databases. | */
'migrations' => 'migrations',
/*
|--------------------------------------------------------------------------
| Redis Databases
|--------------------------------------------------------------------------
|
Was able to get that taken care of, now im getting an SQL error.
Step: 2
Preparing your Application
Application key [HIDDEN] set successfully. Migration table created successfully. Migrated: 2012_12_06_225921_migration_cartalyst_sentry_install_users Migrated: 2012_12_06_225929_migration_cartalyst_sentry_install_groups Migrated: 2012_12_06_225945_migration_cartalyst_sentry_install_users_groups_pivo t Migrated: 2012_12_06_225988_migration_cartalyst_sentry_install_throttle
[Illuminate\Database\QueryException]
SQLSTATE[42000]: [Microsoft][ODBC Driver 11 for SQL Server][SQL Server]Inco rrect syntax near 'MODIFY'. (SQL: ALTER TABLE users MODIFY phone varchar(20 ) null)
app:install
Did you get the problem "Incorrect syntax near 'MODIFY'" fixed?
I am having this exact same issue. Could anyone answer this?
Application key [HIDDEN] set successfully. Migration table created successfully. Migrated: 2012_12_06_225921_migration_cartalyst_sentry_install_users Migrated: 2012_12_06_225929_migration_cartalyst_sentry_install_groups Migrated: 2012_12_06_225945_migration_cartalyst_sentry_install_users_groups_pivo t Migrated: 2012_12_06_225988_migration_cartalyst_sentry_install_throttle
[Illuminate\Database\QueryException]
SQLSTATE[42000]: [Microsoft][ODBC Driver 11 for SQL Server][SQL Server]Inco rrect syntax near 'MODIFY'. (SQL: ALTER TABLE users MODIFY phone varchar(20 ) null)
app:install
Not sure this will work with SQL Server. The MODIFY syntax doesn't exist in SQL server.
Hello. Has this been fixed? If sql server is not supported it would be nice if the documentation would say so. That way we wouldn't waste time attempting. Alternatively, it would be great if it worked...
The requirements specify MySQL or MariaDB
The sqlsrv connection info inside of database.php is a little misleading. I ended up using MySQL. Thanks for the quick response. The site is great.