-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fresh install, artisan "Undefined index: driver" error #116
Comments
Hi @seanknox - looks like you might have pulled down an older version of Laravel? I found this: What's your email config look like in whichever environment you're sung, like app/config/testing/mail.php or app/config/local/mail.php? |
Hey @snipe. I tried updating laravel via
Unfortunately I'm still seeing that error. First time using composer/artisan, so please correct me if I'm misunderstanding anything. Here's my app/config/local/mail.php—I've using both the template and copying mail.php as that framework issue suggested. <?php
return array(
/*
|--------------------------------------------------------------------------
| Mail Driver
|--------------------------------------------------------------------------
|
| Laravel supports both SMTP and PHP's "mail" function as drivers for the
| sending of e-mail. You may specify which one you're using throughout
| your application here. By default, Laravel is setup for SMTP mail.
|
| Supported: "smtp", "mail", "sendmail"
|
*/
'driver' => 'local',
/*
|--------------------------------------------------------------------------
| SMTP Host Address
|--------------------------------------------------------------------------
|
| Here you may provide the host address of the SMTP server used by your
| applications. A default option is provided that is compatible with
| the Postmark mail service, which will provide reliable delivery.
|
*/
'host' => 'smtp.mailgun.org',
/*
|--------------------------------------------------------------------------
| SMTP Host Port
|--------------------------------------------------------------------------
|
| This is the SMTP port used by your application to delivery e-mails to
| users of your application. Like the host we have set this value to
| stay compatible with the Postmark e-mail application by default.
|
*/
'port' => 587,
/*
|--------------------------------------------------------------------------
| Global "From" Address
|--------------------------------------------------------------------------
|
| You may wish for all e-mails sent by your application to be sent from
| the same address. Here, you may specify a name and address that is
| used globally for all e-mails that are sent by your application.
|
*/
'from' => array('address' => 'blah@blah.com', 'name' => 'blah'),
/*
|--------------------------------------------------------------------------
| E-Mail Encryption Protocol
|--------------------------------------------------------------------------
|
| Here you may specify the encryption protocol that should be used when
| the application send e-mail messages. A sensible default using the
| transport layer security protocol should provide great security.
|
*/
'encryption' => 'tls',
/*
|--------------------------------------------------------------------------
| SMTP Server Username
|--------------------------------------------------------------------------
|
| If your SMTP server requires a username for authentication, you should
| set it here. This will get used to authenticate with your server on
| connection. You may also set the "password" value below this one.
|
*/
'username' => 'blah',
/*
|--------------------------------------------------------------------------
| SMTP Server Password
|--------------------------------------------------------------------------
|
| Here you may set the password required by your SMTP server to send out
| messages from your application. This will be given to the server on
| connection so that the application will be able to send messages.
|
*/
'password' => 'blah',
/*
|--------------------------------------------------------------------------
| Sendmail System Path
|--------------------------------------------------------------------------
|
| When using the "sendmail" driver to send e-mails, we will need to know
| the path to where Sendmail lives on this server. A default path has
| been provided here, which will work well on most of your systems.
|
*/
'sendmail' => '/usr/sbin/sendmail -bs',
/*
|--------------------------------------------------------------------------
| Mail "Pretend"
|--------------------------------------------------------------------------
|
| When this option is enabled, e-mail will not actually be sent over the
| web and will instead be written to your application's logs files so
| you may inspect the message. This is great for local development.
|
*/
'pretend' => false,
); |
Weird... I'm seeing this in a laravel-bootstrap issue as well, but it was corrected in a previous version: andrewelkins/Laravel-4-Bootstrap#8 Still looking into this - bear with me. |
You're sure your system thinks you're in the local environment? bootstrap/start.php, around line 29: $env = $app->detectEnvironment(array(
)); Did you configure those so to match your local url? |
My $env = $app->detectEnvironment(array(
'local' => array('http://snipe-it.dev', '127.0.0.1', 'localhost*'),
'staging' => array('http://staging.yourserver.com'),
'production' => array('http://www.yourserver.com')
)); All of those in the local array resolve to my local computer. Anything look fishy there? |
Nope, if http://snipe-it.dev is the url you're using to access the application, it should be seeing it as local. Do me a favor and throw some garbage into Like: <?php
echo 'blah blah blah
exit; (with the parse error there on purpose) I'm looking to see if we get a different error, which might imply that it's not actually looking at |
Put that in |
That's helpful info, thank you! It does sorta feel like it's not grokking the |
Sure thing. The only Could my PHP environment possible be setup in some non-standard way? |
It shouldn't be - we're not using any system environmental variables here, it's using only the hostname. Can you take a look at your logs and see if there's anything useful in there? |
Unfortunately there's no log file anywhere in the repo. |
Excellent news! I can reproduce your error! Hold tight please while I investigate further. |
🤘 |
The good news is that this is definitely a bug. ("It's not you, it's me!") The bad news is that this is definitely a bug. :P I'll absolutely get to the bottom of it today though. What's your environment, just for my own reference? |
I'm on OS X Mavericks, using GitHub's Boxen to manage PHP and other system dependencies. Since you can reproduce it I don't think it's Boxen (which installs some tools like PHP in non-standard locations—it's all in my path, but sometimes software that uses hardcoded locations for dependencies instead of sussing out where those dependencies are installed, and that causes problems). Thanks again for the assist. Let me know if I can help further! |
I think I see what's happening. It’s not looking in app/config/local for mail.php, only in app/config. Try cp'ing your mail.php into the app/config directory and try re-running. |
That was the missing piece. I also had to copy Sounds like something isn't looking in app/config/$ENV like it should? |
Yep - that's what I'm trying to track down. It looks like it's correctly defaulting to local, but it's not looking in the right place for local config files. |
Okay, mystery solved. It's sort of a bug, but not exactly. You're running these scripts as command line scripts, so the hostname you provide for apache doesn't actually matter here. What it's looking at is the hostname of your machine, since cli doesn't deal with apache. My computer name, probably like yours, does not have "local" in the name, so the environmental variables for local wouldn't match, so Laravel was defaulting to production every time. This problem can be solved by adding your machine's name (in your Mac terminal, type
Sorry for the hassle - I should really have caught that and specified it in the docs. |
👍 Thanks for tracking this down. Looking forward to playing with snipe-it some more. |
Updated the README in ea0560e to clarify this issue - thanks again - I'm sure we've just saved a lot of people some real headaches! |
Cloned the repo, and upon running artisan (either manually or installing through composer), I receive this error:
Any idea?
The text was updated successfully, but these errors were encountered: