Using PHP with Rational Developer for IBM i

open phpIf you’re using Rational Developer for i (RDi) for most of your development tasks, you might want to use it for PHP, too. RDi is based on Eclipse, so we can use the Eclipse PHP Development Tools (PDT) with RDi.

However, there are some additional steps to take and quirks to be aware of. This post provides the steps for a trouble-free installation of PDT, with tips to resolve common issues.

Read more

Integrate Python into CL & RPG on IBM i – 2021 Update

python trainingPython on IBM i has proven itself as a tool for building utilities to create/read Excel files, transfer data, automate processes, call REST APIs such as Salesforce and ServiceNow, monitor applications, and more. What was missing was an easy way to use the power of Python from CL and RPG.

In 2019 we introduced you to the PYRUN command for running Python scripts from CL and RPG programs.

In this post we introduce you to QSHPYRUN, the next generation of PYRUN and part of Richard Schoen’s open source QShell on i Library – QshOni. QSHONI makes it easy for traditional CL and RPG programs to call Python utilities and use their output. This is supported via the QSHPYRUN command. QSHONI also supports general calls to other QShell, PASE and bash calls via the QSHEXEC and QSHBASH commands. This means QSHONI commands support calling Python, Node, PHP, Java and all things open source, making QSHONI much more versatile than the standalone PYRUN command was. The QSHONI commands can safely live side-by-side with the PYRUN command because they live in different IBM i libraries. This allows for migration to QSHPYRUN to  happen as needed. Read more

Tutorial: Integrate Node.js with RPG without a Connector

Node.js IBM iWe’ve been hearing from clients wondering whether they need commercial connectors to integrate open source technology with Db2, RPG, and COBOL data.

Liam Allan has shown the power of using open source tools that are available to everyone. He recommends accessing IBM i business logic and data using open source tools, without proprietary connectors.

Read more

How to Validate Self-Signed SSL / TLS Certificates from IBM i

(Co-authored by Gautier Dumas and Calvin Buckley)

When we use open source languages such as PHP, Python, and Node.js on IBM i to help companies build and access APIs and other resources, we expect these resources to be protected with encryption (for example, the https:// protocol). Further protection is provided by an SSL / TLS certificate that can be authorized, or signed, by a popular certificate authority such as Verisign,  Comodo, or Let’s Encrypt, or signed internally by the company itself.

Self-signed certificates are most useful in situations where public trust of a certificate is unnecessary, such as:

Read more

Storing Passwords Safely

Steal passwordIf your application deals with user accounts, it has to deal with passwords. Storing passwords in plain text would be a bad idea; a data breach could allow an attacker access to every account. The obvious answer is to encrypt the passwords. However, using cryptography without understanding could give you a false sense of security—if you make the inappropriate choice, you could make things easier for an attacker without realizing it. This article will focus on getting you up to speed with the best ways to use cryptography to secure passwords.

Read more

Set Up PHP Servers in Seconds with Siteadd

A modest but powerful utility “stole the show” during last week’s Lunch & Learn with Alan Seiden and Paul Tuohy. Packaged with CommunityPlus+ PHP, Seiden Group’s siteadd creates an Apache HTTP instance and a FastCGI configuration customized for your needs. In seconds, you’ll be able to launch a sample PHP page to test your new web instance.

How to Measure Python Speed with QCachegrind

Python on IBM iWant to know which parts of your Python program take how much time? Which parts are slow, and how often they are called? Python includes tools to measure speed, but it’s not easy to visualize their meaning.

To make it easier, the QCachegrind tool graphically displays profiler output from a variety of languages. We first introduced our build of QCachegrind as a PHP tool, but you can put your Python programs under the QCachegrind microscope as well.

Read more

Reading and Writing Physical Files in a Shell using Rfile

Want to read source member data from within an IBM i shell environment, such as SSH, QShell, or QP2TERM? Need to copy records from a text file to a physical file? Want a quick way to upload a save file without needing FTP?

IBM i’s Rfile command can do all these things easily. Rfile is designed to be easy to integrate into scripts, so it’s a great tool to have at hand.

Read more

Node.js and IBM i – Getting Started Guide

This guide will outline writing your first Node.js application. Node.js is a packaged version of the V8 Javascript engine, created by Google and shipped in Chromium. Although Node.js is cross-platform, specific tips for IBM i are given in section 8.

Detecting Memory Leaks in PHP Extensions During Development

memory leakWhen a PHP extension has a memory leak, mysterious crashes can result, forcing users to restart the web server for relief.

As official maintainers of the ibm_db2 and PDO_IBM extensions, we’ve been on a quest to find and eliminate any memory leaks from these popular PHP modules.

With such a comprehensive goal, we needed a strategy. For extensions that have comprehensive test suites we decided that, in addition to reviewing the usual regression tests, why not also use the tests to detect leaks?

What follows is a technical look at how we do it.

Read more