The Zen of Using PHP without Zend Server...w PHP can be called from CL and RPG too! w Often software...

61
The Zen of PHP without Zend Server Alan Seiden Richard Schoen

Transcript of The Zen of Using PHP without Zend Server...w PHP can be called from CL and RPG too! w Often software...

Page 1: The Zen of Using PHP without Zend Server...w PHP can be called from CL and RPG too! w Often software development kits (SDKs) were written in PHP w Easy to get started w Still control

The Zen of PHP without Zend Server AlanSeidenRichardSchoen

Page 2: The Zen of Using PHP without Zend Server...w PHP can be called from CL and RPG too! w Often software development kits (SDKs) were written in PHP w Easy to get started w Still control

Principal,SeidenGroupMentorsCIOs&developmentteamsDelivermoderntechnicalsolutions

OpenSourceAdvocateCo-developerofPHPToolkitforIBMiFounderofClubSeidencommunity

Host/Sponsor,CIOSummit

Alan Seiden

Page 3: The Zen of Using PHP without Zend Server...w PHP can be called from CL and RPG too! w Often software development kits (SDKs) were written in PHP w Easy to get started w Still control

Owner,MobiGoGoFormerowner,RJSSoftwareSystemsInnovatorinIBMisolutions(30+years)MemberofSeidenGroupSrSolutionsConsultant-Pegasystems

BuilderDeveloperofiForgitIBMigitclientIBMi,Windows,LinuxDeveloperMobileAppDeveloperRPG,CL,C#,VB,Node,PHP,Python,Java,HTML,CSS,etc.

Richard Schoen

[email protected]

Page 4: The Zen of Using PHP without Zend Server...w PHP can be called from CL and RPG too! w Often software development kits (SDKs) were written in PHP w Easy to get started w Still control

DevelopwebandmobileapplicationsSupportCommunityPHP

TroubleshootthetoughestissuesTraindevelopersinopensource&IBMi

PHPAPIsGit

Node.jsDb2Python

Open Source Experts

seidengroup.com

Page 5: The Zen of Using PHP without Zend Server...w PHP can be called from CL and RPG too! w Often software development kits (SDKs) were written in PHP w Easy to get started w Still control

Why PHP?

Page 6: The Zen of Using PHP without Zend Server...w PHP can be called from CL and RPG too! w Often software development kits (SDKs) were written in PHP w Easy to get started w Still control

w  PHPhasbeenpivotalinbringingwebapplicationstoIBMi

w  Opensourceapplications:CMSes,eCommercew  MantisBugTrackerwasanoldiebutgoodie

w  Award-winningapplicationsacrossallindustriesw  ContinuetoaccessyourDb2data,RPGcode,andmorew  PHPToolkithelpedcompatibilityandintegrationw  WebservicesandAPIs

w  FirsttasteofcallingexternalAPIsfromIBMiw  Creditcardpayments… Salesforce…manymore

w  Convertinggreenscreenstoweb

w  Communityandconferencesites

w  Blogsw  Wordpress..beyondblogs..StarWarssite,

more!

Web apps and APIs

Page 7: The Zen of Using PHP without Zend Server...w PHP can be called from CL and RPG too! w Often software development kits (SDKs) were written in PHP w Easy to get started w Still control

w  PHPcanbecalledfromCLandRPGtoo!w  Oftensoftwaredevelopmentkits(SDKs)werewritteninPHPw  Easytogetstartedw  StillcontrolflowfromtraditionalRPGw  UsenewPHPpowertoaccessAPIsandotherfunctionality,create

spreadsheets,graphics,etc.

w  PHPhasalwayscontainedallthebasicstoservewebpagesandaccessAPIsw  SOAPinthebeginning,RESTnow

w Millionsofusers;presentonallwebhosts

w  HelpedmaketheIBMimoremainstream

Use PHP from RPG, CL, etc.

Page 8: The Zen of Using PHP without Zend Server...w PHP can be called from CL and RPG too! w Often software development kits (SDKs) were written in PHP w Easy to get started w Still control

w  2004:AlanneededPHPoni5!w  i5php.net—RobWard’ssitew  IncludedODBCbutwasmissingmail()function!

w  2006:ZendCore—IBMshippedinitsDVDsw  ZendPlatformpaidadd-on

w  2008-9ZendServerw  No-costOSS+adminpages+paidadd-onsbundledw  Basic/Professional/Enterpriselicenses

