Laravel 5.7 - Windows 2012 R2 - XAMPP 7.2 - SQLSRV 11.0 not working












0















I have checked my php configuration with this code:



<?php

$tsql = "SELECT id FROM tbl1";

$conn = sqlsrv_connect( 'localhost', ["Database"=>"lv_detritus", "UID"=>"laravel_user", "PWD"=>"euldlm1605"]);

$getData = sqlsrv_query($conn, $tsql);

while ($id = sqlsrv_fetch_array($getData, SQLSRV_FETCH_ASSOC)) {
echo $id['id'];
}
sqlsrv_free_stmt($getData);

$conn_pdo = new PDO("sqlsrv:Server=localhost;Database=lv_detritus", "laravel_user", "euldlm1605");

$getData_pdo = $conn_pdo->prepare($tsql);
$getData_pdo->execute();
$ids_pdo = $getData_pdo->fetchAll(PDO::FETCH_ASSOC);

echo '<br/>';
foreach ($ids_pdo as $id_pdo) {
echo $id_pdo['id'];
}

?>


and it's working fine (show 12345 twice that's the data on my table).



Then configured a fresh laravel project /.env:



DB_CONNECTION=sqlsrv
DB_HOST=localhost
DB_PORT=1433
DB_DATABASE=lv_detritus
DB_USERNAME=laravel_user
DB_PASSWORD=*****


But when try to run php artisan migrate:



IlluminateDatabaseQueryException : could not find driver (SQL: select * from sysobjects where type = 'U' and name = migrations)



at W:laravelappsprovesvendorlaravelframeworksrcIlluminateDatabaseConnection.php:664



(I tried too with the IP of server, IPinstance but continues with same error)



Can someone help me?



Thanks!










share|improve this question























  • my fault!!! was using terminal on PhpStorm to run migrate connected to a share via UNC drive... the php it's well configured in server but not in local.

    – David Barrabes Vera
    Nov 27 '18 at 8:20
















0















I have checked my php configuration with this code:



<?php

$tsql = "SELECT id FROM tbl1";

$conn = sqlsrv_connect( 'localhost', ["Database"=>"lv_detritus", "UID"=>"laravel_user", "PWD"=>"euldlm1605"]);

$getData = sqlsrv_query($conn, $tsql);

while ($id = sqlsrv_fetch_array($getData, SQLSRV_FETCH_ASSOC)) {
echo $id['id'];
}
sqlsrv_free_stmt($getData);

$conn_pdo = new PDO("sqlsrv:Server=localhost;Database=lv_detritus", "laravel_user", "euldlm1605");

$getData_pdo = $conn_pdo->prepare($tsql);
$getData_pdo->execute();
$ids_pdo = $getData_pdo->fetchAll(PDO::FETCH_ASSOC);

echo '<br/>';
foreach ($ids_pdo as $id_pdo) {
echo $id_pdo['id'];
}

?>


and it's working fine (show 12345 twice that's the data on my table).



Then configured a fresh laravel project /.env:



DB_CONNECTION=sqlsrv
DB_HOST=localhost
DB_PORT=1433
DB_DATABASE=lv_detritus
DB_USERNAME=laravel_user
DB_PASSWORD=*****


But when try to run php artisan migrate:



IlluminateDatabaseQueryException : could not find driver (SQL: select * from sysobjects where type = 'U' and name = migrations)



at W:laravelappsprovesvendorlaravelframeworksrcIlluminateDatabaseConnection.php:664



(I tried too with the IP of server, IPinstance but continues with same error)



Can someone help me?



Thanks!










share|improve this question























  • my fault!!! was using terminal on PhpStorm to run migrate connected to a share via UNC drive... the php it's well configured in server but not in local.

    – David Barrabes Vera
    Nov 27 '18 at 8:20














0












0








0








I have checked my php configuration with this code:



<?php

$tsql = "SELECT id FROM tbl1";

$conn = sqlsrv_connect( 'localhost', ["Database"=>"lv_detritus", "UID"=>"laravel_user", "PWD"=>"euldlm1605"]);

$getData = sqlsrv_query($conn, $tsql);

