SlideShare a Scribd company logo
www.SeidenGroup.com



ZendCon 2016 

https://joind.in/talk/218b9
Strategic Modernization 

with PHP on IBM i 

Strategic Modernization with PHP on IBM iSeiden Group
Seiden Group and Club Seiden
Alan is a leader and expert in PHP on IBM i; leader, Zend’s PHP Toolkit
for IBM i; and “Performance guru of PHP on IBM i”



Seiden Group is a team of experts available for 

mentoring/troubleshooting/project advice/development.
seidengroup.com, alan@seidengroup.com
2
Strategic Modernization with PHP on IBM iSeiden Group
Contact information
3
Alan Seiden
alan@seidengroup.com
201-447-2437
www.SeidenGroup.com
twitter: @alanseiden
Why I like IBM i
Strategic Modernization with PHP on IBM iSeiden Group
DB2 database at its heart
• DB2 built in
§ Transaction processing workhorse
§ Database implemented below operating system level!
• IBM i’s “Machine Interface (MI)” between OS and hardware
§ Journaling, auditing, commitment control very commonly used
§ Never corrupted
• Doesn’t lose data even if knock out power plug
• Database often taken for granted
§ Self-managing such that DBAs are rare
• MySQL also supported (Zend DBi)
§ Can connect to DB2 via “DB2 Storage Engine”
5
Strategic Modernization with PHP on IBM iSeiden Group
Data and programs last forever
• IBM has been dedicated to legacy app longevity and
data longevity
§ RPG (and occasionally COBOL) running for 30-40 years
§ DB2 data evolving 30-40 years
§ Middleware insulates applications from hardware changes
6
IBM i Heritage chart from Trevor Perry
http://blog.angustheitchap.com/?p=415
Strategic Modernization with PHP on IBM iSeiden Group
Long-serving back ends, new front ends
• What does this mean to you?

§ RPG and DB2, mature and evolving for years, can be part of your
data model, accessed by PHP
§ Create web GUI interfaces and web services around these venerable
resources
• Business logic is encapsulated in RPG/COBOL/DB2
• You can keep your hands somewhat clean of business details

§ Case studies later in this presentation
7
Strategic Modernization with PHP on IBM iSeiden Group
Nondisruptive business growth
• Scales vertically
•One system can handle large and diverse workloads
• Total Cost of Ownership (TCO), including reduced operator costs, is said
to be competitive or cheaper than assembling server farms
•Can activate additional processors without restarting system

• Dependable
•Resistant to viruses
• Object-based system since the 1970s
•Journaling, commitment control, replication, high availability
•Security features galore
•Keeps on running
• You will sleep soundly at night
8
Why I like PHP
Strategic Modernization with PHP on IBM iSeiden Group
PHP runs on IBM i, runs everywhere
• Available for IBM i, Windows, Linux, Mac…
§ Open source, widely used, millions of sites
§ Facebook, Wikipedia, too many to name
• Runs simply on IBM i
• Direct access to DB2 and RPG
§ Accesss LIVE DATA, which we value on IBM i
10
Strategic Modernization with PHP on IBM iSeiden Group
Easy to start small
• My first professional PHP code was one line to send an
email message
• No need to know everything. Start gradually and learn
• PHP is mainstream. Information on php.net and
elsewhere
• A track record of over 20 years of community
+corporate collaboration
11
Strategic Modernization with PHP on IBM iSeiden Group
Integration with IBM i
• PHP Toolkit
§ Call RPG, COBOL, CL
§ Access data queues, data areas, etc
• DB2 and SQL
§ ibm_db2 included on IBM i
§ PDO_IBM may soon be another option
• Zend Framework 2 support of IBM i DB2
§ For larger applications
§ Simulation of LIMIT/OFFSET for easy pagination
• (Db2 has now added real LIMIT/OFFSET, though)
12
Strategic Modernization with PHP on IBM iSeiden Group
Support for APIs and web services
• Web service capabilities in PHP
• Native SOAP functionality
• for REST: json_encode(), json_decode()
• cURL (http and more…talk to the internet) now a native,
included extension
• APIs
§ Using Apigility, PHP can serve “correct” REST APIs,
handling errors, versioning, links
13
Strategic Modernization with PHP on IBM iSeiden Group
Zend/IBM’s commitment from 2005-6
from 2006: “[Andi] Gutmans says Zend intends to port
all its products to System i, treating the platform's users
as first-class citizens.”
http://mcpressonline.com/programming/web-languages/zend-brings-php-to-ibms-i5os.html
14
Strategic Modernization with PHP on IBM iSeiden Group
PHP: Open + Enterprise
15
• Community-driven open source
• Enterprise-ready capabilities from Zend
• Professional support with SLA (Rod/Shlomo)
• Tools in Zend Server
• Monitor
• Code Trace
• Z-Ray
• Job Queue
• Deployment
• Remote debugger
• Zend Studio IDE integrated with Studio
• Developer and production “black box” tools
Strategic Modernization with PHP on IBM iSeiden Group
IBM + Zend
• IBM i systems ship with Zend Server (PHP)
• PHP on IBM i packaged and supported by Zend
16
IBM booth, ZendCon 2010 IBM’s Tony Cairns and Alan S.

working on new toolkit, ZendCon 2011
Strategic Modernization with PHP on IBM iSeiden Group
Community
17
Getting started
Strategic Modernization with PHP on IBM iSeiden Group
Zend Server for IBM i
• Download Zend Server 8.x
• http://www.zend.com/en/products/server/downloads-ibmi
• Easy upgrade from 6.x and 7.x