w  2019:CommunityPHPw  RPM-basedw  IncludesODBCagain

PHP on IBM i timeline

Page 9: The Zen of Using PHP without Zend Server...w PHP can be called from CL and RPG too! w Often software development kits (SDKs) were written in PHP w Easy to get started w Still control

w  ZendServerBasiclicensewithdrawnbyJune2021

w  PHPiswidespreadonIBMi

w  Ano-chargeoptionisstillneeded

w  RPM-basedPHPtotherescue!w  LaunchedbyIBMandZend(Perforce)w  Canbeadapted/enhancedw  Itworkswell

w  StillanoptiontopayforZendServerProfessionalandEnterprise

w  GiveRPMsatryforlicense-freePHP

PHP in 2020-2021

Page 10: The Zen of Using PHP without Zend Server...w PHP can be called from CL and RPG too! w Often software development kits (SDKs) were written in PHP w Easy to get started w Still control

Why RPM your PHP?

Page 11: The Zen of Using PHP without Zend Server...w PHP can be called from CL and RPG too! w Often software development kits (SDKs) were written in PHP w Easy to get started w Still control

w Minutesinsteadofhours

w  NolaboriousFTP’ing,unzipping,SAVF,nohours-longinstallation

w  Industry-standardYumcommandw  SameasotherIBMiopensourcethesedaysw  Under/QOpenSysw  The“coolkids”likeit!

w  Quickupgrades,toow  Yum update

w  Gainevenmorespeedbyautomating/scriptingtheinstallation

Quick installation

Page 12: The Zen of Using PHP without Zend Server...w PHP can be called from CL and RPG too! w Often software development kits (SDKs) were written in PHP w Easy to get started w Still control

w  ChooseApacheornginx

w  YourexistingApacheandFastCGIconfigsstillwork!

w Multiplewebserverinstancesfordifferentworkloads

w  TestinparallelwithexistingZendServer

w  Couldinstallmultipleversionsviachroot

Flexible installation

Page 13: The Zen of Using PHP without Zend Server...w PHP can be called from CL and RPG too! w Often software development kits (SDKs) were written in PHP w Easy to get started w Still control

w  RPMPHPis64-bit,whileZendServerisstill32-bitw  (asofMay2020)

w Whatdoesthatmean?

w Moredatawithouterrors(nomorememorydumperrors)

w  Good-bye,“LDR_CNTRL”memoryhack!

More bits = more data!

Page 14: The Zen of Using PHP without Zend Server...w PHP can be called from CL and RPG too! w Often software development kits (SDKs) were written in PHP w Easy to get started w Still control

w  PHP7wasalreadyfast

w  PHP7withRPMsisevenfasterw  ACPUtypebenchmarktestIranshowed0.11secondsinsteadofZendServer0.31seconds

w  Thatwasn’tarealisticdatabase-typetest,butwasagreatstart!

w  Lighterdistributionisquickertostartup,toow  EspeciallyPHP-CLIcalledfromCL,RPG,etc.

Improved performance

Page 15: The Zen of Using PHP without Zend Server...w PHP can be called from CL and RPG too! w Often software development kits (SDKs) were written in PHP w Easy to get started w Still control

w  AlthoughCommunityPHPismissingsomeoftheextensionsthatwerebundledinZendServer….

w  “Wecanrebuildthem!”

w  Severalpopularonesw  Ibm_db2w  Ldapw  Imagemagickw  Implementingmail()withsendmail

w  IBMhasdoneagreatjobinbuildinginfrastructuretoletusaddtheextensionswewantandneed

This PHP is open and flexible

Page 16: The Zen of Using PHP without Zend Server...w PHP can be called from CL and RPG too! w Often software development kits (SDKs) were written in PHP w Easy to get started w Still control

On PHP 7 Yet?

Page 17: The Zen of Using PHP without Zend Server...w PHP can be called from CL and RPG too! w Often software development kits (SDKs) were written in PHP w Easy to get started w Still control

w  SpurredbycompetitionwithFacebook’s“Hack”

w  Noticeablespeeduponlargesites—pages“pop”

PHP 7’s Faster than PHP 5.x

Page 18: The Zen of Using PHP without Zend Server...w PHP can be called from CL and RPG too! w Often software development kits (SDKs) were written in PHP w Easy to get started w Still control