while ($id = sqlsrv_fetch_array($getData, SQLSRV_FETCH_ASSOC)) {
echo $id['id'];
}
sqlsrv_free_stmt($getData);

$conn_pdo = new PDO("sqlsrv:Server=localhost;Database=lv_detritus", "laravel_user", "euldlm1605");

$getData_pdo = $conn_pdo->prepare($tsql);
$getData_pdo->execute();
$ids_pdo = $getData_pdo->fetchAll(PDO::FETCH_ASSOC);

echo '<br/>';
foreach ($ids_pdo as $id_pdo) {
echo $id_pdo['id'];
}

?>


and it's working fine (show 12345 twice that's the data on my table).



Then configured a fresh laravel project /.env:



DB_CONNECTION=sqlsrv
DB_HOST=localhost
DB_PORT=1433
DB_DATABASE=lv_detritus
DB_USERNAME=laravel_user
DB_PASSWORD=*****


But when try to run php artisan migrate:



IlluminateDatabaseQueryException : could not find driver (SQL: select * from sysobjects where type = 'U' and name = migrations)



at W:laravelappsprovesvendorlaravelframeworksrcIlluminateDatabaseConnection.php:664



(I tried too with the IP of server, IPinstance but continues with same error)



Can someone help me?



Thanks!










share|improve this question














I have checked my php configuration with this code:



<?php

$tsql = "SELECT id FROM tbl1";

$conn = sqlsrv_connect( 'localhost', ["Database"=>"lv_detritus", "UID"=>"laravel_user", "PWD"=>"euldlm1605"]);

$getData = sqlsrv_query($conn, $tsql);

while ($id = sqlsrv_fetch_array($getData, SQLSRV_FETCH_ASSOC)) {
echo $id['id'];
}
sqlsrv_free_stmt($getData);

$conn_pdo = new PDO("sqlsrv:Server=localhost;Database=lv_detritus", "laravel_user", "euldlm1605");

$getData_pdo = $conn_pdo->prepare($tsql);
$getData_pdo->execute();
$ids_pdo = $getData_pdo->fetchAll(PDO::FETCH_ASSOC);

echo '<br/>';
foreach ($ids_pdo as $id_pdo) {
echo $id_pdo['id'];
}

?>


and it's working fine (show 12345 twice that's the data on my table).



Then configured a fresh laravel project /.env:



DB_CONNECTION=sqlsrv
DB_HOST=localhost
DB_PORT=1433
DB_DATABASE=lv_detritus
DB_USERNAME=laravel_user
DB_PASSWORD=*****


But when try to run php artisan migrate:



IlluminateDatabaseQueryException : could not find driver (SQL: select * from sysobjects where type = 'U' and name = migrations)



at W:laravelappsprovesvendorlaravelframeworksrcIlluminateDatabaseConnection.php:664



(I tried too with the IP of server, IPinstance but continues with same error)



Can someone help me?



Thanks!







sqlsrv laravel-5.7






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 21 '18 at 10:14









David Barrabes VeraDavid Barrabes Vera

564




564













  • my fault!!! was using terminal on PhpStorm to run migrate connected to a share via UNC drive... the php it's well configured in server but not in local.

    – David Barrabes Vera
    Nov 27 '18 at 8:20



















  • my fault!!! was using terminal on PhpStorm to run migrate connected to a share via UNC drive... the php it's well configured in server but not in local.

    – David Barrabes Vera
    Nov 27 '18 at 8:20

















my fault!!! was using terminal on PhpStorm to run migrate connected to a share via UNC drive... the php it's well configured in server but not in local.

– David Barrabes Vera
Nov 27 '18 at 8:20





my fault!!! was using terminal on PhpStorm to run migrate connected to a share via UNC drive... the php it's well configured in server but not in local.

– David Barrabes Vera
Nov 27 '18 at 8:20












0






active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53409768%2flaravel-5-7-windows-2012-r2-xampp-7-2-sqlsrv-11-0-not-working%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53409768%2flaravel-5-7-windows-2012-r2-xampp-7-2-sqlsrv-11-0-not-working%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







這個網誌中的熱門文章

Academy of Television Arts & Sciences

L'Équipe

1995 France bombings