• Editions
• http://www.zend.com/en/products/server/editions
• Basic (free), Professional, Enterprise
• Same download, different license
19
Strategic Modernization with PHP on IBM iSeiden Group
Flow-ruining technical topic
CCSID
20
Strategic Modernization with PHP on IBM iSeiden Group
Modernize IBM i with CCSID
• CCSID (coded character set identifier) for conversion of
EBCDIC<—>ASCII, Unicode, etc.
•Required when using non-native languages such as PHP or
communicating with the outside world
•An essential component of modernization
• DSPSYSVAL QCCSID
•Anything other than 65535 is OK
•Change with CHGSYSVAL SYSVAL(QCCSID) VALUE(n)

• or in Apache config: /www/zendsvr(6)/conf/httpd.conf
• DefaultFsCCSID 278

CGIJobCCSID 278
•For your CCSID, check the list of “Job CCSID”:
• http://www-03.ibm.com/systems/i/software/globalization/default_list.html 

21
Strategic Modernization with PHP on IBM iSeiden Group
PHP basics: Step 1
• Learn some basic HTML
• Try http://w3schools.com/html
• Tables (<table>,<tr>,<td>) useful for business data
• “View Source” in browser to borrow bits of HTML

• Then learn these as you go
• Javascript
• Adds dynamic functionality to pages
• Cascading style sheets (CSS)
• Modern way to specify colors, fonts, style
• Later…try Bootstrap CSS (getbootstrap.com)
22
Strategic Modernization with PHP on IBM iSeiden Group
Step 2: Try a simple PHP script
• PHP scripts are text files that reside in the IFS
• Edit using notepad or Zend Studio for Eclipse
• Example: /www/zendsvr6/htdocs/helloworld.php
• Run in browser: http://yourIBMi:10080/
helloworld.php
23
<?php
// simple script to test PHP
echo “Hello, world!”;
?>
Strategic Modernization with PHP on IBM iSeiden Group
Step 3: Access db2
• See Zend Server sample application
• Connect to db2 on i
• Select records from a db2 table
• Output the records into an HTML table
24
Strategic Modernization with PHP on IBM iSeiden Group
What else happens when PHP is used?
• Spurs modernized database
• More modular RPG
• New demographics in IT
• IT can “own” innovation again
• Business owners get a taste of what can be done
25
Strategic Modernization with PHP on IBM iSeiden Group
Z-Ray, to speed development
• Shows every query and time for each
• Toolkit extension for Z-Ray shows each program call,
input/output, timing
• Save time otherwise spent hunting in debug logs!
26
Strategic Modernization with PHP on IBM iSeiden Group
Who can program PHP?
• RPG developers who know SQL or can learn it,
especially if they’ve used other languages, too.
• (RPG Free is similar to PHP and most modern
languages, though!)
• Don’t expect great UI, but often nice internal apps
• Outside or new PHP developers
§ Often have broader view of user interface, but still
need to collaborate with RPG/DB2/IBM i person who
understands the data. The combination can work
well.
27
Strategic Modernization with PHP on IBM iSeiden Group


Open source
applications
28
Strategic Modernization with PHP on IBM iSeiden Group
Quick return on investment: open source
• Install open source applications; change the
perception of your IBM i
• Your IBM i will instantly seem “modern.”
• PHP-based content-management systems an easy
place to start
• Joomla, Drupal
• Wordpress
• Mediawiki
• They use MySQL database (included with Zend Server)
§ Can be linked to DB2 using DB2 Storage Engine
29
Strategic Modernization with PHP on IBM iSeiden Group
COMMON Europe: Joomla
• Videos
• News
• Social media widgets
30
Strategic Modernization with PHP on IBM iSeiden Group
Data3: Wordpress
• News-style theme
• Themes are easy to download
• Some free, some not
• Excellent at blogs

but also good at general

content management
31
Strategic Modernization with PHP on IBM iSeiden Group
COMMON.org: Joomla on IBM i
• Zend Server on IBM i
• Manages a great deal of information and media
32
Strategic Modernization with PHP on IBM iSeiden Group


Extend green
screens to the web
33
Strategic Modernization with PHP on IBM iSeiden Group
Call RPG/COBOL: adapt 5250 logic to the web
34
Strategic Modernization with PHP on IBM iSeiden Group
Screen #1, Order header
35
Strategic Modernization with PHP on IBM iSeiden Group
Screen #2, Order detail
36
Strategic Modernization with PHP on IBM iSeiden Group
Screen #3, Content package from detail
(Option 4 from order header)
37
Strategic Modernization with PHP on IBM iSeiden Group
Screen #4, Notes from order detail
F9 key launches this
38
Strategic Modernization with PHP on IBM iSeiden Group
Web page combines all 4 “green screens”
39
Strategic Modernization with PHP on IBM iSeiden Group
Allied Beverage Group
40
Strategic Modernization with PHP on IBM iSeiden Group
Original 5250-mode order entry process
• Aimed at expert customer service users
• Sales reps accessed it using Jadvantage java applet in
browser
§ Better than nothing
§ S-l-o-w logon
§ Forced reps to have expert knowledge of system
• Dicey wireless signals on the road = lost sessions
• RPG was powerful but too complex to be updated with
major new functionality
41
Strategic Modernization with PHP on IBM iSeiden Group
Intro screen
42
Strategic Modernization with PHP on IBM iSeiden Group
Intro with error message (customer)
• f
43
Strategic Modernization with PHP on IBM iSeiden Group
Intro with error message (“return to number”)
44
Strategic Modernization with PHP on IBM iSeiden Group
Main screen
45
Strategic Modernization with PHP on IBM iSeiden Group
Search for a product by description
46
Strategic Modernization with PHP on IBM iSeiden Group
Select a product
47
Strategic Modernization with PHP on IBM iSeiden Group
Help!
48
Strategic Modernization with PHP on IBM iSeiden Group
What Allied wanted in web-based order entry
• Good for sales reps and customers
§ Keep speed while making it easier for newcomers
§ Reps can copy from past orders
§ Lots of information at fingertips (fewer clicks)

