DigitalOcean support team couldnt solve this issue. i ve Ubuntu 16.04 with php7, apache2, PostgreSQL v9.5 and im running php code to read data form PostgreSQL from my 2nd server.
here is the code php http://pastebin.com/R3bwfXtR
but im getting Call to undefined function pg_Connect() in /home/f****/public_html/.****.net/new.php on line 11
php -i result: http://pastebin.com/5z6G73Tw
i tried like every possible soluitons but no luck. im open to all solutions i can give u server access if u really needed
Please help
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hi,
Try installing this: apt-get install php5-pgsql And also check your command is pg_connect all lower case.
Make sure you restart apache afterwards.
If that’s still failing afterwards perhaps add the port to your connection string,
Thanks
Mike
The actual function is pg_connect not pg_Connect (you’re using a C instead of c in the function name).
The function should look like the following:
pg_connect("host=host_ip port=5432 dbname=db_name user=db_user password=db_pass");
Did you ever figure it out, I’ve got the same problem using same snippet of PHP
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.