Php Error Call To Undefined Function Pg_connect
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company call to undefined function pg_connect() wamp Business Learn more about hiring developers or posting ads with us Stack Overflow Questions fatal error call to undefined function pg_connect() in xampp Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million call to undefined function pg_connect() windows programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Fatal error: Call to undefined function pg_connect() up vote 17 down vote favorite 6 I am trying to connect to my php fatal error call to undefined function pg_connect() linux database (remote server) which has PostgreSQL installed in it. My PHP code is trying to connect to the database using pg_connect(), but I get the error saying:- "Fatal error: Call to undefined function pg_connect() in /var/www/website/functions.php on line 82". The line 82 simply is: $db = pg_connect($conn_string); where $conn_string = "host=".$hostname." port=5432 dbname=".$dbname." user=".$db_user." password=".$db_password."" (all variables defined earlier) I checked many forums and the only solution suggested was locating the php.ini file which
Call To Undefined Function Pg_connect() Ubuntu
contains a line:- extension = pgsql.so (for UNIX) and extension = php_pgsql.dll (for Windows). This statement is supposed to be commented and the solution is to uncomment it. I have tried it but still does not change the situation. The remote server has a version later than PostgreSQL v9.0.4 installed. I then installed PostgreSQL v8.4.8 on to my laptop and ran the website locally using MAMP. At first, Apache crashed for some odd reason, I fixed that problem but again I ended up with the same error as before i.e. Fatal error: Call to undefined function pg_connect().... I also ran the phpinfo() and it showed that the php version does support the PostgreSQL module.I have spent an entire day searching for the solution but have been unsuccessful. This is my first project developing a website and I am out of wits. Any kinda help will be highly appreciated. phpinfo() gives me a huge list of things at the terminal but the listings relevant to PostgreSQL are as follows:- pdo_pgsql PDO Driver for PostgreSQL => enabled PostgreSQL(libpq) Version => 9.0.4 Module version => 1.0.2 Revision => $Id: pdo_pgsql.c 306939 2011-01-01 02:19:59Z felipe $ pgsql PostgreSQL Support => enabled PostgreSQL(libpq) Version => 9.0.4 Multibyte character support => enabled SSL support => enabled Active Persistent Links => 0 Active Links =>
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings
Call To Undefined Function Pg_connect() Mac
and policies of this site About Us Learn more about Stack Overflow codeigniter call to undefined function pg_connect() the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation pg_connect example Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it http://stackoverflow.com/questions/7438059/fatal-error-call-to-undefined-function-pg-connect only takes a minute: Sign up Fatal error: Call to undefined function pg_connect() up vote 0 down vote favorite Today I have updated my MacBook to OS X 10.12 After the update new configs (httpd.config and php.ini) were added and the old configs was renamed previous. I changed the confignames and everything works finde. Everything? No, postgres was not loaded. http://stackoverflow.com/questions/40124200/fatal-error-call-to-undefined-function-pg-connect I created a phpinfo() test.php to check this. And yes, postgres was not loaded. A view into the apache error log say: PHP Fatal error: Call to undefined function pg_connect(). php osx postgresql php-pgsql share|improve this question edited yesterday Clayton Smith 3,65421231 asked Oct 19 at 6:53 Vinay Emmaadii 306 1 You need to pecl install pgsql –Farkie Oct 19 at 7:10 add a comment| 1 Answer 1 active oldest votes up vote 0 down vote You have to install it. You can install it as below Ubuntu Terminal sudo apt-get install php5-pgsql Mac OS Follow this link and let me know https://www.moncefbelyamani.com/how-to-install-postgresql-on-a-mac-with-homebrew-and-lunchy/ After everything is done, You can test by placing this in your index.php file share|improve this answer answered 2 days ago Patrick R 3417 add a comment| Your Answer draft saved draft discarded Sign up or log in Sign up using Google Sign up using Facebook Sign up using Email and Password Post as a guest Name Email Post as a guest Name Email discard By posting your answer, you agree to the priva
there Pages: 1 #1 2011-06-07 04:04:42 xangelux Member Registered: 2010-05-29 Posts: 73 [SOLVED] pg_connect() undefined fatal even when all is there I'm trying to get php, postgresql and apache2 working https://bbs.archlinux.org/viewtopic.php?id=120384 but when i try to connect throug pg_connect() the apache server complains:Fatal error: Call to undefined function pg_connect()I've been throug all forums and wikis and I'm shure i have the correct settings. php.ini has the extension=pgsql.so thing, phpinfo() displays '--with-pdo-pgsql=shared' '--with-pdo-sqlite=shared,/usr' '--with-pgsql=shared' on the configuration part and php-pgsql is installed. Nowhere says what to do in this case, call to can anyone help?Thanks in advance. Last edited by xangelux (2011-07-06 01:53:55) Offline #2 2011-07-06 01:53:28 xangelux Member Registered: 2010-05-29 Posts: 73 Re: [SOLVED] pg_connect() undefined fatal even when all is there Fuuuuuuuuuuuuuuuuuuuuu"#$% finally i found the answer, the problem is PHP is looking for extensions in the EXTENSIONS directory but... here it comes... "THEY CHANGED THE EXTENSIONS TO DIR call to undefined MODULES!!!!!!!!!!!!!" WTF?????? HUGGEE BUG.Ok so, the workarround is:$ su - Password: # ln -s /usr/lib/php/modules /usr/lib/php/extensionsAnd then edit your /etc/php/php.ini and change the extension_dir to "/usr/lib/php/extensions/"That's it, this is for every extension that doesn't work (I've tryed uncomment others with the same result until i did this)If someone tryed to search for it, thanks for your effort, for those who suffered like me, here is your answer. If this doesn't work let me know, maybe i did something else to my system too. Offline Pages: 1 Index »Networking, Server, and Protection »[SOLVED] pg_connect() undefined fatal even when all is there Board footer Jump to Newbie Corner Installation Kernel & Hardware Applications & Desktop Environments Laptop Issues Networking, Server, and Protection Multimedia and Games System Administration Other Architectures Announcements, Package & Security Advisories Arch Discussion Forum & Wiki discussion Pacman & Package Upgrade Issues [testing] Repo Forum Creating & Modifying Packages AUR Issues, Discussion & PKGBUILD Requests GNU/Linux Discussion Community Contributions Programming & Scripting Other Languages Artwork and Screenshots Atom topic feed Powered by FluxBB