• Users can save drafts of orders
§ Drafts are brand-new functionality
§ We use the old RPG logic, but we’re not tied to it
• No problem if temporarily disconnected
§ Stateless web connection can easily resume later

• Overcome 90-item limit
§ So we didn’t have to treat that as an error
§ Internally we split order into 90-item bunches and sent multiple orders to RPG
49
Strategic Modernization with PHP on IBM iSeiden Group
Web ordering intro page
50
Strategic Modernization with PHP on IBM iSeiden Group
Web with account type/search box
51
Strategic Modernization with PHP on IBM iSeiden Group
Web Mode #1: Quick Order Entry
52
Strategic Modernization with PHP on IBM iSeiden Group
Search results
53
Strategic Modernization with PHP on IBM iSeiden Group
Web Mode #2: Standard Order Entry
54
Notice message file messages WP00041 and so on!
Strategic Modernization with PHP on IBM iSeiden Group
AJAX loads dynamic info
55
Strategic Modernization with PHP on IBM iSeiden Group
New web apps
56
Strategic Modernization with PHP on IBM iSeiden Group
ICE award-winner
57
Strategic Modernization with PHP on IBM iSeiden Group
Scotsburn Dairy Group: visitor kiosk
• Front desk kiosk-mounted touch monitor
58
Strategic Modernization with PHP on IBM iSeiden Group
Scotsburn Dairy Group: visitor kiosk
• “Visiting” box has autocomplete
• Saving money on supplies
• Reducing paper use a company goal
59
Strategic Modernization with PHP on IBM iSeiden Group
H-P Products: executive decision tool
• Not pretty—but—
• Enables company to measure time spent on each customer
• Can better set prices appropriate to each customer
60
Strategic Modernization with PHP on IBM iSeiden Group
Mobile
applications
61
Strategic Modernization with PHP on IBM iSeiden Group
Mobile delivery tracker
• Delivery tracker for a building
supply company
• Web application optimized for
mobile phones
• For construction contractors at a
job site
• Live IBM i data from DB2, RPG
• PHP, Apigility, ZF2, AngularJS/Ionic
62
Strategic Modernization with PHP on IBM iSeiden Group
Scrap metal ordering system on iPad
• Exciting blend of RPG, DB2, PHP, HTML5,
mobile device capabilities
• Developer: Adam Shirley, Sabel Steel, Alabama,
USA
• Spurred by government regulations for record-
keeping
• See video
• Slides to follow:
63
Strategic Modernization with PHP on IBM iSeiden Group
Scrap metal system: log in
64
Strategic Modernization with PHP on IBM iSeiden Group
Scrap metal system: read license card
65
Strategic Modernization with PHP on IBM iSeiden Group
Scrap metal system: autofill ID
66
Strategic Modernization with PHP on IBM iSeiden Group
Scrap metal system: take photo of card
67
Strategic Modernization with PHP on IBM iSeiden Group
Scrap metal system: save photo to IFS/DB2
68
Strategic Modernization with PHP on IBM iSeiden Group
Web services
69
Strategic Modernization with PHP on IBM iSeiden Group
PHP can provide and consume
• Many examples of web services with PHP (See http://
alanseiden.com/presentations for more)

• Here is a recent example
70
Strategic Modernization with PHP on IBM iSeiden Group
PHP + JSON: Pennock Floral
• Challenge: connect RPG applications to third-party e-
commerce web services using JSON
§ IT wanted to use IBM i but did not know how
§ Simplest solution would keep RPG in control

• Executives doubted IBM i
§ Were about to seek a solution outside of IT
§ IT needed quick success to prove IBM i could handle HTTP + JSON

71
Strategic Modernization with PHP on IBM iSeiden Group
PHP + JSON: Pennock Floral (slide 2)
• Solution: Use PHP as “glue” to connect RPG to the
JSON-based web services
§ RPG remained simple, easy to manage
§ RPG called PHP, which handled the JSON easily
§ Pennock’s head RPG developer was then able to add new service
consumers himself with RPG and PHP
• “You turned lead into gold”—IT Director
72
Strategic Modernization with PHP on IBM iSeiden Group
Enhance RPG
73
Strategic Modernization with PHP on IBM iSeiden Group
PHP can even enhance RPG green screens
• Graphs, PDF files, Excel spreadsheets
• RPG can call PHP
• PHP can generate and email these graphical items
• Details and code in “PHP Tricks for RPG Programmers”
74
Strategic Modernization with PHP on IBM iSeiden Group
E-mail pie chart from RPG
75
Strategic Modernization with PHP on IBM iSeiden Group
E-mail PDF from RPG
76
Strategic Modernization with PHP on IBM iSeiden Group