w  Newfeatures:w  https://www.php.net/manual/en/migration70.new-features.php

w  Codechangesrequired?Long-deprecatedfunctionsremovedw  https://wiki.php.net/rfc/remove_deprecated_functionality_in_php7w  OldMySQLcodeusingthemysql_*functionsshouldbeupdatedtomysqli_*(“IMySQLImproved”)orPDO

w  Oldregularexpressionsyntax“ereg()”wasremovedw  https://www.scriptarticle.com/function-ereg-is-deprecated-in-php-5-3-x/

What else about PHP 7?

Page 19: The Zen of Using PHP without Zend Server...w PHP can be called from CL and RPG too! w Often software development kits (SDKs) were written in PHP w Easy to get started w Still control

w  Yourcodeshould“justwork”withafewexceptionsw  https://www.seidengroup.com/2017/07/24/resources-for-upgrading-to-php-7-on-ibm-i/

w  RPMupgradetoPHP7isthesameexceptusethepath/QOpenSys/pkgs/bin/php

w  Check/usr/local/zendsvr6/var/log/php.logfordeprecationnoticesw  Testyourcodewithhttps://github.com/Alexia/php7mar

w  PHP7canruninparallelwitholderversionssuchasPHP5.6w  (IfyoufindPHP6,letusknow!J)

Upgrading from PHP 5.6 to PHP 7

Page 20: The Zen of Using PHP without Zend Server...w PHP can be called from CL and RPG too! w Often software development kits (SDKs) were written in PHP w Easy to get started w Still control

Simple Speed Test Script (SSTS) <?php

// homemade profiler using microtime(true), current time in seconds

$start = microtime( true );

for ($i=0 ; $i<1000000 ; $i++) {

serialize($i);

}

$end = microtime( true );

$duration = $end - $start;

echo "Took " . $duration . " seconds.\n";

Page 21: The Zen of Using PHP without Zend Server...w PHP can be called from CL and RPG too! w Often software development kits (SDKs) were written in PHP w Easy to get started w Still control

PHP 5.6 vs 7.3 $start = microtime( true );

for ($i=0 ; $i<1000000 ; $i++) {

serialize($i);

}

$end = microtime( true );

$duration = $end - $start;

echo "Took " . $duration . " seconds.\n";

RunfromCALLQP2TERMorSSHterminalcd /www/myserver/htdocs [location of speedtest.php]

1.  /usr/local/zendsvr6/bin/php –n speedtest.php “Took 0.37887215614319 seconds.” (PHP 5.6.18)

2.  /usr/local/zendphp7/bin/php –n speedtest.php “Took 0.30699110031128 seconds.” (PHP 7.3.11)

3.  /QOpenSys/pkgs/bin/php –n speedtest.php “Took [really short/quick time; but it’s a narrow, made-up benchmark] seconds” (PHP 7.3.17)

Page 22: The Zen of Using PHP without Zend Server...w PHP can be called from CL and RPG too! w Often software development kits (SDKs) were written in PHP w Easy to get started w Still control

Let’s Install PHP!

Page 23: The Zen of Using PHP without Zend Server...w PHP can be called from CL and RPG too! w Often software development kits (SDKs) were written in PHP w Easy to get started w Still control

w  ToinstallCommunityPHPwithODBC,weliketheseinstructionsfromKingHarrison(K3S):w  https://odbcphp.k3s.com/

w WerecommendSSHtogetintoPASEw  STRTCPSVR*SSHDw  Industry-standard:youryoungerdeveloperswillthankyou(installthebashshellforthem!)w  (Inbash,theup-arrowkeyworkslikeF9tobringbackpriorcommands)

w  OpensourcesoftwareworksbetterinSSHthaninQP2TERMorQSH

Install PHP using Yum

Page 24: The Zen of Using PHP without Zend Server...w PHP can be called from CL and RPG too! w Often software development kits (SDKs) were written in PHP w Easy to get started w Still control

w  FollowtheK3SinstructionstomakesureYumandtheOpenSourcePackageManagementwindowofACSaresetupw  https://www.ibm.com/support/pages/getting-started-open-source-package-management-ibm-i-acs

w  AddtheCommunityPHPrepositorytoyourIBMi’sYum/RPMenvironmentw  yum-config-manager--add-repohttp://repos.zend.com/ibmiphp/w  (Orothernon-IBMrepoyouneedtoadd)w  Youcouldevencreateyourownrepositoryw  Forexample,wemaintainourown“repos”containingadditionalRPM-

