0

I'm creating a general webapp that is displaying data from a Postgres database hosted on Digital Ocean.

My problem is that I can't get the PHP script to run on my webserver(hosted by Hostgator) to talk to the database(postgis) hosted on Digital Ocean. The PHP script sends a SQL query to the db and converts the results to GeoJSON.

I can get this exact PHP script to work on my local webserver (xampp - apache) but, as soon as I transfer all the files on HostGator I get a PHP error when trying to load the map. Note that I used * to block out my username and paths.

Am I suppose to load some php files on my Webserver on hostgator ?

    `enter code here`"Fatal error: Uncaught PDOException: could not find driver in /home****/`enter code here`public_html/******/tdata.php:10 Stack trace: #0 /home2/*****/****/****/tdata.php(10)
: PDO->__construct('pgsql:host=*****', '***', '*****', Array) #1 {main} thrown in /********/getdata.php on line 10"
  • php.ini hostgator.com/help/article/what-is-php-ini – Mapperz Dec 10 '19 at 4:23
  • So I have to config the php.ini file on hostgator? I think I have to uncomment some postgres function correct ? – AdamGIS Dec 10 '19 at 14:30
  • correct but this getting off topic as not GIS related but web administration. – Mapperz Dec 10 '19 at 17:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.