Presentation is loading. Please wait.

Presentation is loading. Please wait.

© 2009 IBM Corporation Why PHP and IBM i Alison Butterill AD Product Offering Manager

Similar presentations


Presentation on theme: "© 2009 IBM Corporation Why PHP and IBM i Alison Butterill AD Product Offering Manager"— Presentation transcript:

1 © 2009 IBM Corporation Why PHP and IBM i Alison Butterill AD Product Offering Manager butteril@ca.ibm.com

2 © 2009 IBM Corporation IBM Power Systems 2 Agenda What is PHP? Zend PHP and i What are customers doing with PHP mySQL Examples

3 © 2009 IBM Corporation IBM Power Systems 3 Adoption of Open Source 82% Have Open Source in Production or Planned within 12 months

4 © 2009 IBM Corporation IBM Power Systems 4 Evolution of web applications  Every 7 seconds a new wiki or blog is created…  Next wave of programmers: folks who create content are now empowered to create applications  New platforms being established – providing simple, feature rich environments for editing and contributing content.  Content is handled with a simple WYSIWYG editor that makes editing accessible to anyone  Main content accompanied with discussion tabs, history tabs, version tabs, mailing list tabs

5 © 2009 IBM Corporation IBM Power Systems 5 Description of Open Community Applications Wiki –Collaborative website which can be directly edited by anyone with access to it Content Management System –System used to administer the content of a website Customer Relationship Management (CRM) –Method used by companies to manage their business relationships. The process includes capture, storage and analysis of clients, vendors, partners and internal process information

6 © 2009 IBM Corporation IBM Power Systems 6 Description of Open Community Applications Portal –Site that functions as a point of access to information on the World Wide Web eCommerce –Web site that is used for buying and selling services and/or products electronically Bulletin Board –Web enabled program that allows users to advertise, share information, and meet other people.

7 © 2009 IBM Corporation IBM Power Systems 7 Web Development/Deployment Stacks L A M P inuxinux pachepache ySQLySQL HPHP indowsindows ISIS ySQLySQL HPHP W I M P pachepache B2B2 HPHP i A D P pachepache ySQLySQL HPHP i A M P

8 © 2009 IBM Corporation IBM Power Systems 8 Why PHP? Low Learning Curve Easy Integration into Heterogeneous Environments Robust, Multi-Platform, High-Performance, Scalable, Secure Vibrant Community Rapid Innovation Run an Agile Business Proven Deployment

9 © 2009 IBM Corporation IBM Power Systems 9 What is PHP? PHP is an easy to use, open source, platform independent server-side scripting language –Designed for web application development –4.5+ Million PHP Developers PHP is the leading scripting language deployed on the Internet –22+ Million Internet domains –Out-Pacing Microsoft’s ASP* Thousands of PHP applications are available –Web applications tied to databases –Content management –Wikis and Blogs www.hotscripts.com, www.phpjunkyard.com/ www.phpfreaks.com// www.phpfreebies.com/ * Source: 2005 Netcraft Survey http://www.php.net/usage.php

10 © 2009 IBM Corporation IBM Power Systems 10 Basic Syntax Flat-text files with a PHP extension Can be used for command scripting (using the IBM i PASE utilities) Typically used to add dynamic function to HTML PHP code embedded in PHP tags: <?php // PHP code ?> Lines are delimited with a semicolon (;) PHP code is processed and the results are sent to the user as HTML –It is important to understand HTML

11 © 2009 IBM Corporation IBM Power Systems 11 PHP basic examples helloworld.php helloworld.html <?php echo (“Hello world!”); ?> <?php echo (“Hello world!”); ?> <?php echo (“Hello world!”); ?> <?php echo (“Hello world!”); ?> Simple scripting language

12 © 2009 IBM Corporation IBM Power Systems 12 Mapping to Web Artifacts Registration You entered: <?php $username = “IBM”; $password = “passw0rd”; echo “ Username = “. $username. “ ”; echo “ Password = “. $password. “ ”; ?>