basedmodules

Getting Yum ready

Page 25: The Zen of Using PHP without Zend Server...w PHP can be called from CL and RPG too! w Often software development kits (SDKs) were written in PHP w Easy to get started w Still control

Open Source Package Management

w  IBMisshserverservicemustberunningonport22

Page 26: The Zen of Using PHP without Zend Server...w PHP can be called from CL and RPG too! w Often software development kits (SDKs) were written in PHP w Easy to get started w Still control

Open Source Package Management (ACS)

w  LoginwithaQSECOFRor*ALLOBJleveluser

Page 27: The Zen of Using PHP without Zend Server...w PHP can be called from CL and RPG too! w Often software development kits (SDKs) were written in PHP w Easy to get started w Still control

Open Source Package Management

w  Youmayreceivetheseprompts.JustsayYes!

Page 28: The Zen of Using PHP without Zend Server...w PHP can be called from CL and RPG too! w Often software development kits (SDKs) were written in PHP w Easy to get started w Still control

Open Source Package Management

w  Allisworkingifyouseelistofpackages!

Page 29: The Zen of Using PHP without Zend Server...w PHP can be called from CL and RPG too! w Often software development kits (SDKs) were written in PHP w Easy to get started w Still control

w  Theyumcommand:w  Yum install php-* w  TIP:Youruserprofilemusthave*ALLOBJtoinstallviaYum

w MorefromtheK3Ssetupdocumentw  SetupApacheorNginxwebserverw  YoucancontinuetouseyourexistingApacheinstancesthatZendServer

createdw  SetupODBCforDb2accessrunningonIBMiw  HowtouseODBCtoconnectfromaLinuxorWindowscomputertotheIBMiaswell!

w  TipsforusingthePHPToolkit(XMLSERVICE)

Install PHP using Yum (continued)

Page 30: The Zen of Using PHP without Zend Server...w PHP can be called from CL and RPG too! w Often software development kits (SDKs) were written in PHP w Easy to get started w Still control

w  FastCGIprestartsPHPjobstohandlewebworkloads

w Minimalcontentsoffastcgi.conf(in/www/myserver/conf/):w  Server type="application/x-httpd-php" CommandLine="/QOpenSys/pkgs/bin/php-cgi" StartProcesses="1"

w  Additional/optionalkeystoincludeinfastcgi.conf:w  HowmanyPHPjobstostartw  SetEnv="PHP_FCGI_CHILDREN=20"

w  Howlongtowaitbeforea408timeoutw  RequestTimeout="60"

FastCGI configuration

Page 31: The Zen of Using PHP without Zend Server...w PHP can be called from CL and RPG too! w Often software development kits (SDKs) were written in PHP w Easy to get started w Still control

# fastcgi.conf Server type="application/x-httpd-php" CommandLine="/QopenSys/pkgs/bin/php-cgi" StartProcesses="1" SetEnv="LIBPATH=/QOpenSys/pkgs/lib" SetEnv="PHPRC=/QOpenSys/etc/" SetEnv="PHP_FCGI_CHILDREN=20" SetEnv="PHP_FCGI_MAX_REQUESTS=0" ConnectionTimeout="30" RequestTimeout="60" SetEnv="CCSID=1208" SetEnv="LANG=C”

w  PHP_FCGI_CHILDRENw  MaxnumberofPHPjobsneededatonetimew  Defaultof10islow.Try20,30,40,50,andtest.w  WerunamonitortotrackhowmanyPHPjobsareusedatatime.

w  RequestTimeoutw  SecondsbeforeFastCGIreturnsanHTTP408errorw  Considersettingupmultiplewebserverinstancestohandlevaryingworkloads(slowvs.fast)

Enabling and optimizing FastCGI—Details

Page 32: The Zen of Using PHP without Zend Server...w PHP can be called from CL and RPG too! w Often software development kits (SDKs) were written in PHP w Easy to get started w Still control

w  nginxwebserverw  FlexiblewebserveralternativetoApachew  Fullopensource--notcoveredbySWMAasApacheis,butyoucouldbuyIBMTSSsupportifneeded

w  Allowsautomatedsetup,includingofSSL(noDCM)w  NginxworkswellwithalternateFastCGIcalledphp-fpm

