PHP in the Enterprise Mike Pavlak Solutions Consultant mike.p@zend.com Function Junction
Agenda Market analysis Evolution of PHP and IBM i PHP stacks up today PHP in the IBM i Enterprise Development Community Mobile Zend Interpretations of IBM market 2
PHP in the Enterprise www.zend.com Market Analysis
Market Overview With a community of over 5 million developers, PHP usage has significantly broadened in recent years Functions of PHP apps have become diverse What type of application(s) have you built with PHP? Base: 117 respondents who are actively using PHP Data: UBM TechWeb Survey of 232 executives, architects or development managers actively using PHP or considering building apps using PHP, May 2012 60% of PHP apps are developed for BUSINESS CRITICAL PURPOSES CLOUD & MOBILE USAGE is a now a core design point 72% of PHP Developers are using cloud based services & APIs 2/3 of PHP developers expect to work on mobile apps in 2012 63% of developers are creating apps for cloud deployment
Key Trends in PHP Compared to your next most-used language, is PHP better or worse at
What Is Fueling this Enterprise Adoption? Software Complexity of other web languages (Java,.Net, etc.) PHP s comparative ease of use Web application re-engineering of n-tiered applications Price/performance TCO Enterprise-readiness of PHP driven by Zend Hardware Server consolidation Front-ending web applications to host data Manageability Price/performance TCO
Zend Has Driven Dynamics of Making PHP Enterprise Ready Enterprise PHP Zend Framework Enterprise Tooling via Eclipse Web Application Server Strategic Platforms Integrations
Launched internet based PHP education $75 for three month program 67% of developers spend 50% of their time on PHP (Developer Pulse) PHP is easier to learn than Ruby or JavaScript It doesn t have to be OO
Market Overview Research shows that expansion has been driven by benefits in speed of development and ease of working with the cloud What are the main reasons you choose to develop in PHP? Compared with your next most-used language, is PHP better or worse at each of the following? Note: Multiple responses allowed Data: UBM TechWeb Survey of 232 executives, architects or development managers actively using PHP or considering building apps using PHP, May 2012 Base: 117 respondents who are actively using PHP Data: UBM TechWeb Survey of 232 executives, architects or development managers actively using PHP or considering building apps using PHP, May 2012
PHP in the Enterprise www.zend.com Evolution of PHP and IBM i
Adoption of PHP on the IBM i IBM & Zend meet SystemiNetwork, COMMON, etc. identify need for scripting on IBM i. Net.Data is good, but not strategic Zend CEO and VP of Business Development come to COMMON IBM & Zend dance IBM and Zend strike a BP relationship IBM helps Zend port PHP to IBM i The romance Anticipate a few thousand downloads Well past 11,000 unique registrations(nearly 400 monthly sustained) Customer moves from intrigue to conviction Happily ever after Let s just say, both sides are quite pleased with where this is going Competition is taking notice 11
Zend Server for IBM i Next generation of PHP stack for IBM I Single Licensed Program Installation Two products, single distribution, enable via keys Zend Server for IBM i Community Edition Available at no charge per IBM partnership Zend Server for IBM i Subscription available from Zend High value extra features Higher Support SLAs 12 Insert->Header & Footer
A Great Year for Zend in the Cloud Growth in Zend Developer Cloud Users Expanded IBM Partnership to MySQL 9 Q4 2011 Q1 2012 Q2 2012 Q3 2012
PHP in the Enterprise www.zend.com How the PHP Market Stacks Up Today
Top 10 Internet Sites by WW traffic 1. Facebook.com 6. Wikipedia.com 2. Google.com 7. Live.com 3. Youtube.com 8. Amazon.com 4. Yahoo.com 9. qq.com 5. Baidu.com 10. Twitter.com Jan 2013 5 more in next 10 15
Enterprise PHP Adoption is Growing Rapidly PHP Developers 5M 4M 3M 2M Commercial and corporate IT developers will account for more than 2 million PHP community members growing from 20% to 50% of the worldwide PHP developer population. 1M 2009 2014 Non-commercial developers Commercial and corporate IT developers Gartner Research Note: PHP: Past, Present and Future, Dec. 2 nd, 2009
Enterprise Proof Points IBM i Customer!
Blog article PHP jobs and IBM i Comment: I am an it director at a window manufacturer outside Cleveland Ohio. We use RPG extensively, but a few years ago I began writing and implementing php, html, etc running on apache using db2 via odbc. It has taken us to new levels... Adam Vanbuskirk 18 Insert->Header & Footer
PHP in the Enterprise www.zend.com Mobile
Mobile 0.5 First-Gen Mobile Apps CLIENT HTML Dumbed-down web interface Limited, as is desktop to mobile device UI = server based No APIs
Today s Mobile Apps CLIENT BACK- END SYSTEMS APIs Enterprise systems and data sources Native apps Too many devices to support Server-side APIs hacked into existing systems
Mobile First Approach Context is All Touch vs. QWERTY Users: Part of Your Design Team Pervasive Reach
The Future Cloud-Connected Mobile Apps BACK- END SYSTEMS MOBILE CLIENTS APIs Cloud Services Architecture Web-driven native experience Provide services to clients Composite architecture Elastic scaling SOCIAL AND SAAS
PHP in the Enterprise www.zend.com Zend Interpretations
1/8/ 201 Key Priorities articulated by CTOs, CIOs and VPs of Engineering Leverage investment in IBM i infrastructure Expose DB2/400 data via the web Webify green screen applications for end-users Maximize leverage of Power Systems computing power Move Windows/Linux based PHP apps to IBM i Deploy new web based applications Mitigate and minimize risk/cost of migrations Retool RPG programmers and access lower cost development resources to address business needs Leverage benefits of open-source technologies - create portable applications 25
Why PHP on i? Leverage Existing Infrastructure to Develop & Run Dynamic Web Applications Easily Powerful, Flexible, & Fastest Growing Web Development Language Native on IBM i/os Backing & Support of IBM Controlled/Driven by PHP Community Easy to Use & Fast to Deploy Supports Heterogeneous Environments Powerful Integration Capabilities Application Modernization Use PHP to web-enable green screen applications, utilizing existing data & business logic without rewriting application Access RPG Programs & Data as Web Services Package programs and data as web services and make available to other web applications Consolidate Data in DB2/400 Move PHP applications that are running on Windows or Linux that access data in DB2 to run in IBM i/os to speed up or reduce complexity of the applications Access DB2/400 Data via Browser Easily access and interact with DB2/400 data using a standard web browser New/Packaged Web Application on IBM i/os Create new applications with PHP on IBM i/os or leverage thousands of existing Open Sources applications 26 26
Zend commitment to IBM i Zend Server 6 Q1-2013 Zend Studio 10 Q1-2013 PHP Toolkit Market presence COMMON User Groups Blogs, webcasts, white papers Both in beta right now! 6 major releases in 2012, more coming ISV BCD, Crosspoint, Harris Data, NSC, iguazu, etc. 27
What are you doing? Pick an application and say MOBILE FIRST! 28
Resources Recorded Webinars http://www.zend.com/en/resources/webinars/ibm i-os Zend Server for IBM i main page, link to downloads http://www.zend.com/en/products/server/zend-server-ibm-i Zend Server manual: PDF: http://www.zend.com/topics/zend-server-5-for-ibmi-reference-manual.pdf Online: http://files.zend.com/help/zend-server-5/zendserver.htm#installation_guide.htm 29 Insert->Header & Footer
Q&A www.zend.com mike.p@zend.com Please fill out your Session Evaluation! 30 Insert->Header & Footer
Advanced Functions with DB2 and PHP for IBM i Mike Pavlak Solution Consultant
Agenda DB2 features in V5R4, i6.1 and i7.1 Review DB2 functions in PHP Explore the possibilities Q&A 2
Three primary ingredients to PHP script 3 Insert->Header & Footer
DB2 Wiki - https://www.ibm.com/developerworks/ibmi 4 Insert->Header & Footer
IBM changed the update process Version Major release Technology refresh - #5 released to GA and more coming Why do I care? - Rising tide raises all boats In other words, improvements in DB2, SQL and especially SQE will improve features and performance in all languages like Java RPG COBOL Of, of course PHP! And, ODBC, JDBC, ADO 5 Insert->Header & Footer
Subscribe to blog and get notified! http://db2fori.blogspot.com/ 6 Insert->Header & Footer
DB2 features V5R4 Insert->Header 7 & Footer
V5R4 DB2 Free format embedded SQL (RPG) PHP DB2 interface was delivered (back-leveled to V5R3) Automatic journaling enhancements SQE makes its debut in V5R2 and gets tweaked in V5R4 Speed enhancements of SPL System i Navigator enhancements Content Manager delivered. Much more 8 Insert->Header & Footer
V5R4 DB2 Sunset is on the horizon September 30, 2013 EOL for V5R4 Extended support for a fee, but Get thyself to i6.1 or higher! 9 Insert->Header & Footer
DB2 features IBM i6.1 Insert->Header 10 & Footer
Lots of new features! Supergroup CUBE and ROLLUP VALUES in FROM clause INSERT in FROM Expression support in Index Row change TIMESTAMP Hidden Columns Full outer join Skip locked data For each finds its way to SPL! Many new functions, & features. This is a bang up release! 11 Insert->Header & Footer Many new functions! This is a BANG up release!
IBM DB2 Storage Engine for MySQL Makes debut in i6.1 Creates tables Populates data Shipped with Zend DBi http://www.zend.com/en/products/dbi/ Supported by IBM Redbook http://www.redbooks.ibm.com/abstracts/sg247705.html 12 Insert->Header & Footer
Server side for PHP SQL Server Mode Subsystem Control Server job QSQSRVR runs in QSYSWRK by default Can change to same subsystem as application PHP application runs in QHTTPSVR Better memory control and workload partitioning ADDENVVAR ENVVAR(QIBM_SRVRMODE_SBS) VALUE('*SAME') LEVEL(*SYS) 13 Insert->Header & Footer
DB2 features IBM i7.1 Insert->Header 14 & Footer
DB2 features delivered in i7.1 Enhanced SQL & RPG integration Greater result set support XML Data Type Performance Adaptive query processing Self Learning Optimization Logical file on FROM support, select omit observance SSD and in memory DB enablement IBM i Navigator enhancements Progress monitor, Index advisor, etc. 15 Insert->Header & Footer
PHP on IBM i Since PHP runs natively on IBM i Zend Server! DRDA via PASE All features available!!! 16 Insert->Header & Footer
Digging in to Key Features Insert->Header 17 & Footer
Hidden Column Useful for protecting sensitive data from dynamic queries Hide a column by default Column is still there and can be manipulated directly CREATE TABLE ZENDDATA/EMPMAST ( NAME CHAR (20 ) NOT NULL WITH DEFAULT, CITY CHAR (20 ) NOT NULL WITH DEFAULT, STATE CHAR (2 ) NOT NULL WITH DEFAULT, SSN INT NOT NULL WITH DEFAULT IMPLICITLY HIDDEN) 18 Insert->Header & Footer
Insert data Must explicitly reference field on insert statement (lost sleep here, but makes sense) Then values clause INSERT INTO ZENDDATA.EMPMAST (NAME, CITY, STATE, SSN) VALUES('Sheldon Cooper', 'San Jose', 'CA,567891234); 19 Insert->Header & Footer
Let s see So using select * returns only the visible fields 20 Insert->Header & Footer
Hidden field Reference hidden field explicitly to reveal data 21 Insert->Header & Footer
In PHP, why is this good Write dynamic routines to display data Database can manage what is seen by default But as a developer, you can still manipulate and control! 22 Insert->Header & Footer
But what if I want to see this? Include the column in the select Now you can see it 23 Insert->Header & Footer
MySQL for IBM i Or Zend DBi == MySQL! Mike Pavlak Solutions Consultant mike.p@zend.com (708) 233 5880 Function Junction
Agenda What is MySQL Install Access GUI s DB2 Storage Engine Q&A 2 02/04/
What is MySQL? Most Popular and widely used Open Source Database Relational Database management System (RDBMS) Like DB2, but not, really Command line interface Many GUI utilities available to manage 3 02/04/
Installation, Zend DBi
MySQL Options 1. If you have never installed MySQL or Zend DBi Perform a clean installation of Zend DBi 2. Otherwise, if you have MySQL & no real data Delete MySQL (Steps on next slide) 3. If you have data and are at Version 5.1.x of MySQL Update to Zend DBI via the install process 4. Lastly, if you have data at a version 5.0.x or lower 1. Export data 2. Delete MySQL & Perform clean install of ZendDBi 3. Import your data 5 02/04/
Details on deleting MySQL Steps for a clean removal ENDSBS ZMYSQL OPTION(*IMMED) DLTLIB ZMYSQL CALL QP2TERM rm -f /usr/local/mysql rm -r -f /usr/local/mysql-5.1.50-i5os-power-64bit rm -r -f /usr/local/mysqldata rm -f /etc/my.cnf rm -f /tmp/mysql.sock 6 02/04/
Zend DBi Installation process Documented at Zend.com Option to install or update within point release Can update 5.1.x to 5.1.y (Zend Server) Cannot update 5.0.x to 5.1.y (Zend Core) Download.zip from Zend.com, contains SAVF & README Follow readme.txt in SAVF, pretty straight forward Required LP s are typically installed before Zend Server A word about QSECOFR UID = 0 7 02/04/
New subsystem and daemon ZENDDBI ZENDDBID 8 02/04/
MySQL Command Line
MySQL Monitor MySQL has no native GUI interface (sound familiar?) Command line accessible from QSHELL, QP2TERM, etc. This is the natural method for accessing. Will show you access, but not a big fan. Fully documented at MySQL website Many books on the subject 10 02/04/
Starting MySQL Monitor I typically use CALL QP2TERM, can use QSH, etc. cd /usr/local/mysql/bin The mysql> is the prompter for the monitor Mysql u root Mysql u root password= mikey 11 02/04/
Difference between QP2TERM and Qshell QP2TERM is window to PASE Cannot run IBM native programs like DB2, etc. Qshell is a Unix like shell Runs many things you find on Unix and IBM binaries Qshell Call QP2TERM 12 02/04/
Difference between QP2TERM and Qshell QP2TERM is window to PASE Cannot run IBM native programs like DB2, etc. Qshell is a Unix like shell Runs many things you find on Unix and IBM binaries Qshell Call QP2TERM 13 02/04/
MySQL to DB2 terminology Database Library Table Physical File / Table Index Logical File / Index Monitor STRSQL 14 02/04/
Show databases 15 02/04/
Set database Use <DBNAME> Selects the database you will use for processing Database is like a library, where you store tables, etc. Typically one database per application 16 02/04/
Show tables 17 02/04/
Display the user table using SQL select host, user, password from user; Use quit to end the session in the MySQL Monitor and F3 to close shell. 18 02/04/
Exit Type QUIT Press F3 to exit shell But there has to be a better way Just like DB navigator, there s alternatives! 19 02/04/
Are there any GUI s?
Many GUI solutions, here s a couple Adminer Single PHP script Lightweight, powerful and easy to use phpmyadmin Widely used by community Installed with Zend Server
Adminer - http://www.adminer.org/ Open source & lightweight All code in single PHP script, drop it in and go!
phpmyadmin Open Source PHP Project Provides nearly every access to MySQL you might need Installed automatically with Zend Server Access from Zend Server Dashboard Documentation at http://www.phpmyadmin.net/documentation/ 23 02/04/
phpmyadmin Password management Login with root profile Create your profile Test your profile Change root password IMMEDIATELY (if not sooner) 24 02/04/
Tour the dashboard..then on to privileges 25 02/04/
Privileges Click Add new user Fill out details, click GO 26 02/04/
Look at databases & tables Left hand navigation Right hand workspace FULL CRUD capabilities Think DFU for MySQL! 27 02/04/
IBM DB2 Storage Engine
Why use MySQL to store in DB2? Many PHP applications in the open source arena Can be easily installed Modifying to access DB2 can be cumbersome & then updates? Zend DBi includes IBM DB2 Storage Engine
Architecture
How to install From the MySQL Monitor in QSH or QP2TERM install plugin ibmdb2i soname ha_ibmdb2i.so ; Instruction is in Install Notes for ZendDBi and IBM Redbooks
IBM DB2 Storage Engine:phpMyAdmin Create Table, set number of fields Select storage engine
phpmyadmin gives you the SQL!
Add records to table
What happened on the i? Library TEST was created Table EXAMPLEDB2 was created Records populated
Records, please? STRSQL Select * from test/exampledb2
IBM Redbook and Redpiece Discovering MySQL Using the DB2 Storage Engine
Q&A www.zend.com mike.p@zend.com Please fill out your Session Evaluation! 38 Insert->Header & Footer
PHP101 Program Call
Call RPG pricing program. Any IBM i program object will do Create toolkit object Setup parameters Call program Display results 2 Insert->Header & Footer
HTML form to get parameters 3 Insert->Header & Footer
Input form, default zeros then enter data 4 Insert->Header & Footer
Program call part 1 html 5 Insert->Header & Footer
Program call part 2 - Functions 6 Insert->Header & Footer
Program call part 3 Parms, call & display 7 Insert->Header & Footer
Output of the program call See input and output values from toolkit Yes, values can be changed in RPG and routed back Essentially, that is what happened to EXTEND 8 Insert->Header & Footer
Where to get more info HTML training W3schools.com Local college, continuing education, etc. PHP training Anywhere will work Zend, iprodeveloper (formerly SystemiNetwork) Get a project Define a Proof-of-concept (POC) Dig up something out of the backlog 9 Insert->Header & Footer
Books Books Sam s teach yourself PHP, MySQL and Apache All in One (4 th edition) ISBN:067232976X Head First HTML with CSS and XHTML ISBN:059610197X Zend Server Doc at Zend Website IBM i Programmer s Guide to PHP on IBM i MC Press 10 Insert->Header & Footer
THANK YOU!!! PHP101 - Q&A Mike Pavlak Solution Consultant Zend Technologies Mike.p@zend.com Insert->Header 11 & Footer