13 © 2009 IBM Corporation IBM Power Systems 13 PHP – The Language <?php $Greeting = "Hello"; $Who = "World"; echo ("$Greeting $Who!"); ?> <?php $Greeting = "Hello"; $Who = "World"; echo ("$Greeting $Who!"); ?> Variables –Use $ –Case Sensitive Other Constructs –Strings –Arrays –Logical Operators –AND, OR, XOR, ! –Loops –WHILE –Control Statements –ELSE, IF

14 © 2009 IBM Corporation IBM Power Systems 14 PHP Data Access <?php $user=“USERNAME”; $password=“PASSWORD”; $db=“TOR100”; $conn = db2_connect($db, $user, $password); db2_close($conn); ?> <?php $user=“USERNAME”; $password=“PASSWORD”; $db=“TOR100”; $conn = db2_connect($db, $user, $password); db2_close($conn); ?> echo "Calendar events "; $result = db2_exec($conn, "select * from alical.events "); if ($result) { while ($row = db2_fetch_both($result)) { echo $row['DATE']." ".$row[’EVENT']." "; } echo "Calendar events "; $result = db2_exec($conn, "select * from alical.events "); if ($result) { while ($row = db2_fetch_both($result)) { echo $row['DATE']." ".$row[’EVENT']." "; }

15 © 2009 IBM Corporation IBM Power Systems 15 Where does PHP run?

16 © 2009 IBM Corporation IBM Power Systems 16 Top 10 Internet Sites by WW traffic 1. Yahoo.com 2. YouTube.com 3. Windowslive.com 4. Google.com 5. Myspace.com 7. MSN.com 6. Facebook.com 8. Hi5.com 9. Wikipedia.org 10. Orkut.org

17 © 2009 IBM Corporation IBM Power Systems 17 Agenda What is PHP? Zend PHP and i What are customers doing with PHP mySQL Examples

18 © 2009 IBM Corporation IBM Power Systems 18 Zend Technologies The founders of Zend have been key contributors to the PHP language since 1997 Zend delivers commercial products that enable developers and IT personnel to deliver and operate business-critical PHP applications –Leading supplier of PHP products and solutions –Used by more than 15,000 companies worldwide –Zend Engine (the PHP kernel) is being used on more than 22 million websites today –Zend takes the open source PHP code through rigorous testing for additional quality assurance and adds over 35 popular PHP extensions to deliver their PHP runtime environment Zend provides enterprise level support for the PHP environment (www.zend.com)

19 © 2009 IBM Corporation IBM Power Systems 19 Zend Products Zend Core – A fully tested and enhanced version of the open source PHP runtime environment Zend Studio – Provides an integrated IDE for building and debugging PHP applications Zend Guard – Provides code protection and license enforcement tools for solution providers (copyright protection) Zend Platform – A robust PHP production environment providing performance, scalability and monitoring for PHP applications $$ For IBM i

20 © 2009 IBM Corporation IBM Power Systems 20 System Requirements for Zend Core for i IBM i 6.1 i5/OS V5R4 i5/OS V5R3 –Zend Core for i5/OS Version 1.6 or later required –i5/OS V5R3 database PTF SI25802 is required –Zend Core for i5/OS does not support remote debugging from a Zend Studio client Portable App Solutions Environment (PASE)335722-SS1 IBM Portable Utilities for i*base5733-SC1 OpenSSH, OpenSST.Zlib15733-SC1 Cryto Access Provider 128 bit*base5722-AC3 Qshell305722-SS1 System Openness Includes135722-SS1 Digital Certificate Manager345722-SS1

21 © 2009 IBM Corporation IBM Power Systems 21 Agenda What is PHP? Zend PHP and i What are customers doing with PHP mySQL Examples

22 © 2009 IBM Corporation IBM Power Systems 22 Where Does PHP Run on i?

23 © 2009 IBM Corporation IBM Power Systems 23 PHP Integration with i Zend products available for IBM i –Zend Core for i –Zend Platform for i Specifically for accessing IBM i data and resources from PHP (similar to IBM ToolBox for Java) –DB2 UDB – SQL and Native –Program call –Procedure call –Data Area –Data Queue –Message Queue –Commands –System values –Spool files

24 © 2009 IBM Corporation IBM Power Systems 24 Agenda What is PHP? Zend PHP and i What are customers doing with PHP mySQL Examples

25 © 2009 IBM Corporation IBM Power Systems 25 What are i Customers Doing with PHP? 1.Consolidation: Move PHP applications that are running on Windows or Linux that access data in DB2 to run in IBM i to speed up or reduce complexity of the applications 2.Modernization: Use PHP to web-enable green screen applications 3.New application development: Create new applications with PHP on IBM i including applications for the intranet, reporting, websites, and extranets 4.Leveraging PHP portfolio: Run commercial or open source PHP applications on IBM i Top Four:

26 © 2009 IBM Corporation IBM Power Systems 26 1. Consolidation Web Front End THIS PHP App on Server Server PROC1 PHP App on clients PROC1 SELECT * INTO UPDATE EMP-MSTR UPDATE DEPT-MSTR PASE TO THIS SELECT * INTO UPDATE EMP-MSTR UPDATE DEPT-MSTR

27 © 2009 IBM Corporation IBM Power Systems 27 Zend - 5250 Bridge Facilitates integrating 5250 applications into Web pages through PHP Includes PHP functions for accessing 5250 data stream Included with Zend Platform 2. Modernization

28 © 2009 IBM Corporation IBM Power Systems 28 User Interface *PGMs *SRVPGMs DB DB2 for i Modernization Business Logic Tier

29 © 2009 IBM Corporation IBM Power Systems 29 PASE Business Logic Tier *PGMs *SRVPGMs Model View DB Controller DB Modernization dataqs PHP scripts DB2 for i HTML

30 © 2009 IBM Corporation IBM Power Systems 30 PHP Applications Check out the thousands of PHP scripts available that can be used as-is or as the starting point for Web projects. –http://www.hotscripts.com –http://www.phpjunkyard.com/ –http://www.phpfreaks.com/ –http://phpfreebies.com/

31 © 2009 IBM Corporation IBM Power Systems 31 3. New Development: Zend Studio for IBM i

32 © 2009 IBM Corporation IBM Power Systems 32 Zend Studio Example Executes an SQL query, returning records whose LASTNAME field begins with 'S'.

33 © 2009 IBM Corporation IBM Power Systems 33 New Application Development Plug-in for eclipse-based tools like IBM Rational tools –Ability to create PHP from within same workbench as RPG, etc. –Currently testing for compatibility Huge interest from i community Zend Studio for eclipse for i

34 © 2009 IBM Corporation IBM Power Systems 34 Zend Forum for IBM i… www.zend.com/forums

35 © 2009 IBM Corporation IBM Power Systems 35 Redbooks that Will Help

36 © 2009 IBM Corporation IBM Power Systems 36 4. Leveraging Application Portfolio: PHP and MySQL Personal Publishing Content Management System Wiki Customer Relationship Management Help Desk Portal e-Commerce Course Management System Portal e-Commerce Bulletin Board

37 © 2009 IBM Corporation IBM Power Systems 37 More Applications: phpMyAdminphpMyAdmin is a tool written in PHP intended to handle the administration of MySQL over the Web SquirrelMailSquirrelMail is a standards-based Webmail package. PHP-NukePHP-Nuke is a Web portal and online community system eZ PublisheZ Publish is an Enterprise Content Management platform with an easy to use out of the box Web Content Management System osCommerceosCommerce is an open source e-commerce solution under on going development by the open source community GalleryGallery is a slick Web-based photo album written using PHP.

38 © 2009 IBM Corporation IBM Power Systems 38 Agenda What is PHP? Zend PHP and i What are customers doing with PHP mySQL Examples

39 © 2009 IBM Corporation IBM Power Systems 39 MySQL MySQL is the database for the PHP application portfolio –MySQL is the most popular open source database –1000s of PHP scripts and applications use MySQL Database Products –MySQL Community Server  No charge  Supported by community –MySQL Enterprise  Chargeable  Supported by MySQL MySQL runs in PASE on IBM i today –“How to” posted on Zend Forum Community Edition Download: http://dev.mysql.com/downloads/mysql/5.0.html

40 © 2009 IBM Corporation IBM Power Systems 40 MySQL – How It Works Oracle Translator MySQL Connection SQL Server Translator Another Translator Other Translator MySQL Product DB Connect Statement Storage Engines

41 © 2009 IBM Corporation IBM Power Systems 41 DB2 Storage Engine for MySQL Supporting open source applications while simplifying data management –Applications written to MySQL, but data stored in DB2 –One database to manage, backup and protect –Provides access to MySQL data from RPG, DB2 Web Query and more Plan to be supported with MySQL Community and Enterprise Editions version 5.1 –Supported on i 5.4 and i 6.1 Combination of Apache, PHP and MySQL enables 1000s of applications on i –Customer Relationship Management, E-Commerce, Portals and Wikis PHP Application MySQL DB2 for i Writes to Data stored in Accesses Data RPG Application

42 © 2009 IBM Corporation IBM Power Systems 42 Database access – DB2 function querydb($sqlstring) { require("config.php"); $conn = db2_connect($database, $user, $password, $options); if ($conn) { if (!($stmt = db2_exec($conn, $sqlstring, array('CURSOR' => DB2_SCROLLABLE)))) { echo " Error $sqlstring".db2_stmt_error().":".db2_stmt_errormsg(). " "; die; } return $stmt; } else { echo "Connection failed."; die; } function querydb($sqlstring) { require("config.php"); $conn = db2_connect($database, $user, $password, $options); if ($conn) { if (!($stmt = db2_exec($conn, $sqlstring, array('CURSOR' => DB2_SCROLLABLE)))) { echo " Error $sqlstring".db2_stmt_error().":".db2_stmt_errormsg(). " "; die; } return $stmt; } else { echo "Connection failed."; die; }

43 © 2009 IBM Corporation IBM Power Systems 43 Database access - MySQL function querydb($sqlstring) { $result = mysql_query($sqlstring); return $result; } function querydb($sqlstring) { $result = mysql_query($sqlstring); return $result; }

44 © 2009 IBM Corporation IBM Power Systems 44 Agenda What is PHP? Zend PHP and i What are customers doing with PHP mySQL Examples

45 © 2009 IBM Corporation IBM Power Systems 45 PHP Applications on i Check out the thousands of PHP scripts available that can be used as-is or as the starting point for Web projects. –http://www.hotscripts.com –http://www.phpjunkyard.com/ –http://www.phpfreaks.com/ –http://phpfreebies.com/

46 © 2009 IBM Corporation IBM Power Systems 46 PHP Applications

47 © 2009 IBM Corporation IBM Power Systems 47 Content Management Applications You can check out over 100 applications including Wiki's, BLOGs, Portals, Forums and much more http://www.opensourcecms.com/

48 © 2009 IBM Corporation IBM Power Systems 48 Joomla! (Open Source Content Management System) MySQL + PHP on i Application Website: http://joomla.org/ Description: http://en.wikipedia.org/wiki/Joomla How To: www.zend.com/forums/index.php?t=msg&th=3068 Running on i: http://sei5a2.rchland.ibm.com:89/joomla


Download ppt "© 2009 IBM Corporation Why PHP and IBM i Alison Butterill AD Product Offering Manager"

Similar presentations


Ads by Google