w  Php.inisettingsw  EditdirectlyinthePhp.inifileusingEDTForyourfavoriteeditororvimJ

w  date.timezonew  https://www.php.net/manual/en/timezones.phpw  date.timezone = America/New_York

Other options

Page 33: The Zen of Using PHP without Zend Server...w PHP can be called from CL and RPG too! w Often software development kits (SDKs) were written in PHP w Easy to get started w Still control

ODBC is Back!

Page 34: The Zen of Using PHP without Zend Server...w PHP can be called from CL and RPG too! w Often software development kits (SDKs) were written in PHP w Easy to get started w Still control

History of Open Source Connectivity

w  Before,IBMbuiltcustommiddlewareforeachlangfortheCLI.ProwascouldcustomizeforIBMiandDb2.ProblemsinCLIthough.

w  Db2ConnectproductallowedsamecodeLUWandIBMi.“WanttocodeonPC/laptopandthenrunonIBMi.”LocaldebuggingwithfavoriteIDE.Twoversionsofcode:ODBCfreeorpay/configDb2Connect.

w  Opensourceontheriseandtotherescue,unixODBCdriver.WasonWindowsandLinuxbutnotIBMi.Neededdb2driverunderneaththatworkedinPASE.

w  NOWODBConIBMi.MakingIBMiworkasmainstreamaspossible.Genericconnector!Don’tneedtocreatespecialversionsanymore.w  FrameworksthathaveODBCcanworknow.w  YoumaydeveloponPC,thendeploytoIBMi

Page 35: The Zen of Using PHP without Zend Server...w PHP can be called from CL and RPG too! w Often software development kits (SDKs) were written in PHP w Easy to get started w Still control

ODBC Architecture IBMi

IBMiDB2Database

unixODBCDriverManager

IBMiAccessODBCDriver

OPM/ILEAppsRPG,CL,COBOL

PASEApps

PHP,Python,Node

RemoteIBMiDB2Database

Windows,Linux,MacandnativeIBMiDeveloperscanuseexactsamecodebasewithnochanges

Page 36: The Zen of Using PHP without Zend Server...w PHP can be called from CL and RPG too! w Often software development kits (SDKs) were written in PHP w Easy to get started w Still control

Install ODBC Yum Package Prerequisites

w  Installyum

w  Installwget

w  Installrpminstalled

w  InstallunixODC

w  InstallunixODBC-devel

w WewilluserpmcommandwhenweinstalltheIBMiAccessODBCdriver

Page 37: The Zen of Using PHP without Zend Server...w PHP can be called from CL and RPG too! w Often software development kits (SDKs) were written in PHP w Easy to get started w Still control

Download IBM i PASE ODBC Driver

w  IBMiAccessClientSolutionsSite:https://www.ibm.com/support/pages/ibm-i-access-client-solutions**Note:YouwillneedanIBMaccounttologinanddownload

Page 38: The Zen of Using PHP without Zend Server...w PHP can be called from CL and RPG too! w Often software development kits (SDKs) were written in PHP w Easy to get started w Still control

Download IBM i PASE ODBC Driver

Page 39: The Zen of Using PHP without Zend Server...w PHP can be called from CL and RPG too! w Often software development kits (SDKs) were written in PHP w Easy to get started w Still control

Upload IBM i Access PASE ODBC Driver

w  Unzipibm-iaccess-1.1.0.xx-0.ibmi7.2.ppc64.rpmfromIBMiAccess_v1r1_PASE_AP.zip

w  Uploadibm-iaccess-1.1.0.xx-0.ibmi7.2.ppc64.rpmtoIFSrootdiras:/ibm-iaccess-1.1.0.xx-0.ibmi7.2.ppc64.rpmusingyourfavoritefiletransfertool.

w  Note:“xx”aboveisfileversionnumberinyourdownload.AsofMay2020,itwas“14”.

Page 40: The Zen of Using PHP without Zend Server...w PHP can be called from CL and RPG too! w Often software development kits (SDKs) were written in PHP w Easy to get started w Still control

Install IBM i Access PASE ODBC Driver

w  StartQshell(STRQSH),PASE(CALLQP2TERM)or(BEST)sshterminalsessionusingputty,MobaXterm,MacTerminal,orothersshterminalclient

w  RuncommandlistbelowtoinstalltheIBMiAccessODBCdriver