Advanced and
future
77
Strategic Modernization with PHP on IBM iSeiden Group
PHP grows with you
• “Procedural style” PHP works, generally easiest for RPG
programmers to learn
• We all start with procedural PHP
• Object-Oriented (OO) syntax: more advanced
• Structure for reusing code, maintenance

• Frameworks, APIs
• Zend Framework, Apigility help structure applications
• Learn after becoming comfortable with OO style
78
Strategic Modernization with PHP on IBM iSeiden Group
“PHP Renaissance” and PHP 7
• Speed boost (at least with popular apps and CMSes…let’s
see about business apps)
• Spurred by competition with Facebook’s “Hack”
79
Strategic Modernization with PHP on IBM iSeiden Group


Summary
80
Strategic Modernization with PHP on IBM iSeiden Group
How to start
• Get PHP by downloading Zend Server for IBM i
§ No charge for Basic license; prefer pro/enterprise if mission critical
app
• Use RPG and DB2 as solid foundation for business
logic.
• Works best if the logic is modular (smaller
programs or procedures)
• Training and help are available. Free and paid
resources
81
Strategic Modernization with PHP on IBM iSeiden Group
Be creative—change perceptions of IBM i
• Adopt open source, no-cost software
§ Joomla, Wordpress, many others

• Extend green screens with a GUI
§ Web and mobile applications engage a wider audience (e.g.
customers)
§ Re-use business logic. RPG still valuable
§ PHP Toolkit enables this
• New applications: choose IBM i
§ Automate manual processes
§ Executive dashboards to improve business decisions
§ Working with open source demonstrates commitment to your chosen
platform and your career as a whole
82
Strategic Modernization with PHP on IBM iSeiden Group
Contact and tips
Alan Seiden
Seiden Group
Ho-Ho-Kus, NJ
83
alan@seidengroup.com ● 201-447-2437 ● twitter: @alanseiden
Free newsletter: 

http://seidengroup.com/tips
Please provide feedback:

https://joind.in/talk/218b9

More Related Content

PDF
PHP Batch Jobs on IBM i
PDF
DB2 and PHP in Depth on IBM i
PDF
From Zero to ZF: Your first zend framework project on ibm i
PDF
PHP Toolkit from Zend and IBM: Open Source on IBM i
PDF
Web services on IBM i with PHP and Zend Framework
PDF
Browser tools that make web development easier
PDF
Create a welcoming development environment on IBM i
PDF
IBM i: Fertile Ground for PHP Developers
PHP Batch Jobs on IBM i
DB2 and PHP in Depth on IBM i
From Zero to ZF: Your first zend framework project on ibm i
PHP Toolkit from Zend and IBM: Open Source on IBM i
Web services on IBM i with PHP and Zend Framework
Browser tools that make web development easier
Create a welcoming development environment on IBM i
IBM i: Fertile Ground for PHP Developers

What's hot (20)

PPTX
Install MariaDB on IBM i - Tips, troubleshooting, and more
PPTX
PHP Installed on IBM i - the Nickel Tour
PPTX
Getting started with PHP on IBM i
PDF
Web Performance First Aid
PDF
Performance tuning with zend framework
PPTX
Zend Products and PHP for IBMi
PPTX
PHP on IBM i Tutorial
PPTX
Fundamentals of performance tuning PHP on IBM i
PDF
Running open source PHP applications on you IBM i
PPT
PHP on Windows - What's New
PDF
Zend Core on IBM i - Security Considerations
KEY
Zend_Tool: Practical use and Extending
PPTX
Zend con 2016 bdd with behat for beginners
PPTX
PHP and Platform Independance in the Cloud
PDF
Getting Started with SQL Server Compact Edition 3.51
PDF
Require js training
KEY
Zend Code in ZF 2.0
PDF
Zend con what-i-learned-about-mobile-first
PDF
Web Clients for Ruby and What they should be in the future
PDF
Performance tuning PHP on IBMi
Install MariaDB on IBM i - Tips, troubleshooting, and more
PHP Installed on IBM i - the Nickel Tour
Getting started with PHP on IBM i
Web Performance First Aid
Performance tuning with zend framework
Zend Products and PHP for IBMi
PHP on IBM i Tutorial
Fundamentals of performance tuning PHP on IBM i
Running open source PHP applications on you IBM i
PHP on Windows - What's New
Zend Core on IBM i - Security Considerations
Zend_Tool: Practical use and Extending
Zend con 2016 bdd with behat for beginners
PHP and Platform Independance in the Cloud
Getting Started with SQL Server Compact Edition 3.51
Require js training
Zend Code in ZF 2.0
Zend con what-i-learned-about-mobile-first
Web Clients for Ruby and What they should be in the future
Performance tuning PHP on IBMi
Ad

Similar to Strategic Modernization with PHP on IBM i (20)

PDF
Ibm i-modernization
PDF
A Tale of Two Toolkits
PDF
What's new with Zend server
PPTX
IBM i at the eart of cognitive solutions
PPTX
Better, Faster, Easier: How to Make Git Really Work in the Enterprise
PPT
Informix 1210 feature overview
PDF
The latest tools for developing your IBM i systems
PDF
Getting started with PHP on IBM i
PDF
SUSE Linux Enterprise Server for IBM Power
PDF
The NRB Group mainframe day 2021 - New Programming Languages on Z - Frank Van...
 
