• The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
Menu
  • The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
  • Installing PHP on Your Laptop

    March 29, 2016 Chris Ringer

    In my introductory article I walked you through a crash course in PHP. Now I will show you how obtain a free PHP development environment on your laptop in two easy installations of XAMPP and Netbeans. This allows you the freedom to configure PHP and test your scripts as you choose without affecting a production website or needing management approval.

    However, if you need to manage PHP scripts on an IBM i, you will want to alternatively explore using Zend Studio. This full-featured IDE integrates directly with the IBM i and allows you to write and debug scripts stored on the IFS. All developers of IBM i customers may download Zend Studio and register a free perpetual license for that version using an email address and the IBM i serial number. When you run your 30-day trial version of Zend Studio, just click on “Get a License for IBM i” instead of “Purchase Now” in the trial screen (Figure 1).

    Figure 1.

    Setting A Good XAMPP Pull

    First we will install the open source package XAMPP (“ex-amp”) that contains:

    • Apache HTTP Server
    • MariaDB database (a drop-in alternative for MySQL)
    • PHP Engine
    • Perl
    • XDebug Debugger
    • And other components

    Choose your download preference here. I selected the Windows version of PHP 5.6.15 (I couldn’t get the debugger to work in version 7.02) and the download took two minutes. And do click on the “What’s Included” link on that web page to see what the other tools are included in the download.

    Your download folder will then contain an executable file with a name similar to “xampp-win32-5.6.15-1-VC11-installer.exe.” Per the XAMPP documentation, disabling your anti-virus software will make the installation go faster. Double click this executable file to begin the installation.

    You will be shown six screens.

    1. A Welcome screen. Click NEXT.
    2. Which components to install. I left everything checked (Figure 2). You don’t have to use them all and storage is cheap. Click NEXT.
    3. The installation folder. I accepted the default C:xampp. Click NEXT.
    4. Learn more about Bitnami for XAMPP. I unchecked this box. Click NEXT.
    5. Ready to Install. Click NEXT and wait about five minutes for the installation to complete.
    6. The Setup Completion screen asks you to optionally launch the XAMPP Control Panel. I unchecked this option and will do this step later. Click FINISH.

    Figure 2.

    Grinding Some Fine NetBeans

    Let’s now install the NetBeans PHP IDE. This includes: PHP/HTML5/CSS Editor

    Navigate to Netbeans and click on the orange download button. Select your IDE spoken language, platform, and depending on the CPU of your computer, either the x86 or x64 PHP bundle to start the download. I chose English, Windows, and x64. The download took 4 minutes.

    To begin the installation, double click on the netbeans-8.1-php-windows-x64.exe file in your downloads folder. You will be shown five screens.

    1. A Welcome screen displays. Click NEXT.
    2. Accept the license agreement. Click NEXT.
    3. Accept the default installation folder C:Program FilesNetBeans 8.1 and Click NEXT.
    4. “Check for Updates” is pre-selected. Click INSTALL. Wait about 5 minutes for the installation to complete.
    5. The “Setup Complete” screen displays. You may uncheck “Provide anonymous data”. Click FINISH.

    Configuration is Easy

    If you look at newly installed programs in Control Panel and sort by date, you will see XAMPP and NetBeans. XAMPP also needs a Visual C++ package and may install that as well (Figure 3).

    Figure 3.

    To launch the XAMPP control panel, double click the program C:xamppxampp-control.exe. (If ports 80 and 443 are already in use and unavailable, follow these instructions.) For the Apache module, click Start under Actions to run the Apache server. Then click Config then PHP (Figure 4). This opens the php.ini in Notepad. This file contains system values for PHP.

    Figure 4.

    Scroll to the bottom to the [XDebug] section and add these seven lines, save the changes and close NotePad.

    [XDebug]
    zend_extension = "C:xamppphpextphp_xdebug.dll"
    xdebug.remote_enable=1
    xdebug.remote_host = "127.0.0.1"
    xdebug.remote_port=9000
    xdebug.remote_handler = "dbgp"
    xdebug.profiler_enable = 1
    xdebug.profiler_output_dir = "C:xampptmp"
    

    For convenience, set Apache to automatically start when the XAMPP control panel opens. Click on Config in the upper right corner and then check Autostart Apache (Figure 5). Save the changes and leave XAMPP running.

    Figure 5.

    To launch the NetBeans IDE, double click the program C:Program FilesNetBeans 8.1binnetbeans.exe. We need to verify the XDebug debugger settings match the php.ini settings. Click on Tools -> Options -> PHP -> Debugging (Figure 6). The Debugger Port needs to match the php.ini XDebug value. If the default port value 9000 is already in use on your computer, change this value both here and in php.ini. Click OK to close the Options window.

    Figure 6.

    Your First NetBeans Project

    We will now create a new NetBeans project. A project can be thought of as a website directory that contains an index.php script plus your other scripts. You will see three screens.

    1. Click File -> New Project -> PHP -> PHP Application -> NEXT.
    2. Enter the project name as MyTest and accept the other config defaults. Click NEXT.
    3. We will use the local web server (Apache). Accept the defaults on this screen. Click FINISH. Figure 7 is the result.

    Figure 7.

    And now create a test script named phpinfo.php.

    1. Right click on the project MyTest, click New then PHP File.
    2. Name the new file phpinfo and click FINISH. The .php extension is automatically added and the editor opens the new script.

    Type this code below the <?php tag and save.

    define('BR', '<br />') ; 
    echo 'Running: ', __FILE__, BR ; 
    echo 'System Name: ', php_uname('n'), BR ; // RTVNETA SYSNAME
    phpinfo() ; 
    

    This little script just echoes the full name of the script, the name of your computer and displays all the php.ini settings plus the PHP run-time values. In the menu, click Run then Run File and the output should display in your browser.

    To debug this script, in the menu click Debug then Debug File. Click the orange down arrow repeatedly to step through the script line by line (Figure 8). To end the debug session, click the red square.

    Figure 8.

    Hopefully that worked flawlessly for you. If you feel adventurous, copy the two scripts genDocName.php and testGenDocName.php from my previous article into this project and run those.

    Chris Ringer has been coding in RPG since 1989, focusing primarily on order fulfillment, pharmaceutical and manufacturing environments. In his spare time he enjoys running and doing triathlons. “I’m not fast, usually placing in the middle of the pack, but we’re just as competitive back there.”

    RELATED STORY

    PHP Crash Course For RPG Developers

    Share this:

    • Reddit
    • Facebook
    • LinkedIn
    • Twitter
    • Email

    Tags:

    Sponsored by
    WorksRight Software

    Do you need area code information?
    Do you need ZIP Code information?
    Do you need ZIP+4 information?
    Do you need city name information?
    Do you need county information?
    Do you need a nearest dealer locator system?

    We can HELP! We have affordable AS/400 software and data to do all of the above. Whether you need a simple city name retrieval system or a sophisticated CASS postal coding system, we have it for you!

    The ZIP/CITY system is based on 5-digit ZIP Codes. You can retrieve city names, state names, county names, area codes, time zones, latitude, longitude, and more just by knowing the ZIP Code. We supply information on all the latest area code changes. A nearest dealer locator function is also included. ZIP/CITY includes software, data, monthly updates, and unlimited support. The cost is $495 per year.

    PER/ZIP4 is a sophisticated CASS certified postal coding system for assigning ZIP Codes, ZIP+4, carrier route, and delivery point codes. PER/ZIP4 also provides county names and FIPS codes. PER/ZIP4 can be used interactively, in batch, and with callable programs. PER/ZIP4 includes software, data, monthly updates, and unlimited support. The cost is $3,900 for the first year, and $1,950 for renewal.

    Just call us and we’ll arrange for 30 days FREE use of either ZIP/CITY or PER/ZIP4.

    WorksRight Software, Inc.
    Phone: 601-856-8337
    Fax: 601-856-9432
    Email: software@worksright.com
    Website: www.worksright.com

    Share this:

    • Reddit
    • Facebook
    • LinkedIn
    • Twitter
    • Email

    Sponsored Links

    COMMON:  2016 Annual Meeting & Expo, May 15 - 18, in New Orleans! Great Power Systems event!
    iTech Solutions:  Get your copy of Pete Massiello's The IBM i State of the Union report now!
    NGS:  Webinar: Getting from ? to ! with NGS-IQ - April 5. RSVP Now!

    Healthcare Tech Trends Shape Industry And IBM i X Marks The Spot

    Leave a Reply Cancel reply

Volume 16, Number 07 -- March 29, 2016
THIS ISSUE SPONSORED BY:

WorksRight Software
T.L. Ashford
Bug Busters Software Engineering

Table of Contents

  • Installing PHP on Your Laptop
  • Ease the Burden of Overloading
  • Finders, Keepers: Long Lost RSE Keyboard Shortcuts

Content archive

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

Recent Posts

  • IBM Unveils Manzan, A New Open Source Event Monitor For IBM i
  • Say Goodbye To Downtime: Update Your Database Without Taking Your Business Offline
  • i-Rays Brings Observability To IBM i Performance Problems
  • Another Non-TR “Technology Refresh” Happens With IBM i TR6
  • IBM i PTF Guide, Volume 27, Number 18
  • Will The Turbulent Economy Downdraft IBM Systems Or Lift It?
  • How IBM Improved The Database With IBM i 7.6
  • Rocket Celebrates 35th Anniversary As Private Equity Owner Ponders Sale
  • 50 Acres And A Humanoid Robot With An AI Avatar
  • IBM i PTF Guide, Volume 27, Number 17

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 © 2025 IT Jungle