w  cd/PATH=/QOpenSys/pkgs/binexportPATH

rpm-iibm-iaccess-1.1.0.xx-0.ibmi7.2.ppc64.rpm

w  Onceinstallhascompletedyouwillbenotifiedonthecommandline.

Page 41: The Zen of Using PHP without Zend Server...w PHP can be called from CL and RPG too! w Often software development kits (SDKs) were written in PHP w Easy to get started w Still control

Check for Default ODBC Data Source

w  Fromyourterminal(again,SSHisbest)

w  RuncommandlistbelowtolisttheIBMiAccessODBCdriverdefaultsfromodbc.ini

w  cd/QOpenSys/etc

catodbc.ini

w  Catcommanddisplayscontentsofodbc.ini

Page 42: The Zen of Using PHP without Zend Server...w PHP can be called from CL and RPG too! w Often software development kits (SDKs) were written in PHP w Easy to get started w Still control

Check for Default ODBC Data Source

w  Contentsofdefaultodbc.inifile

w  YoushouldbeabletoconnecttootherIBMisystems

w  ChangelocalhosttoothersystemhostnameorIPaddress

w  UsePassword

Page 43: The Zen of Using PHP without Zend Server...w PHP can be called from CL and RPG too! w Often software development kits (SDKs) were written in PHP w Easy to get started w Still control

Potential PTFs Needed

w  PTFneededfor*CURRENTusertoworkwithoutpasswordw  7.2:SI68113w  7.3:SI69058w  7.4:(noneneeded;comeswiththeoperatingsystem)

w  *CURRENTonlyworksonlocalhostsystem(samepartitionasyourcode)

Page 44: The Zen of Using PHP without Zend Server...w PHP can be called from CL and RPG too! w Often software development kits (SDKs) were written in PHP w Easy to get started w Still control

First ODBC Connections

Page 45: The Zen of Using PHP without Zend Server...w PHP can be called from CL and RPG too! w Often software development kits (SDKs) were written in PHP w Easy to get started w Still control

isql command line

w  TypeisqlandpressEnter

w  Showscommandlineoptions

w  Optiondetails:w  https://www.mankier.com/1/isql

Page 46: The Zen of Using PHP without Zend Server...w PHP can be called from CL and RPG too! w Often software development kits (SDKs) were written in PHP w Easy to get started w Still control

Connecting to DB2 via ODBC

w  Type:isql*LOCAL–vandpressEnter

Page 47: The Zen of Using PHP without Zend Server...w PHP can be called from CL and RPG too! w Often software development kits (SDKs) were written in PHP w Easy to get started w Still control

Running a Query Test

w  Type:select*fromqiws.qcustcdtandpressEnter

w Whendone,typequitandpressEntertoexitisql

Page 48: The Zen of Using PHP without Zend Server...w PHP can be called from CL and RPG too! w Often software development kits (SDKs) were written in PHP w Easy to get started w Still control

Your PHP on ODBC

<?php

