× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



I am not exactly sure why you are using the i5 functions if you are just
getting started. The i5 functions are as a compatibility wrapper for
legacy functions that are no longer provided with Zend Server. It doesn't
appear you have the include to load the compatibility wrapper, which is
probably why it cannot find i5_pconnect.

I would recommend taking a look at the examples here:





On Fri, Aug 19, 2016 at 4:02 PM, Jason Aleski <jason.aleski@xxxxxxxxx>
wrote:

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 thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.