Call to undefined function db2_connect()

General discussion on Zend Studio for IBM System i
Post Reply
jeff7312
Posts: 1
Joined: Thu Mar 26, 2015 3:29 pm

Call to undefined function db2_connect()

Post by jeff7312 » Thu Mar 26, 2015 3:32 pm

Debugging with Zend Studio
I'm trying to learn my way around Zend Studio, and the php code executed from a browser works fine. But, when I try to debug as php script, I get the following error:

Debug Error: [path to php file] line 8 - Call to undefined function db2_connect()
Fatal error: Call to undefined function db2_connect() in [path to php file] on line 8

And here are the first few lines of code:
Code:
<?php
// Connect to the database
$database = "*LOCAL";
$user = "";
$password = "";
$hostname = "localhost";

$conn_rsrc = db2_connect($database, $user, $password);

if (!$conn_rsrc){
echo "Connection failed. SQL ERR:";
echo db2_conn_error();
echo "<br />";
echo db2_conn_errormsg();
exit();
}

scot4260
Posts: 2
Joined: Thu Apr 23, 2015 9:15 pm

Re: Call to undefined function db2_connect()

Post by scot4260 » Fri Apr 24, 2015 3:10 pm

Jeff, did you ever get an answer on this? I'm having the same issue.

scot7520
Posts: 1
Joined: Mon Sep 25, 2017 7:24 pm

Re: Call to undefined function db2_connect()

Post by scot7520 » Mon Sep 25, 2017 7:25 pm

Same here!

mitc2064
Posts: 3
Joined: Wed Mar 08, 2017 8:09 pm

Re: Call to undefined function db2_connect()

Post by mitc2064 » Fri Sep 29, 2017 3:49 am

I've had this issue before and resolved it by restarting Zend Server. Still no clue as to what caused the issue.

Post Reply