$connection = odbc_connect('*LOCAL', '', ’');

$stmt = odbc_exec($connection, 'select * from QIWS.QCUSTCDT');

while ($row = odbc_fetch_array($stmt)) {

print_r($row);

}

Page 49: The Zen of Using PHP without Zend Server...w PHP can be called from CL and RPG too! w Often software development kits (SDKs) were written in PHP w Easy to get started w Still control

It works! <?php

$connection = odbc_connect('*LOCAL', '', ’');

$stmt = odbc_exec($connection, 'select * from QIWS.QCUSTCDT');

while ($row = odbc_fetch_array($stmt)) {

print_r($row);

}

Page 50: The Zen of Using PHP without Zend Server...w PHP can be called from CL and RPG too! w Often software development kits (SDKs) were written in PHP w Easy to get started w Still control

Optimizing ODBC

Page 51: The Zen of Using PHP without Zend Server...w PHP can be called from CL and RPG too! w Often software development kits (SDKs) were written in PHP w Easy to get started w Still control

w  PrestartjobsnamedQZDASOINITruninQUSRWRK

w  Checkoutcurrentconfiguration:w  DSPSBSDSBSD(qusrwrk)w  Thenchoose10,Prestartjobentriesw  Type5nexttoQZDASOINIT

w  Defaultsareverylow.w  Initialjobs=1,threshold=1,adljobs=2

w  Configureasneeded:CHGPJE SBSD(QSYS/QUSRWRK) PGM(QSYS/QZDASOINIT) STRJOBS(*YES) INLJOBS(xx) THRESHOLD(xx) ADLJOBS(xx)

Configure ODBC Prestart Jobs

Page 52: The Zen of Using PHP without Zend Server...w PHP can be called from CL and RPG too! w Often software development kits (SDKs) were written in PHP w Easy to get started w Still control

w  DSPACTPJSBS(QSYSWRK)PGM(QSQSRVR)[ibm_db2]

w  DSPACTPJSBS(QUSRWRK)PGM(QZDASOINIT)[odbc]

Display Prestart Job Usage Statistics

Page 53: The Zen of Using PHP without Zend Server...w PHP can be called from CL and RPG too! w Often software development kits (SDKs) were written in PHP w Easy to get started w Still control

Choose an IDE

Page 54: The Zen of Using PHP without Zend Server...w PHP can be called from CL and RPG too! w Often software development kits (SDKs) were written in PHP w Easy to get started w Still control

w  Eclipse-basedIDEsw  NetBeansw  https://netbeans.org

w  ZendStudiow  https://store.zend.com/zend-studio-for-ibm-i-basicw  (formerlyfreeforIBMi,nowpaid)

w MicrosoftVisualStudioandVSCodew  https://code.visualstudio.com/docs/languages/phpw  TIP:InstallSSHplugin(https://code.visualstudio.com/docs/remote/ssh)

w  PHPStorm(https://www.jetbrains.com/phpstorm)w  Paidproductforpowerusers(Seidendevelopers’fave)

Editors, editors, editors! And more!

Page 55: The Zen of Using PHP without Zend Server...w PHP can be called from CL and RPG too! w Often software development kits (SDKs) were written in PHP w Easy to get started w Still control

Debugging techniques

Page 56: The Zen of Using PHP without Zend Server...w PHP can be called from CL and RPG too! w Often software development kits (SDKs) were written in PHP w Easy to get started w Still control

w  Var_dump()anderror_log()aregreatbutlimited

w  Xdebugw  https://xdebug.org/w  Industry-standardfamousPHPextensionw  Single-stepdebugger,includingremotedebugging(ontheIBMi),stacktraces,andmore

w  IDEdebuggersw  NearlyIDEshavedebugging.Examples:w  VSCode:https://marketplace.visualstudio.com/items?

itemName=felixfbecker.php-debugw  PHPStormwithxdebug:https://www.jetbrains.com/help/phpstorm/

debugging-with-phpstorm-ultimate-guide.htmlw  VisualStudioPHPTools

Interactive debugging with PHP

Page 57: The Zen of Using PHP without Zend Server...w PHP can be called from CL and RPG too! w Often software development kits (SDKs) were written in PHP w Easy to get started w Still control

Let’s Code!

Page 58: The Zen of Using PHP without Zend Server...w PHP can be called from CL and RPG too! w Often software development kits (SDKs) were written in PHP w Easy to get started w Still control

w Seewhereourimaginationstakeus!

Live coding session with Richard

Page 59: The Zen of Using PHP without Zend Server...w PHP can be called from CL and RPG too! w Often software development kits (SDKs) were written in PHP w Easy to get started w Still control

Support Options

Page 60: The Zen of Using PHP without Zend Server...w PHP can be called from CL and RPG too! w Often software development kits (SDKs) were written in PHP w Easy to get started w Still control

w  Communitysupportoptionsw  GetPHPversionupdatesfromCommunityPHPrepositoryw  Ryver(https://ibmioss.ryver.com)w  IBMiOSSmidrange.comlist(https://archive.midrange.com/opensource)

w  Paidsupportoptions(includingbreak/fix)w  Perforce(Zend)w  Break/fix+extras+tools

w  Seidenw  Migrationhelp+break/fix+tools+repoofextensions(e.g.ibm_db2)

w  IBM(TSS)w  Break/fix

w  Theremaybeothers–Letusknow

How is RPM PHP Supported?

Page 61: The Zen of Using PHP without Zend Server...w PHP can be called from CL and RPG too! w Often software development kits (SDKs) were written in PHP w Easy to get started w Still control

AlanSeidenSeidenGroupHo-Ho-Kus,[email protected]:@alanseidenStayinTouch:seidengroup.com/tips

[email protected]://mobigogo.net

Contact | Stay in Touch