
Gateway/400 Getting Started with PHP on IBM i Function Junction Sabrina Kahn Mike Pavlak Regional Account Manager Solutions Consultant [email protected] [email protected] (815) 722 3454 © All rights reserved. Zend Technologies, Inc. Agenda • Audience - IBM i experience and new to PHP? • Background on PHP • Zend Core • Zend Studio • Some sample scripts • References, support and more info • Q&A Copyright © 2009 Zend Technologies, Inc, All rights © All rights reserved. Zend Technologies, Inc. | 2 reserved 02/03/ 10 PHP is a Scripting Language !PHP Hypertext Pre-Processor !Developed initially by Rasmus Lerdorf in 1994: PHP/FI !Zeev Suraski and Andi Gutmans Contributing since1997+ (ZEev + aNDi = Zend) !Interpreted, not compiled !Forgiving and intuitive code structure (Short learning curve) !Immediate feedback during development !Operating model is similar to Net.Data, not as verbose !PHP is to Java what RPG is to COBOL Copyright © 2009 Zend Technologies, Inc, All rights © All rights reserved. Zend Technologies, Inc. | 3 reserved 02/03/ 10 Who is Zend? • Guiding light for PHP • Providers of stable, supported PHP distribution • Providers of commercial tooling and support for PHP ! Zend Core ! Zend Studio ! Zend Platform, more... Copyright © 2009 Zend Technologies, Inc, All rights © All rights reserved. Zend Technologies, Inc. | 4 reserved 02/03/ 10 Zend and IBM • Partnership began in 2005 • Zend selected by IBM to deliver PHP on IBM i • Zend solutions pre-loaded with IBM i 6.1 and 7.1! !Just install the LP and go! • You can still get products and updates at Zend.com Copyright © 2009 Zend Technologies, Inc, All rights © All rights reserved. Zend Technologies, Inc. | 5 reserved 02/03/ 10 Why Open Source? • Tough economic times calls for innovation ! Low cost of entry ! Applications of high quality ! Lower TCO ! Runs natively on IBM i, no need for additional hardware / OS ! You are already using it! (Apache, Eclipse, etc.) We’re not the only ones talking about Open Source… Look what IBM is saying in February ‘09 edition! http://www.ibmsystemsmag.com/ibmi Copyright © 2009 Zend Technologies, Inc, All rights © All rights reserved. Zend Technologies, Inc. | 6 reserved 02/03/ 10 The “Stack” • Tested, certified and supported distribution of PHP • Runs in PASE • Home bfPPdllikGDPARbase for PHP modules like GD, PEAR, etc. • Browser based admin console • Accessible immediately after install • Let’s look at the architecture of the stack • And then installation on IBM i • No charge LP Included with system maintenance Copyright © 2009 Zend Technologies, Inc, All rights © All rights reserved. Zend Technologies, Inc. | 7 reserved 02/03/ 10 Fundamental Architecture of Zend Core System i5 i5/OS URL: http://myproxy:89/core/registration.php PASE RtRequest HTTP:89 PHP file HTTP:8000 Server (Reverse Proxy) Server Response PHP Module HTML + PHP Zend Core DB2 UDB Zend Platform Copyright © 2009 Zend Technologies, Inc, All rights © All rights reserved. Zend Technologies, Inc. | 8 reserved 02/03/ 10 Zend Server 5 for IBM i www.zend.com Technical overview © All rights reserved. Zend Technologies, Inc. What Is Zend Server? • Production quality PHP stack ! PHP, ZF, DB connectivity, debugging extension, and more • Two Editions - Free “Community Edition” provided by IBM & Full commercial edition ! Both are production ready • Application monitoring and diagnostics (integrated with Zend Studio) • Multi-level performance enhancement capabilities • Software updates and security hot fixes • Easy and quick installation • Zend Framework Integration 10 What is Zend Server © All rights reserved. Zend Technologies, Inc. Zend Server for IBM i • Next generation of PHP stack for IBM i • Best of both Zend Core and Zend Platform • Single Licensed Program Installation • Two products ! 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 11 Insert->Header & Footer © All rights reserved. Zend Technologies, Inc. Why a new generation? • Based on feedback of key areas for Improvement • Improved basic PHP Performance ! 30% to 600% depending on the application • New capabilities ! Code Tracing – Faster problem resolution ! Job Queue – Performance and scalability ! Page Caching – Performance and Scalability ! Support for PHP 5.3 • Easier installation, administration & maintenance 12 Insert->Header & Footer © All rights reserved. Zend Technologies, Inc. Zend Server Under the Covers IBM i ILE Apache:10088 i/OS • Default PHP file configuration PASE FastCGI HTTP:10088 Server PHP CGI *PGM (FastCGI) CMD Zend Server DB2 UDB 13 © All rights reserved. Zend Technologies, Inc. Software Pre-req's Please read the Installation Guide !!! Description Product Option Licensed Program -------------------------------------- --------------- ---------------- Portable App Solutions Environment 33 5722ss1 Qshell 30 5722ss1 System Openness Includes 13 5722ss1 IBM Portable Utilities For I5/OS *base 5733sc1 OpenSSH ,OpenSST,Zlib 1 5733sc1 Copyright © 2009 Zend Technologies, Inc, All rights © All rights reserved. Zend Technologies, Inc. | 14 reserved 02/03/ 10 Install Zend Core • Prerequisites: ! See Zend Core installation documentation!!! ! i5/OS V5R3*, V5R4, V6R1 ! Recent Cumulative PTF package, PASE, QShell • SftSoftware ins tlltitallation ! Windows Installation or... ! Upload *SAVF, Restore, and start coding! ! Clean installation will start the stack automatically • Bonus! ! MySQL can be installed at the same time Copyright © 2009 Zend Technologies, Inc, All rights © All rights reserved. Zend Technologies, Inc. | 15 reserved 02/03/ 10 Administer Zend Core ! Type GO ZENDCORE/ZCMENU, Option 5 then 1 Copyright © 2009 Zend Technologies, Inc, All rights © All rights reserved. Zend Technologies, Inc. | 16 reserved 02/03/ 10 Sample Script – Hello World • Obligatory program when starting out • Confirms correct setup of PHP • Sample code: (Shortest PHP Macro around!) • Save script in IFS /www/zendcore/htdocs /helloworld.php • BURLBrowser URL: http: //i5system:89/he llowor ld.p hp <?php echo “Hello World”; ?> Copyright © 2009 Zend Technologies, Inc, All rights © All rights reserved. Zend Technologies, Inc. | 17 reserved 02/03/ 10 Copyright © 2009 Zend Technologies, Inc, All rights | 18 reserved 02/03/ 10 Zend Core Configuration • Two apache servers ! Use i5server:2001 to administer IBM server ! Use Zend Admin to administer Zend Apache server Copyright © 2009 Zend Technologies, Inc, All rights © All rights reserved. Zend Technologies, Inc. | 19 reserved 02/03/ 10 Zend Core Port Change? • Default proxy points to Port 89 ! Log in to IBM Admin Server and open up ZENDCORE ! GtGGo to Genera lSl Server Open Source Configuration ! Click Apply & restart the server Copyright © 2009 Zend Technologies, Inc, All rights reserved | 20 © All rights reserved. Zend Technologies, Inc. 02/03/ 10 Zend Core php.ini changes • Manage php.ini via GUI in Zend Core ! Log in with initial password, can reset in green screen ! Administe r all values in Open Source php.ini ! Include path is one of many options ! Must restart Apache in green screen for changes to take effect Copyright © 2009 Zend Technologies, Inc, All rights © All rights reserved. Zend Technologies, Inc. | 21 reserved 02/03/ 10 i5 Toolkit APIs • System values • Job logs • User space !i5_get_system_value !i5_jobLog_list !i5_userspace_create !i5_jobLog_list_read !i5_userspace_prepare • Data areas !i5_jobLog_list_close !i5_userspace_get !i5_data_area_prepare !i5_userspace_put !i5_data_area_receive • Active jobs !i5_ data_ area_ send !i5_ job_list • Programs !i5_data_area_close !i5_job_list_read !i5_program_prepare !i5_job_list_close !I5_program_call • Print/Get spooled file !i5_spool_list • Objects list !i5_spool_list_read !i5_object_list !i5_spool_list_close !i5_object_list_read !i5_spool_get_data !i5_object_list_close !i5_spool_from_file?? Copyright © 2009 Zend Technologies, Inc, All rights © All rights reserved. Zend Technologies, Inc. | 22 reserved 02/03/ 10 Zend Studio 7.1 for IBM i • Included for IBM i customers w/1 year support • Essential IDE for PHP on IBM i • Syntax checker • Code completion • Debugger • Built on Eclipse framework • Function directory • Templates • Much, much, more Copyright © 2009 Zend Technologies, Inc, All rights © All rights reserved. Zend Technologies, Inc. | 23 reserved 02/03/ 10 Zend Studio 7.1 for IBM i - Installation • Download program from Zend.com/en/downloads (i5 Edition!) • Install to workstation (Mac, Windows, Linux) • Follow the prompts for licensing the product • Zend.com with QSRLNBR to license product • Start the IDE and begin coding PHP immediately Copyright © 2009 Zend Technologies, Inc, All rights © All rights reserved. Zend Technologies, Inc. | 24 reserved 02/03/ 10 How do I access IFS files? • Three methods I use ! Netserver file associations (or a mapped local drive) • Can be sluggish ! Remote server configuration • Best for all purposes ! WRKLNK • Only for emergencies! Copyright © 2009 Zend Technologies, Inc, All rights © All rights reserved. Zend Technologies, Inc. | 25 reserved 02/03/ 10 Remote Server Options • FTP ! Familiar ! Sluggish ! Most systems support this • SSH ! More secure ! More powerful ! Easy to setup ! Easier to setup on i6.1+ Copyright © 2009 Zend Technologies, Inc, All rights © All rights reserved. Zend Technologies, Inc. | 26 reserved 02/03/ 10 Configuring a remote server (FTP) • Start Zend Studio for IBM i • Click the new connection button and select FTP • Enter system
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages42 Page
-
File Size-