• The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
Menu
  • The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
  • Installing a PHP/MySQL Open Source Application on i

    April 20, 2011 Paul Tuohy

    I have often used PHP/MySQL open source applications on my PC, but I have never had the opportunity, or need, to use one on the IBM i. That is, not until recently.

    I was working on a project with three other developers, and we are located in Ireland, Canada, and the U.S. We needed some simple project management software that would work over the Web and did not require in degree in “Gant chart” mechanics. After a quick search I came across a PHP/MySQL open source package, ProjectPier, which seemed to suit our needs.

    So, in this article, I would like to share what I had to do to get this open source package up and running on i. From start to finish, it took 13 minutes (give or take a few seconds), That includes download and upload times. Remember, I had prior experience of PHP/MySQL on other platforms, which definitely helped in understanding what it was I needed to do. My previous experience with MySQL prompted me to install an extra piece of open source software: Adminer, which was used to administer MySQL databases.

    These were the installation steps:

    1. Ensure Zend Server is running
    2. Get MySQL installed and running
    3. Configure a MySQL administration profile
    4. Download and install Adminer
    5. Use Adminer to create a MySQL database for ProjectPier
    6. Download and install ProjectPier
    7. Configure ProjectPier

    Steps one through five above are a one-time process and do not need to be repeated for every open source project you might install.

    But First

    Please ensure you have the following software installed on your system:

    • Base OS options: 13: System Openness Includes; 30: Qshell; 33: PASE (Portable Application Solutions Environment)
    • IBM Portable Utilities for i5/OS – *Base

    To perform the following installation and configuration requires a profile with a class of *SECOFR.

    I was installing on a system running V7R1 (yeah, I know) with Zend Server installed and running. MySQL had not been installed/configured.

    Although the system I am working on is at V7R1, the following instructions should work on systems from V5R4 on.

    Zend Server

    To ensure you have Zend Server installed, enter the following command:

    GO ZENDSVR/ZSMENU
    

    That command will present the screen shown in Figure 1:

    Figure 1: The Zend Server Setup Menu.

    To ensure that the Zend Server instance is running, take option 5 (Service Management Menu) and then take options 1 (Start Zend Server Subsystem) and 5 (Start Apache Server Instances) from the resulting menu, shown in Figure 2.

    Figure 2: The Zend Server Service Menu.

    Assuming that you have not changed the default Zend Server installation, pop over to a browser and enter the URL of:

    http://yourserver:10088/
    

    That URL will take you to the Web page shown in Figure 3:

    Figure 3: The Zend Server Test Page.

    For the sake of demonstration I am going to install everything in the Zend Server default instance. If you are going to use a different Apache instance, you need to ensure that the configuration file (usually /www/instancename/conf/http.conf) contains the following directive:

    DirectoryIndex index.php index.html
    

    Basically, this means that if you enter a directory name at the end of a URL, the Apache server will look in the directory for a file call index.php or index.html.

    MySQL

    From the Zend Server Setup Menu, shown in Figure 1, take option 6 (MySQL Management Menu).

    If MySQL has not already been installed on your system it will now be automatically installed. The installation process will warn you if you have any missing software or configuration components.

    From the resulting menu, shown in Figure 4, take options 1 (Start MySQL Subsystem) and 4 (Start MySQL Daemon).

    Figure 4: The Zend MySQL Management Menu.

    MySQL Administration Profile

    MySQL utilizes its own security as opposed to using system security. Therefore, in order to create, maintain, and access databases, you need to create at least one MySQL profile.

    If you have never had the fortune, or misfortune, of using Unix or Linux, the following is going to seem a little strange. But remember, you only have to do it once.

    From a command line, enter the following command to switch to Unix mode.

    CALL QP2TERM
    

    You now want to start MySQL. Enter the following case-sensitive commands (they are the equivalent of doing a CHGCURLIB and a start command):

    cd /usr/local/mysql/bin
    mySQL -u root
    

    Your screen should now be similar to the screen shown in Figure 5. Note the mysql> indicator, at the bottom of the list, which shows you are in MySQL.

    Figure 5: MySQL in 5250.

    Now to create the profile and grant the required authorities. You just need to provide the profile name and password, but the following syntax is very important:

    create user 'paul'@'localhost' identified by 'mybusiness';
    grant all on *.* to 'paul'@'localhost';
    

    The important points to note are:

    • The profile is in single quotes
    • The profile is followed by @’localhost’
    • In this example ‘mybusiness’ is the password
    • Statements end with a semicolon

    Figure 6 shows you the screen after the profile has been created and authority granted.

    Figure 6: MySQL after creating profile and granting authority.

    All done? Type in the command “quit” to exit MySQL, and then press F3 to return to the familiar command line.

    Install Adminer

    Make your way to the Adminer Web site and download Adminer. This is just a small PHP script file and will have a name like adminer-3.1.0.php.

    On the i, create a new directory in the document root of the Apache instance, copy the downloaded Adminer file to the directory, and rename the file to index.php. In my case, I created a directory named Adminer in /www/zendsvr/htdocs, copied the file adminer-3.1.0.php into that directory and renamed it to index.php.

    Back in a browser, to get to the Adminer log-on page, enter a URL of:

    http://yourserver:10088/Adminer
    

    Log on with the profile and password you defined in the previous step: In my case that would be paul mybusiness. (You only need to enter the profile and password on the logon screen; the server defaults to localhost).

    Create the ProjectPier Database

    In Adminer, take the link to “Create New Database,” enter a name for the database, and click the Save button. Figure 7 shows the database being defined. You are now done with Adminer, so you can log out.

    Figure 7: Creating a MySQL database with Adminer.

    Remember the name of the database; you will need it in a moment.

    Install ProjectPier

    Make your way to the ProjectPier Web site and download ProjectPier. This is a ZIP file and will have a name like ‘projectpier-0.8.0.3.zip’.

    Unzip the downloaded file and you will end up with a directory with the same name (projectpier-0.8.0.3). Rename the directory to a more meaningful name (projectpier) and copy it to the document root of the Apache instance you are using (the directory is approximately 5M).

    I ended up with:

    /www/zendsvr/htdocs/projectpier
    

    Once you have copied up the directory, ensure that *PUBLIC has *RWX authority to the following files and directories

    • config/config.php
    • /public/files
    • /cache
    • /upload

    If your 5250 session is still open, the easiest way to do this is to enter the command:

    wrklnk '/www/zendsvr/htdocs/projectpier/*'
    

    Then use option 9 to set the required authority and option 5 to move down into a directory. Figure 8 shows an example of changing the authority for the /upload directory.

    Figure 8: Changing the authority to a required directory.

    Go back to the Web browser and enter a URL of:

    http://yourserver:10088/projectpier/public/install
    

    This page will guide you through the rest of the installation process for ProjectPier. This consists of five steps.

    The first two steps are just informative and check that all prerequisites have been met. The second step will show you if you have missed any of the files or directories that require *RWX access.

    In the third step, shown in Figure 9, you need to identify the database that ProjectPier is to use, along with the profile and password used to access it.

    Figure 9: Identifying the ProjectPier Database.

    After clicking the Next button, you should get the completion screen shown in Figure 10. Although the heading says “Finish” this is not the last screen. But you are almost there!

    Figure 10: Finish ProjectPier Setup.

    Click on the Finish button and you will be presented with the screen where you identify the user ID (yes, another one) and password you will use to access and administer ProjectPier.

    Figure 11: Completing ProjectPier Installation.

    Configure ProjectPier

    Once installed, you should be able to access ProjectPier using the following URL:

    http://yourserver:10088/projectpier/public/install
    

    Then enter the profile and password you defined in Figure 11. I will leave it up to you to play with ProjectPier as and how you see fit. The sequence of events should be to create a company, users and (if required) clients. You can then work your way through Milestones, Tasks, and Task Lists.

    ProjectPier also has some nice features, such as changing the look and feel of the site. Have a look at the Administration function.

    Of course, all the documentation for ProjectPier can be found on their Web site.

    In Conclusion

    There you have it. Although this reads quite long, it is actually a very quick and easy process. Probably the worst part is the creation of the MySQL administration profile, but that is only a once-off task.

    With MySQL in place, the installation of an open source application is usually as straightforward as copying up a file or directory and running an installation program.

    Have fun!

    Paul Tuohy is CEO of ComCon, an iSeries consulting company, and is one of the co-founders of System i Developer, which hosts the RPG & DB2 Summit conferences. He is an award-winning speaker who also speaks regularly at COMMON conferences, and is the author of “Re-engineering RPG Legacy Applications,” “The Programmers Guide to iSeries Navigator,” and the self-study course called “iSeries Navigator for Programmers.” Send your questions or comments for Paul to Ted Holt via the IT Jungle Contact page.



                         Post this story to del.icio.us
                   Post this story to Digg
        Post this story to Slashdot

    Share this:

    • Reddit
    • Facebook
    • LinkedIn
    • Twitter
    • Email

    Tags:

    Sponsored by
    LaserVault

    Integrate Virtual Tape to Automate Your Backups And Strengthen Your Ability To Recover From Cyber Attacks And Disasters

    With most IT departments stretched thin, finding something that can quickly free up IT time is definitely a bonus. That’s why it’s important to stop and take a look at integrating virtual tape into your backup and recovery. Virtual tape is one of those technologies where once you have it, you’ll wonder why you didn’t do it sooner. See a demo and get a $50 gift card.

    But what is it about using virtual tape that makes it so worthwhile? Why is it that so many IBM i shops are already using or considering using virtual tape for all or part of their backup and recovery systems?

    Virtual tape and virtual tape libraries offer a way to both simplify and strengthen backup and recovery operations. By incorporating virtual tape technology, automation of backups becomes possible resulting in hundreds of hours saved annually for IT departments and personnel.

    “We needed to find a replacement that would lower the maintenance cost and reduce complexity of our backup and recovery functions without a major disruption to our operations.” David Fray, Director of Enterprise Systems, ABC Financial

    LaserVault ViTL is a virtual tape and tape library solution developed specifically for use with IBM Power Systems (from AS/400 to iSeries to Power 9s). With ViTL you can:

    • Replace physical tape and tape libraries and eliminate associated delays
    • Automate backup operations, including the ability to purge or archive backups
    • Remotely manage your backups – no need to be onsite with your server
    • Save backups to a dedupe appliance and the cloud
    • Recover your data at lightspeed greatly improving your ability to recover from cyberattacks
    • And so much more

    Sign-up now to see a ViTL online demo and get a $50 Amazon e-gift card when the demo is complete as our way of saying thanks for your time. Plus when you sign-up you’ll receive a free facts comparison sheet on using virtual tape vs tape so you can compare the functionality for yourself.

    Share this:

    • Reddit
    • Facebook
    • LinkedIn
    • Twitter
    • Email

    Sponsored Links

    SEQUEL Software:  FREE Webinar: Track Key Business Metrics at a Glance. April 27
    JAMS Job Scheduler:  Enterprise job scheduling for System i, Windows, Linux, and UNIX
    COMMON:  Join us at the 2011 Conference & Expo, May 1 - 4 in Minneapolis, MN

    IT Jungle Store Top Book Picks

    BACK IN STOCK: Easy Steps to Internet Programming for System i: List Price, $49.95

    The iSeries Express Web Implementer's Guide: List Price, $49.95
    The iSeries Pocket Database Guide: List Price, $59
    The iSeries Pocket SQL Guide: List Price, $59
    The iSeries Pocket WebFacing Primer: List Price, $39
    Migrating to WebSphere Express for iSeries: List Price, $49
    Getting Started with WebSphere Express for iSeries: List Price, $49
    The All-Everything Operating System: List Price, $35
    The Best Joomla! Tutorial Ever!: List Price, $19.95

    Customer Service Initiative Launched by Quadrant That Faster Power 750 Motor Is Made for IBM i Shops

    Leave a Reply Cancel reply