PPTX
Decoupled architecture: Microservice in the middle
PDF
Red Hat for Power Systems IBM Enterprise2014 Las Vegas
PPT
Php Frameworks
PDF
Red Hat for IBM System z IBM Enterprise2014 Las Vegas
PPT
The i7 Framework for System-i
PDF
Средства разработки —IBM iSeries
PDF
Ibm db2 big sql
PDF
Db2 developer ecosystem
DOC
Thomas_Rock_Resume_50B
PDF
Ibm db2update2019 ibm db2 dev ops experience
Ibm i-modernization
A Tale of Two Toolkits
What's new with Zend server
IBM i at the eart of cognitive solutions
Better, Faster, Easier: How to Make Git Really Work in the Enterprise
Informix 1210 feature overview
The latest tools for developing your IBM i systems
Getting started with PHP on IBM i
SUSE Linux Enterprise Server for IBM Power
The NRB Group mainframe day 2021 - New Programming Languages on Z - Frank Van...
 
Decoupled architecture: Microservice in the middle
Red Hat for Power Systems IBM Enterprise2014 Las Vegas
Php Frameworks
Red Hat for IBM System z IBM Enterprise2014 Las Vegas
The i7 Framework for System-i
Средства разработки —IBM iSeries
Ibm db2 big sql
Db2 developer ecosystem
Thomas_Rock_Resume_50B
Ibm db2update2019 ibm db2 dev ops experience
Ad

Recently uploaded (20)

