|
Right now, I'm trying to make a simple "Hello World" style PHP script
connecting to the IBM i via i5_X functions. I can use the db2_X functions
to connect to the databases; just unable to use the i5_X functions. I'm
certain that I am not getting the right PHP Class
(require_once('iToolkitService.php');) Does anyone have a suggestion on
what this required file name should be? It's not in my current directory,
but appears to be in the "ZENDSVR6\var\libraries\PHP_To
olkit_for_IBMI_i\1.5.0\library". I've tried including the
ToolkitService.php, with no success. I've been reading, but struggling to
get this to work.
For reference, I did install the XML Toolkit demo applications and those
seem to be working.
_*Error Messages (when running PHP Code)*_
When I run the PHP script, the following error is displayed:*
*
*Fatal error*: Call to undefined function i5_pconnect()
in*/www/zendsvr6/htdocs/DEV/helloworld/index.php*on line*60*
_*
*_
_*PHP Code
*_
<?php
//Getting i5 Functions
require_once('iToolkitService.php');
$i5System = '<REMOVED>';
$i5Username = '<REMOVED>';
$i5Password = '<REMOVED>';
$conn = i5_pconnect($i5System,$i5Username,$i5Password);
if (!$conn) {
$error = i5_error();
echo " Error during connection\n";
echo "<BR> Error number: ".$error["num"];
echo "<BR> Error category: ".$error["cat"];
echo "<BR> Error message: ".$error ["msg"];
echo "<BR> Error description: ".$error ["desc"];
trigger_error("I5 persistent connection fails", E_USER_ERROR);
}
else {
echo "Connection OK ";
$isnew = i5_get_property(I5_NEW_CONNECTION);
if($isnew) {
echo "New connection. Do some job initialization \n";
}
}
/* leaves connection without closing it. */
/* Make it available for another script. */
$ret = i5_close($conn);
if($ret){
echo " I5 disconnected";
}
else
{
$ret = i5_errormsg($conn);
}
?>
_*System Information*_
_*ZSMENU*_
Zend Server for IBM i 8.5.5 (PHP 5.6)
XML Toolkit 1.9.1
_*Zend Server Application Libraries*_
PHP Toolkit for IBMI i (1.5.0)
Symfony 2.3 (2.3.42)
Zend Framework 1 (1.12.8)
Zend Framework 2 (2.4.9)
_*Zend Server Plugins*_
XmltoolKit (1.0.2)
ZF-Commons (1.0.1)
Zend Framework 1 (1.0.8)
Zend Framework 2 (1.0.6)
I'm not sure if I'm heading in the right direction. Any suggestions or
guidance is appreciated.
-JA-
--
Jason Aleski / IT Specialist
--
This is the Web Enabling the IBM i (AS/400 and iSeries) (WEB400) mailing
list
To post a message email: WEB400@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/web400
or email: WEB400-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/web400.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.