Volume 11, Number 13 -- April 20, 2011
THIS ISSUE SPONSORED BY:

Botz & Associates, Inc.
Vision Solutions
WorksRight Software

Table of Contents

  • Installing a PHP/MySQL Open Source Application on i
  • Stuff I Neglected to Mention on February 16, 2011
  • Best Options for Post-i 6.1.1 Upgrade Backups

Content archive

  • The Four Hundred
  • Four Hundred Stuff
  • Four Hundred Guru

Recent Posts

  • IBM Mulls Using DataMigrator as Cloud Warehouse Pipeline
  • PowerTech AV Automatically Detects Ransomware Activity
  • Infor Puts CM3 Project On Hold
  • Four Hundred Monitor, June 29
  • IBM i PTF Guide, Volume 24, Number 26
  • Guild Mortgage Takes The 20-Year Option For Modernization
  • IBM i Licensing, Part 3: Can The Hardware Bundle Be Cheaper Than A Smartphone?
  • Guru: The Finer Points of Exit Points
  • Big Blue Tweaks IBM i Pricing Ahead Of Subscription Model
  • We Still Want IBM i On The Impending Power E1050

Subscribe

To get news from IT Jungle sent to your inbox every week, subscribe to our newsletter.

Pages

  • About Us
  • Contact
  • Contributors
  • Four Hundred Monitor
  • IBM i PTF Guide
  • Media Kit
  • Subscribe

Search

Copyright © 2022 IT Jungle

loading Cancel
Post was not sent - check your email addresses!
Email check failed, please try again
Sorry, your blog cannot share posts by email.