PDF
Upgrade and Innovation Strategies for SAP ERP Customers
PPTX
Introduction to Artificial Intelligence
PDF
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PDF
Wondershare Filmora 15 Crack With Activation Key [2025
PDF
How Creative Agencies Leverage Project Management Software.pdf
PDF
Design an Analysis of Algorithms II-SECS-1021-03
PDF
top salesforce developer skills in 2025.pdf
PDF
System and Network Administraation Chapter 3
PPTX
VVF-Customer-Presentation2025-Ver1.9.pptx
PDF
Understanding Forklifts - TECH EHS Solution
PDF
How to Migrate SBCGlobal Email to Yahoo Easily
PDF
Digital Strategies for Manufacturing Companies
PDF
PTS Company Brochure 2025 (1).pdf.......
PDF
medical staffing services at VALiNTRY
PDF
AI in Product Development-omnex systems
PPTX
Essential Infomation Tech presentation.pptx
PPTX
Odoo POS Development Services by CandidRoot Solutions
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
Upgrade and Innovation Strategies for SAP ERP Customers
Introduction to Artificial Intelligence
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
Wondershare Filmora 15 Crack With Activation Key [2025
How Creative Agencies Leverage Project Management Software.pdf
Design an Analysis of Algorithms II-SECS-1021-03
top salesforce developer skills in 2025.pdf
System and Network Administraation Chapter 3
VVF-Customer-Presentation2025-Ver1.9.pptx
Understanding Forklifts - TECH EHS Solution
How to Migrate SBCGlobal Email to Yahoo Easily
Digital Strategies for Manufacturing Companies
PTS Company Brochure 2025 (1).pdf.......
medical staffing services at VALiNTRY
AI in Product Development-omnex systems
Essential Infomation Tech presentation.pptx
Odoo POS Development Services by CandidRoot Solutions
Internet Downloader Manager (IDM) Crack 6.42 Build 41
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises

Strategic Modernization with PHP on IBM i

  • 2. Strategic Modernization with PHP on IBM iSeiden Group Seiden Group and Club Seiden Alan is a leader and expert in PHP on IBM i; leader, Zend’s PHP Toolkit for IBM i; and “Performance guru of PHP on IBM i”
 
 Seiden Group is a team of experts available for 
 mentoring/troubleshooting/project advice/development. seidengroup.com, alan@seidengroup.com 2
  • 3. Strategic Modernization with PHP on IBM iSeiden Group Contact information 3 Alan Seiden alan@seidengroup.com 201-447-2437 www.SeidenGroup.com twitter: @alanseiden
  • 4. Why I like IBM i
  • 5. Strategic Modernization with PHP on IBM iSeiden Group DB2 database at its heart • DB2 built in § Transaction processing workhorse § Database implemented below operating system level! • IBM i’s “Machine Interface (MI)” between OS and hardware § Journaling, auditing, commitment control very commonly used § Never corrupted • Doesn’t lose data even if knock out power plug • Database often taken for granted § Self-managing such that DBAs are rare • MySQL also supported (Zend DBi) § Can connect to DB2 via “DB2 Storage Engine” 5
  • 6. Strategic Modernization with PHP on IBM iSeiden Group Data and programs last forever • IBM has been dedicated to legacy app longevity and data longevity § RPG (and occasionally COBOL) running for 30-40 years § DB2 data evolving 30-40 years § Middleware insulates applications from hardware changes 6 IBM i Heritage chart from Trevor Perry http://blog.angustheitchap.com/?p=415
  • 7. Strategic Modernization with PHP on IBM iSeiden Group Long-serving back ends, new front ends • What does this mean to you?
 § RPG and DB2, mature and evolving for years, can be part of your data model, accessed by PHP § Create web GUI interfaces and web services around these venerable resources • Business logic is encapsulated in RPG/COBOL/DB2 • You can keep your hands somewhat clean of business details
 § Case studies later in this presentation 7
  • 8. Strategic Modernization with PHP on IBM iSeiden Group Nondisruptive business growth • Scales vertically •One system can handle large and diverse workloads • Total Cost of Ownership (TCO), including reduced operator costs, is said to be competitive or cheaper than assembling server farms •Can activate additional processors without restarting system
 • Dependable •Resistant to viruses • Object-based system since the 1970s •Journaling, commitment control, replication, high availability •Security features galore •Keeps on running • You will sleep soundly at night 8
  • 10. Strategic Modernization with PHP on IBM iSeiden Group PHP runs on IBM i, runs everywhere • Available for IBM i, Windows, Linux, Mac… § Open source, widely used, millions of sites § Facebook, Wikipedia, too many to name • Runs simply on IBM i • Direct access to DB2 and RPG § Accesss LIVE DATA, which we value on IBM i 10
  • 11. Strategic Modernization with PHP on IBM iSeiden Group Easy to start small • My first professional PHP code was one line to send an email message • No need to know everything. Start gradually and learn • PHP is mainstream. Information on php.net and elsewhere • A track record of over 20 years of community +corporate collaboration 11
  • 12. Strategic Modernization with PHP on IBM iSeiden Group Integration with IBM i • PHP Toolkit § Call RPG, COBOL, CL § Access data queues, data areas, etc • DB2 and SQL § ibm_db2 included on IBM i § PDO_IBM may soon be another option • Zend Framework 2 support of IBM i DB2 § For larger applications § Simulation of LIMIT/OFFSET for easy pagination • (Db2 has now added real LIMIT/OFFSET, though) 12
  • 13. Strategic Modernization with PHP on IBM iSeiden Group Support for APIs and web services • Web service capabilities in PHP • Native SOAP functionality • for REST: json_encode(), json_decode() • cURL (http and more…talk to the internet) now a native, included extension • APIs § Using Apigility, PHP can serve “correct” REST APIs, handling errors, versioning, links 13
  • 14. Strategic Modernization with PHP on IBM iSeiden Group Zend/IBM’s commitment from 2005-6 from 2006: “[Andi] Gutmans says Zend intends to port all its products to System i, treating the platform's users as first-class citizens.” http://mcpressonline.com/programming/web-languages/zend-brings-php-to-ibms-i5os.html 14
  • 15. Strategic Modernization with PHP on IBM iSeiden Group PHP: Open + Enterprise 15 • Community-driven open source • Enterprise-ready capabilities from Zend • Professional support with SLA (Rod/Shlomo) • Tools in Zend Server • Monitor • Code Trace • Z-Ray • Job Queue • Deployment • Remote debugger • Zend Studio IDE integrated with Studio • Developer and production “black box” tools
  • 16. Strategic Modernization with PHP on IBM iSeiden Group IBM + Zend • IBM i systems ship with Zend Server (PHP) • PHP on IBM i packaged and supported by Zend 16 IBM booth, ZendCon 2010 IBM’s Tony Cairns and Alan S.
 working on new toolkit, ZendCon 2011
  • 17. Strategic Modernization with PHP on IBM iSeiden Group Community 17
  • 19. Strategic Modernization with PHP on IBM iSeiden Group Zend Server for IBM i • Download Zend Server 8.x • http://www.zend.com/en/products/server/downloads-ibmi • Easy upgrade from 6.x and 7.x
 
 
 
 
 
 
 
 • Editions • http://www.zend.com/en/products/server/editions • Basic (free), Professional, Enterprise • Same download, different license 19
  • 20. Strategic Modernization with PHP on IBM iSeiden Group Flow-ruining technical topic CCSID 20
  • 21. Strategic Modernization with PHP on IBM iSeiden Group Modernize IBM i with CCSID • CCSID (coded character set identifier) for conversion of EBCDIC<—>ASCII, Unicode, etc. •Required when using non-native languages such as PHP or communicating with the outside world •An essential component of modernization • DSPSYSVAL QCCSID •Anything other than 65535 is OK •Change with CHGSYSVAL SYSVAL(QCCSID) VALUE(n)
 • or in Apache config: /www/zendsvr(6)/conf/httpd.conf • DefaultFsCCSID 278
 CGIJobCCSID 278 •For your CCSID, check the list of “Job CCSID”: • http://www-03.ibm.com/systems/i/software/globalization/default_list.html 
 21
  • 22. Strategic Modernization with PHP on IBM iSeiden Group PHP basics: Step 1 • Learn some basic HTML • Try http://w3schools.com/html • Tables (<table>,<tr>,<td>) useful for business data • “View Source” in browser to borrow bits of HTML
 • Then learn these as you go • Javascript • Adds dynamic functionality to pages • Cascading style sheets (CSS) • Modern way to specify colors, fonts, style • Later…try Bootstrap CSS (getbootstrap.com) 22
  • 23. Strategic Modernization with PHP on IBM iSeiden Group Step 2: Try a simple PHP script • PHP scripts are text files that reside in the IFS • Edit using notepad or Zend Studio for Eclipse • Example: /www/zendsvr6/htdocs/helloworld.php • Run in browser: http://yourIBMi:10080/ helloworld.php 23 <?php // simple script to test PHP echo “Hello, world!”; ?>
  • 24. Strategic Modernization with PHP on IBM iSeiden Group Step 3: Access db2 • See Zend Server sample application • Connect to db2 on i • Select records from a db2 table • Output the records into an HTML table 24
  • 25. Strategic Modernization with PHP on IBM iSeiden Group What else happens when PHP is used? • Spurs modernized database • More modular RPG • New demographics in IT • IT can “own” innovation again • Business owners get a taste of what can be done 25
  • 26. Strategic Modernization with PHP on IBM iSeiden Group Z-Ray, to speed development • Shows every query and time for each • Toolkit extension for Z-Ray shows each program call, input/output, timing • Save time otherwise spent hunting in debug logs! 26
  • 27. Strategic Modernization with PHP on IBM iSeiden Group Who can program PHP? • RPG developers who know SQL or can learn it, especially if they’ve used other languages, too. • (RPG Free is similar to PHP and most modern languages, though!) • Don’t expect great UI, but often nice internal apps • Outside or new PHP developers § Often have broader view of user interface, but still need to collaborate with RPG/DB2/IBM i person who understands the data. The combination can work well. 27
  • 28. Strategic Modernization with PHP on IBM iSeiden Group 
 Open source applications 28
  • 29. Strategic Modernization with PHP on IBM iSeiden Group Quick return on investment: open source • Install open source applications; change the perception of your IBM i • Your IBM i will instantly seem “modern.” • PHP-based content-management systems an easy place to start • Joomla, Drupal • Wordpress • Mediawiki • They use MySQL database (included with Zend Server) § Can be linked to DB2 using DB2 Storage Engine 29
  • 30. Strategic Modernization with PHP on IBM iSeiden Group COMMON Europe: Joomla • Videos • News • Social media widgets 30
  • 31. Strategic Modernization with PHP on IBM iSeiden Group Data3: Wordpress • News-style theme • Themes are easy to download • Some free, some not • Excellent at blogs
 but also good at general
 content management 31
  • 32. Strategic Modernization with PHP on IBM iSeiden Group COMMON.org: Joomla on IBM i • Zend Server on IBM i • Manages a great deal of information and media 32
  • 33. Strategic Modernization with PHP on IBM iSeiden Group 
 Extend green screens to the web 33
  • 34. Strategic Modernization with PHP on IBM iSeiden Group Call RPG/COBOL: adapt 5250 logic to the web 34
  • 35. Strategic Modernization with PHP on IBM iSeiden Group Screen #1, Order header 35
  • 36. Strategic Modernization with PHP on IBM iSeiden Group Screen #2, Order detail 36
  • 37. Strategic Modernization with PHP on IBM iSeiden Group Screen #3, Content package from detail (Option 4 from order header) 37
  • 38. Strategic Modernization with PHP on IBM iSeiden Group Screen #4, Notes from order detail F9 key launches this 38
  • 39. Strategic Modernization with PHP on IBM iSeiden Group Web page combines all 4 “green screens” 39
  • 40. Strategic Modernization with PHP on IBM iSeiden Group Allied Beverage Group 40
  • 41. Strategic Modernization with PHP on IBM iSeiden Group Original 5250-mode order entry process • Aimed at expert customer service users • Sales reps accessed it using Jadvantage java applet in browser § Better than nothing § S-l-o-w logon § Forced reps to have expert knowledge of system • Dicey wireless signals on the road = lost sessions • RPG was powerful but too complex to be updated with major new functionality 41
  • 42. Strategic Modernization with PHP on IBM iSeiden Group Intro screen 42
  • 43. Strategic Modernization with PHP on IBM iSeiden Group Intro with error message (customer) • f 43
  • 44. Strategic Modernization with PHP on IBM iSeiden Group Intro with error message (“return to number”) 44
  • 45. Strategic Modernization with PHP on IBM iSeiden Group Main screen 45
  • 46. Strategic Modernization with PHP on IBM iSeiden Group Search for a product by description 46
  • 47. Strategic Modernization with PHP on IBM iSeiden Group Select a product 47
  • 48. Strategic Modernization with PHP on IBM iSeiden Group Help! 48
  • 49. Strategic Modernization with PHP on IBM iSeiden Group What Allied wanted in web-based order entry • Good for sales reps and customers § Keep speed while making it easier for newcomers § Reps can copy from past orders § Lots of information at fingertips (fewer clicks)
 • Users can save drafts of orders § Drafts are brand-new functionality § We use the old RPG logic, but we’re not tied to it • No problem if temporarily disconnected § Stateless web connection can easily resume later
 • Overcome 90-item limit § So we didn’t have to treat that as an error § Internally we split order into 90-item bunches and sent multiple orders to RPG 49
  • 50. Strategic Modernization with PHP on IBM iSeiden Group Web ordering intro page 50
  • 51. Strategic Modernization with PHP on IBM iSeiden Group Web with account type/search box 51
  • 52. Strategic Modernization with PHP on IBM iSeiden Group Web Mode #1: Quick Order Entry 52
  • 53. Strategic Modernization with PHP on IBM iSeiden Group Search results 53
  • 54. Strategic Modernization with PHP on IBM iSeiden Group Web Mode #2: Standard Order Entry 54 Notice message file messages WP00041 and so on!
  • 55. Strategic Modernization with PHP on IBM iSeiden Group AJAX loads dynamic info 55
  • 56. Strategic Modernization with PHP on IBM iSeiden Group New web apps 56
  • 57. Strategic Modernization with PHP on IBM iSeiden Group ICE award-winner 57
  • 58. Strategic Modernization with PHP on IBM iSeiden Group Scotsburn Dairy Group: visitor kiosk • Front desk kiosk-mounted touch monitor 58
  • 59. Strategic Modernization with PHP on IBM iSeiden Group Scotsburn Dairy Group: visitor kiosk • “Visiting” box has autocomplete • Saving money on supplies • Reducing paper use a company goal 59
  • 60. Strategic Modernization with PHP on IBM iSeiden Group H-P Products: executive decision tool • Not pretty—but— • Enables company to measure time spent on each customer • Can better set prices appropriate to each customer 60
  • 61. Strategic Modernization with PHP on IBM iSeiden Group Mobile applications 61
  • 62. Strategic Modernization with PHP on IBM iSeiden Group Mobile delivery tracker • Delivery tracker for a building supply company • Web application optimized for mobile phones • For construction contractors at a job site • Live IBM i data from DB2, RPG • PHP, Apigility, ZF2, AngularJS/Ionic 62
  • 63. Strategic Modernization with PHP on IBM iSeiden Group Scrap metal ordering system on iPad • Exciting blend of RPG, DB2, PHP, HTML5, mobile device capabilities • Developer: Adam Shirley, Sabel Steel, Alabama, USA • Spurred by government regulations for record- keeping • See video • Slides to follow: 63
  • 64. Strategic Modernization with PHP on IBM iSeiden Group Scrap metal system: log in 64
  • 65. Strategic Modernization with PHP on IBM iSeiden Group Scrap metal system: read license card 65
  • 66. Strategic Modernization with PHP on IBM iSeiden Group Scrap metal system: autofill ID 66
  • 67. Strategic Modernization with PHP on IBM iSeiden Group Scrap metal system: take photo of card 67
  • 68. Strategic Modernization with PHP on IBM iSeiden Group Scrap metal system: save photo to IFS/DB2 68
  • 69. Strategic Modernization with PHP on IBM iSeiden Group Web services 69
  • 70. Strategic Modernization with PHP on IBM iSeiden Group PHP can provide and consume • Many examples of web services with PHP (See http:// alanseiden.com/presentations for more)
 • Here is a recent example 70
  • 71. Strategic Modernization with PHP on IBM iSeiden Group PHP + JSON: Pennock Floral • Challenge: connect RPG applications to third-party e- commerce web services using JSON § IT wanted to use IBM i but did not know how § Simplest solution would keep RPG in control
 • Executives doubted IBM i § Were about to seek a solution outside of IT § IT needed quick success to prove IBM i could handle HTTP + JSON
 71
  • 72. Strategic Modernization with PHP on IBM iSeiden Group PHP + JSON: Pennock Floral (slide 2) • Solution: Use PHP as “glue” to connect RPG to the JSON-based web services § RPG remained simple, easy to manage § RPG called PHP, which handled the JSON easily § Pennock’s head RPG developer was then able to add new service consumers himself with RPG and PHP • “You turned lead into gold”—IT Director 72
  • 73. Strategic Modernization with PHP on IBM iSeiden Group Enhance RPG 73
  • 74. Strategic Modernization with PHP on IBM iSeiden Group PHP can even enhance RPG green screens • Graphs, PDF files, Excel spreadsheets • RPG can call PHP • PHP can generate and email these graphical items • Details and code in “PHP Tricks for RPG Programmers” 74
  • 75. Strategic Modernization with PHP on IBM iSeiden Group E-mail pie chart from RPG 75
  • 76. Strategic Modernization with PHP on IBM iSeiden Group E-mail PDF from RPG 76
  • 77. Strategic Modernization with PHP on IBM iSeiden Group 
 Advanced and future 77
  • 78. Strategic Modernization with PHP on IBM iSeiden Group PHP grows with you • “Procedural style” PHP works, generally easiest for RPG programmers to learn • We all start with procedural PHP • Object-Oriented (OO) syntax: more advanced • Structure for reusing code, maintenance
 • Frameworks, APIs • Zend Framework, Apigility help structure applications • Learn after becoming comfortable with OO style 78
  • 79. Strategic Modernization with PHP on IBM iSeiden Group “PHP Renaissance” and PHP 7 • Speed boost (at least with popular apps and CMSes…let’s see about business apps) • Spurred by competition with Facebook’s “Hack” 79
  • 80. Strategic Modernization with PHP on IBM iSeiden Group 
 Summary 80
  • 81. Strategic Modernization with PHP on IBM iSeiden Group How to start • Get PHP by downloading Zend Server for IBM i § No charge for Basic license; prefer pro/enterprise if mission critical app • Use RPG and DB2 as solid foundation for business logic. • Works best if the logic is modular (smaller programs or procedures) • Training and help are available. Free and paid resources 81
  • 82. Strategic Modernization with PHP on IBM iSeiden Group Be creative—change perceptions of IBM i • Adopt open source, no-cost software § Joomla, Wordpress, many others
 • Extend green screens with a GUI § Web and mobile applications engage a wider audience (e.g. customers) § Re-use business logic. RPG still valuable § PHP Toolkit enables this • New applications: choose IBM i § Automate manual processes § Executive dashboards to improve business decisions § Working with open source demonstrates commitment to your chosen platform and your career as a whole 82
  • 83. Strategic Modernization with PHP on IBM iSeiden Group Contact and tips Alan Seiden Seiden Group Ho-Ho-Kus, NJ 83 alan@seidengroup.com ● 201-447-2437 ● twitter: @alanseiden Free newsletter: 
 http://seidengroup.com/tips Please provide feedback:
 https://joind.in/talk/218b9