-1

I know there is a lot on this topic around StackOverflow, but my problem is that i have php extensions already uncommented, i have made the required changes to database.php and .env and i have declared and used the necessary environment path. The only thing i haven't done is install composer due to my proxy restrictions. I have a proxy that is over a kerberos windows AD, and for some reason nothing that used to work with proxy address, port and credentials (user and password) is working anymore, so i found this website to download php libraries and its dependencies without composerand managed to get Laravel 5.6.33 working or at least apparently, becouse when i tried to call: C:\wamp\www\laravel> php artisan migrate:install i got the following error :Illuminate\Database\QueryException : could not find driver (SQL: create table "migrations" ("id" serial primary key not null, "migration" varchar(255) not null, "batch" integer not null))and the following Exception trace: `Exception trace:

1 PDOException::("could not find driver") C:\wamp\www\laravel\vendor\laravel\framework\src\Illuminate\Database\Connectors\Connector.php:68

2 PDO::__construct("pgsql:host=localhost;dbname=tienda;port=5432", "postgres", "admin123", []) C:\wamp\www\laravel\vendor\laravel\framework\src\Illuminate\Database\Connectors\Connector.php:68`

I have to say that i am working on windows 10 Version 10.0.17134.1 64 bits and my wamp server is 3.1.7 with php 7.2.14

Any help or pointer on this issue will be appreciated

abel406
  • 359
  • 5
  • 9
  • Did you install the Postgress database server? WAMPServer does not come with Postgress, so you will have to do that yourself. – RiggsFolly Feb 11 '19 at 13:09
  • Thank you for your comment @RiggsFolly, i had everything installed and working fin. I already found a solution for that matter. – abel406 Feb 11 '19 at 15:03

1 Answers1

1

After a lot of research and frustration, I thought on give it a try to xampp and what I found was that with xampp xampp-win32-7.3.0-0-VC15.exe installed, the correct extensions enabled in the php.ini

extension=pdo_pgsql
extension=pgsql

which in the xamp case is located at

C:\xampp\php

I set the path for xampp php in my Windows 10 Ent it is C:\xampp\php and later run the command

php C:\wamp\www\laravel> php artisan tinker

, after in the tinker console run

Psy Shell v0.9.9 (PHP 7.3.0 — cli) by Justin Hileman >>> DB::connection()->getPdo()

And I got what I was hoping for:

    => PDO {#2863
     inTransaction: false,
     attributes: {
       CASE: NATURAL,
       ERRMODE: EXCEPTION,
       PERSISTENT: false,
       DRIVER_NAME: "pgsql",
       SERVER_INFO: "PID: 1764; Client Encoding: UTF8; Is Superuser: on; Session Authorization: postgres; Date Style: ISO, MDY",
       ORACLE_NULLS: NATURAL,
       CLIENT_VERSION: "9.6.9",
       SERVER_VERSION: "9.6.11",
       STATEMENT_CLASS: [
         "PDOStatement",
       ],
       EMULATE_PREPARES: false,
       CONNECTION_STATUS: "Connection OK; waiting to send.",
       DEFAULT_FETCH_MODE: BOTH,
     },
   }

enter image description here

A response, which means that it found the driver that was always there and was able to use to access the database which was already installed and running.

The rest settings done in wamp with the virtual host and extensions enabled with the PHP version of 7.3.1 are the same and work like a charm.

I hope this may help others until the wamp and laravel teams find a way to make laravel

php artisan migrate

the command to work with wamp 3.1.7 for the x86 architecture alone.

Bilaal Rashid
  • 828
  • 2
  • 13
  • 21
abel406
  • 359
  • 5
  • 9
  • A more flexible solution https://stackoverflow.com/questions/15597067/how-to-run-php-from-windows-command-line-in-wampserver/16289254#16289254 – RiggsFolly Feb 11 '19 at 15:53
  • @RiggsFolly what you propose might be useful. My solution is just to solve the problem of PDO Exception when trying to run migrate command from laravel. I think there is something with laravel console or wamp server why to manage the commands.I hope someone finds a way to fix it wherever the bug is occurring. – abel406 Feb 11 '19 at 22:20