0

I am using PHP and Postgres. I also downloaded homebrew.

I dumped the database into a txt file and uploaded my working code from school to github.

After importing the database onto my own machine and running postgres/psql and am running into this error when trying to access localhost:8000

"Fatal error: Uncaught exception 'PDOException' with message 'could not find driver' in /Users/Geoff/Documents/restaurant/src/Restaurant.php:3 Stack trace: #0 /Users/Geoff/Documents/restaurant/src/Restaurant.php(3): PDO->__construct('pgsql:host=loca...') #1 /Users/Geoff/Documents/restaurant/app/app.php(3): require_once('/Users/Geoff/Do...') #2 /Users/Geoff/Documents/restaurant/web/index.php(2): require_once('/Users/Geoff/Do...') #3 {main} thrown in /Users/Geoff/Documents/restaurant/src/Restaurant.php on line 3"

This is what I get from 'brew doctor'

"Uncaught exception 'Warning: /usr/bin occurs before /usr/local/bin This means that system-provided programs will be used instead of those provided by Homebrew. The following tools exist at both paths:

composer
phar
phar.phar
php
php-config
phpize

Consider setting your PATH so that /usr/local/bin occurs before /usr/bin. Here is a one-liner: echo 'export PATH="/usr/local/bin:$PATH"' >> ~/.bash_profile

Warning: Homebrew's sbin was not found in your PATH but you have installed formulae that put executables in /usr/local/sbin. Consider setting the PATH for example like so echo 'export PATH="/usr/local/sbin:$PATH"' >> ~/.bash_profile"

I have tried changing the export path to multiple places.

This is the error when I type in postgres to the terminal.

"postgres does not know where to find the server configuration file. You must specify the --config-file or -D invocation option or set the PGDATA environment variable."

I am fairly new to this so if you need any more information let me know.

Thanks.

Geoff
  • 1
  • 1
  • It is similar but I am not using MySQL.. – Geoff Mar 19 '15 at 21:00
  • Fair enough -- but I think the underlying issue might be the same. Your school environment probably had the Postgres PHP module installed, but perhaps the Homebrew PHP install does not come with it by default. – rpedroso Mar 19 '15 at 21:03
  • I'm sure the concept applies – Scuzzy Mar 19 '15 at 21:03
  • Figured it out.. The export path that homebrew had installed the files differed from the export path I had set. Simply changed the export path to the correct one and viola. Thank you for responding. – Geoff Mar 19 '15 at 21:29

0 Answers0