You’ll first have to configure an ODBC connection “System DSN”/”System Data Source” via the “iSeries Access ODBC driver” or it might be call the IBM i Access driver which you can learn how to download and install here:
Here’s some of the ways to configure the odbc connection
Once you have the ODBC connection setup you can use it in PHP and here’s a Simple Example on how to execute SQL remotely and safely on an IBM i via ODBC. Note you won’t want to dump the error info in production its there to alert you about errors.
Here’s an example on how to run a SQL extenal stored procedure
Make sure to enable SSL to encrypt your SQL statements that are sent
Run C:\Windows\SysWOW64\odbcad32.exe and edit connection options and make sure ssl is selected or IBM i navigator is defaulted to ssl
guide is here: http://www.redbooks.ibm.com/redbooks/pdfs/sg246551.pdf … under 2.6 Encrypt the connection with Secure Sockets Layer