december 16, 2009 - sbsusa.com to enterprise php on ibm i.pdfdecember 16, 2009. alan seiden ......
TRANSCRIPT
Moving to Enterprise PHP on IBM i
Alan SeidenSpecialist, PHP on IBM [email protected]
December 16, 2009
Moving to Enterprise PHP on IBM i | 16-December-2009 | 2Alan Seiden, Strategic Business Systems
Strategic Business Systems, Inc.
• IBM Business Partner Provides hardware, software development, consulting
for IBM i Developer of web apps on i since 1996 Based in Ramsey, New Jersey
• Zend (“the PHP company”) partner Zend brought PHP to IBM i in 2006 We offer Zend’s training and software to complement our own
consulting/development services
Moving to Enterprise PHP on IBM i | 16-December-2009 | 3Alan Seiden, Strategic Business Systems
Alan Seiden
PHP on IBM i Developer / Consultant / Mentor• Contributor to IBM’s Redbook PHP: Zend Core for i5/OS• First IBM i developer certified in Zend Framework• Developer of IBM/COMMON’s “Best Web Solution” of 2009
Contact: [email protected] or 201-327-9400Blog/articles: alanseiden.com
Moving to Enterprise PHP on IBM i | 16-December-2009 | 4Alan Seiden, Strategic Business Systems
What we’ll discuss today
• Why we chose PHP over other web technologies• Getting started with PHP • A road map of how to build your PHP skills• Showing what Zend software you need at
different stages
• Strategy and big picture, not a detailed technical tutorial (save that for another day)
Moving to Enterprise PHP on IBM i | 16-December-2009 | 5Alan Seiden, Strategic Business Systems
Why we chose PHP over .NET
• .NET would lock us in to Wintel servers Costs of hardware Added complexity to administer Middleware
• PHP runs completely on your good old “i” Uses IBM’s native Apache web server Backed by IBM, shipped with v5r4 and beyond We CAN run PHP on Windows, but it’s our choice Connects directly to db2 database
Moving to Enterprise PHP on IBM i | 16-December-2009 | 6Alan Seiden, Strategic Business Systems
Why we chose PHP over Java
• Java is a heavier solution Tends to require significant system resources and
configuration Requires sophisticated developers to create apps
• PHP is light on its feet Efficient—runs well out of the box Create useful functionality quickly; start small and grow
• Plenty of room for sophistication in larger apps Fast; low CPU load
Moving to Enterprise PHP on IBM i | 16-December-2009 | 7Alan Seiden, Strategic Business Systems
1995 1997 1999 2000 2002 2003 2004 2005 2006 2007
20M
15M
10M
5MRasmusLerdorfIntroducesPHP/FI
PHP 4 Released
• 1M Internet domains
• Zend Engine• Zend Founded
Yahoo! Standardizeson PHP
PHP 5.0(XML,SOAP,OOP)Zend Studio
IBM, Oracle Endorse PHP
Zeev Suraski & Andi Gutmanslead the development of PHP 3
PHP’s growth as web dev language (as of 2007)
Zend Framework & Eclipse project (PDT) announced; i5/OS support
PHPInternet Domains
25M
ZF and PDT released, PHP 4 EOLannounced
PHP Proliferation
37% growth in PHP developers
34% of the internet runs on PHP
Moving to Enterprise PHP on IBM i | 16-December-2009 | 8Alan Seiden, Strategic Business Systems
Reasons for PHP’s success
• Easy way to get data to Web Generates ordinary HTML, viewable in any browser
• Cross-platform: also runs on Windows, Linux, any mainstream OS
• Offers gradual path of mastery grass roots pilot project Enterprise
• Open source Managed by Zend, “the PHP company” Contributors from community and corporations
Moving to Enterprise PHP on IBM i | 16-December-2009 | 9Alan Seiden, Strategic Business Systems
Who uses PHP?
• Yahoo, eBay, Wikipedia, Facebook
• Open source developers – 10,000+ projects
• Strong community worldwide
• 7 million+ developers
• Growing community of IBM i shops
Moving to Enterprise PHP on IBM i | 16-December-2009 | 10Alan Seiden, Strategic Business Systems
Free, open source apps (fine on IBM i)
WordPress blog/CMS MediaWiki (Wikipedia) ZenCart e-Commerce
Sugar CRMBug Tracking/Helpdesk (Mantis400.com)
Moving to Enterprise PHP on IBM i | 16-December-2009 | 11Alan Seiden, Strategic Business Systems
PHP on i—a short history
• 2004: i5php.net Unofficial PHP binary for “i” available online
• 2005: IBM and Zend got together
• 2006: Zend Core for i5/OS Official release with help from IBM Professional technical support from Zend
• 2007: Zend Studio: IDE/code editor • 2007: Zend Platform: performance booster and code tracer/monitor
• 2008: Zend Framework supports “i” variant of db2
• 2009: Zend Server Beta for “i” Combines the best of Core and Platform…watch for GA
Moving to Enterprise PHP on IBM i | 16-December-2009 | 12Alan Seiden, Strategic Business Systems
Special features of PHP on i
• The included i5 Toolkit lets you: re-use your RPG logic call commands access data areas and other resources
Moving to Enterprise PHP on IBM i | 16-December-2009 | 13Alan Seiden, Strategic Business Systems
Typical stages of PHP on i
• Grass roots Prove to yourself how well PHP works on i
• Pilot project(s) Managers see potential value; project approval
• Enterprise PHP Important projects, developed with experience
Moving to Enterprise PHP on IBM i | 16-December-2009 | 14Alan Seiden, Strategic Business Systems
Grass roots stageGrass roots stage
Moving to Enterprise PHP on IBM i | 16-December-2009 | 15Alan Seiden, Strategic Business Systems
Grass roots stage
• Go ahead, kick the tires! Download and install Zend Core (free)
• Includes MySQL (optional) Create a simple web page, reading/writing db2 Try open source software. Examples:
• Mantis/400, mantis400.com• WordPress, wordpress.org
Prove it to yourself before “selling” to manager
Moving to Enterprise PHP on IBM i | 16-December-2009 | 16Alan Seiden, Strategic Business Systems
Install Zend Core
• Check the requirements/release notes http://zend.com/en/products/platform/resources
• Scroll down to Zend Core for i5/OS v2.6 i5/OS V5R4, v6.1 PASE, Qshell, recent cumulative PTF package, more
• Get FREE Zend Core for i5/OS Preloaded as licensed program or Download from http://zend.com/en/products/core/downloads
• Free account required• Look for “Zend Core for i5/OS V2.6”
Choose Windows-based installer or *SAVF
• Install on your i5 If you need MySQL, can select it, too Start Zend Core: GO ZENDCORE/ZCMENU, Option 5 then 1
Moving to Enterprise PHP on IBM i | 16-December-2009 | 17Alan Seiden, Strategic Business Systems
Apache PHP jobs run in ZEND
• Look in Zend subsystem for Apache/PHP jobs
Moving to Enterprise PHP on IBM i | 16-December-2009 | 18Alan Seiden, Strategic Business Systems
Zend Studio for Eclipse, IBM i Edition
• Better IDE than “Notepad”
• Free for IBM i customers http://zend.com/en/products/studio/downloads Look for “IBM i Edition”
• Lets you connect to IFS via mapped drive (“local”) or FTP or SSH (“remote”)
• Alerts you to any syntax errors or other mistakes; offers interactive debugging and code completion (similar to how green screens provide an F4 prompt)
• For good performance, your PC needs 2GB RAM
Moving to Enterprise PHP on IBM i | 16-December-2009 | 19Alan Seiden, Strategic Business Systems
Build your skillsBuild your skills
Moving to Enterprise PHP on IBM i | 16-December-2009 | 20Alan Seiden, Strategic Business Systems
Build your skills: 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
• Optional: learn as needed Javascript
• Adds dynamic functionality to pages
Cascading style sheets (CSS)• Modern way to specify colors, fonts, and other attibutes of how
a site looks
Moving to Enterprise PHP on IBM i | 16-December-2009 | 21Alan Seiden, Strategic Business Systems
Step 2: Try a simple PHP script
• PHP scripts are text files that reside in the IFS• Save script in /www/zendcore/htdocs/helloworld.php• Run in browser URL:
http://i5system:89/helloworld.php
<?php
// simple script to test PHP
echo “Hello, world!”;
?>
Moving to Enterprise PHP on IBM i | 16-December-2009 | 22Alan Seiden, Strategic Business Systems
“Hello, world!” in browser
• The output of helloworld.php
Moving to Enterprise PHP on IBM i | 16-December-2009 | 23Alan Seiden, Strategic Business Systems
Step 3: Access db2
• Example: Connect to db2 on i Select records from a db2 table Load the records in an HTML table Display the output
Moving to Enterprise PHP on IBM i | 16-December-2009 | 24Alan Seiden, Strategic Business Systems
Connection to DB2 for i
• Need three things (OK to leave blank for default): Database name User ID Password
// Standard DB connection to DB2...$conn = ‘*LOCAL’; $name = ‘’;$pwd = ‘’;
$i5link = db2_connect($conn, $name, $pwd);if (!$i5link) echo 'Connection failed: '.db2_stmt_error().' : '.db2_stmt_errormsg();
$sql = "SELECT * from prodlib.customer";
$stmt = db2_exec($i5link,$sql)or die("Failed query:".db2_stmt_error().":".db2_stmt_errormsg());
?>
Moving to Enterprise PHP on IBM i | 16-December-2009 | 25Alan Seiden, Strategic Business Systems
Reading data
Loop through record set
<h1> Customer list for a company</h1><TABLE BORDER="10" BORDERCOLOR="blue"><TBODY BGCOLOR="DEB887"><TR><TD>Customer Number</TD><TD>Customer Name</TD><TD>Address Line 1</TD><TD>Address Line 2</TD><TD>City</TD><TD>State</TD><TD>Zip Code</TD></TR>
<?php
echo “ <TR><TD> $row[‘CUSTNUM’] </TD><TD>$row[‘CUSTNAME’] </TD><TD>$row[‘CUSTADDR1’]</TD><TD>$row[‘CUSTADDR2’] </TD><TD>$row[‘CUSTCITY’]</TD><TD>$row[‘CUSTSTATE’] </TD><TD>$row[‘CUSTZIP’]</TD></TR>”;
}echo ‘ </table> ';db2_close($i5link);
?>
Moving to Enterprise PHP on IBM i | 16-December-2009 | 26Alan Seiden, Strategic Business Systems
Grass roots resources
• Support: Zend Core includes one year of “silver” support
• Forums and lists forums.zend.com (look for IBM i forums) lists.nyphp.org (general PHP questions)
• Books (online and print) PHP Manual: http://php.net Zend Core for i5/OS Redbook PHP on IBM i book by Jeff Olen & Kevin Schroeder
(MC Press)
• PHP User Groups nyphp.org, liphp.org
Moving to Enterprise PHP on IBM i | 16-December-2009 | 27Alan Seiden, Strategic Business Systems
Pilot projectPilot project
Moving to Enterprise PHP on IBM i | 16-December-2009 | 28Alan Seiden, Strategic Business Systems
Pilot project: how to pick one
• Well defined, useful, with modest scope
• Accesses IBM i resources db2 RPG calls (optional)
• Could be a new application or extension of an existing one to the web
Moving to Enterprise PHP on IBM i | 16-December-2009 | 29Alan Seiden, Strategic Business Systems
Our pilot project: ScoreBook.com
Added new functionality for our internal use:•Consolidated player rosters, formerly a tedious task•OpenX Ad Server (formerly PhpAdsNew)
Moving to Enterprise PHP on IBM i | 16-December-2009 | 30Alan Seiden, Strategic Business Systems
But what is But what is EnterpriseEnterprise PHP?PHP?
Moving to Enterprise PHP on IBM i | 16-December-2009 | 31Alan Seiden, Strategic Business Systems
Enterprise PHP is:
• Grown-up development
• Think of your mature RPG processes Consistent Reliable
• You know how to do that
Moving to Enterprise PHP on IBM i | 16-December-2009 | 32Alan Seiden, Strategic Business Systems
Enterprise PHP in detail
• Design/development cycle Standards Security Focus on easy maintainance Reusable functionality (not just copy and paste) Procedures that ensure quality
• Deployment Need tools to help support app in live environment Predictable, consistent performance
Moving to Enterprise PHP on IBM i | 16-December-2009 | 33Alan Seiden, Strategic Business Systems
Zend Framework
• A starting point for your advanced applications Security features Modular design
• Like the “i,” it has everything you need• You don’t have to integrate lots of pieces (HTML
template system, e-mailer, graphics, etc.)• It’s all tested for you• Free and open source
Moving to Enterprise PHP on IBM i | 16-December-2009 | 34Alan Seiden, Strategic Business Systems
Zend Platform
Provides caching (fast!), debugging and event tracking, integration with Zend Studio (IDE)
Moving to Enterprise PHP on IBM i | 16-December-2009 | 35Alan Seiden, Strategic Business Systems
Zend Platform: detail
Drill down to find the cause of performance lags or errors
Moving to Enterprise PHP on IBM i | 16-December-2009 | 36Alan Seiden, Strategic Business Systems
Award winner used Zend Framework and Platform
Allied Beverage Group: Wine catalog/ordering system
Moving to Enterprise PHP on IBM i | 16-December-2009 | 37Alan Seiden, Strategic Business Systems
Ingredients of enterprise award winning site
• Allied project won IBM/COMMON “Best Web Solution” of 2009
• For Allied, PHP brings people and resources together on the “i” db2 database provides reliable, consistent product catalog and order
data No extra servers needed Re-using RPG logic Everyone on the same team PHP is “superglue”: plans afoot to connect other systems, too
• Consistency, standards, security, reusability Zend Framework
• Speed critical for sales reps in the field (Being compared to green screen speed!) Zend Platform
• Also allows monitoring of production environment
Moving to Enterprise PHP on IBM i | 16-December-2009 | 38Alan Seiden, Strategic Business Systems
How do we get How do we get there?there?
Moving to Enterprise PHP on IBM i | 16-December-2009 | 39Alan Seiden, Strategic Business Systems
PHP Value to Business
Inve
stm
ent R
equi
red
for S
ucce
ss
Enterprise
Business-critical applications require higher levels of reliability, predictability,
scalability, & performance
• Enterprise versions of software• Professional developer tools
Support
Training
Consulting
Grass roots • No-Charge versions of software• Community support• Eclipse support• PHP frameworks• DevZone
Requires low/no cost tools, documentation, & support
Path to Enterprise PHP
Pilot project,experience
Buy-in
Moving to Enterprise PHP on IBM i | 16-December-2009 | 40Alan Seiden, Strategic Business Systems
Tools that help (3 of them are free)
Grass roots Enterprise
• Pre-built components for rapid development
• Best Practices• Iterative development cycles• Higher deployment success
rates results from rigorous testing by Zend & PHP community
Consistent & Predictable
• Consistent commercial versions of PHP, extensions, database drivers, libraries
• Timely updates of security patches, bug fixes, new extensions/drivers
• Configuration Management across entire production infrastructure
• Reusability• Remote Debugging in Production• Development best practices• Repeatable, uniform testing• Standards for deployment• Root Cause Analysis• Replicate Production problems in
developer’s environment
Zend Studio
• Improved Scalability• High performance via
Caching• Defining/measuring
performance & scalability metrics
• Proactive Monitoring & Management
Zend Platform
Moving to Enterprise PHP on IBM i | 16-December-2009 | 41Alan Seiden, Strategic Business Systems
Consistent & Predictable
Get help to smooth the learning curve
Grass roots Enterprise
Gold Support Platinum SupportBusiness Hour Phone Access 24/7 Phone Access
4 hr Priority Response 4 hr Priority Response/2 hr on P1Support
TrainingPHP I: Foundations PHP II: Higher Structures Zend Platform for SysAdminsPHP for RPG Prog Building Apps w/ Framework Building Secure AppsPHP for Exp Prog Zend CertificationsStudio w/ Platform
ConsultingArchitecture & Design Remote Install & Admin App MigrationSmartStart Rapid App Dev PHP Performance AuditsCoached Development PHP Security Audits
Moving to Enterprise PHP on IBM i | 16-December-2009 | 42Alan Seiden, Strategic Business Systems
Coming soon to i: Zend Server
• Next-generation install: available in 2010 Best of Core and Platform in one package Easier configuration, faster performance Beta: http://www.zend.com/en/products/server/zend-server-
5-new-ibmi
• For now, continue to use Zend Core and Platform. • You can upgrade to Server when it’s ready
Moving to Enterprise PHP on IBM i | 16-December-2009 | 43Alan Seiden, Strategic Business Systems
Enjoy the rideEnjoy the ride……
Moving to Enterprise PHP on IBM i | 16-December-2009 | 44Alan Seiden, Strategic Business Systems
Enjoy the ride…
…on the path to Enterprise PHP!
• Start with grass roots: download Zend Core and experiment
• Get training and move on to pilot project
• As your confidence grows, use Zend Framework and other tools. Consider mentoring to accelerate progress, avoid pitfalls
• Call me for guidance or to sign up for training, mentoring, or to learn more about Zend’s productivity tools 201-327-9400 or [email protected] Say you saw Alan’s December 2009 webinar
Moving to Enterprise PHP on IBM i | 16-December-2009 | 45Alan Seiden, Strategic Business Systems
Thanks and Questions
To receive free PHP/i tips by email, write to [email protected] with subject: “PHP tips.”
To download these slides, go to:http://www.sbsusa.com/php