Search code examples
ibm-midrange

Does Zend PHP code have to be changed to run on community PHP?


The license to use zend php server basic is ending June 30, 2021.

Will the following code run on IBM i community PHP?

function as400Connect($libl)
{
  $options = array('i5_naming' => DB2_I5_NAMING_ON);
  if (strlen($libl) > 0)
  {
    $options['i5_libl'] = $libl ;
  }
  $conn = db2_connect("*LOCAL", "", "", $options);
  if (!$conn) {
    echo "Connection failed";
    echo "<br>";
    echo db2_conn_errormsg();
    exit();
  }
  return $conn;
}

The code uses the db2_ functions. And it relies on the i5_libl option to set the library list on the server job. Setting the library list is critical when my PHP web applications call SQL stored procedures on the IBM i.


Solution

  • You are in luck! Although I'm not sure about the distribution at the link you provided, our CommunityPlus+ PHP definitely supports the ibm_db2 and i5_libl option. We're official maintainers of the ibm_db2 component.

    See this article in IT Jungle for more.