PHP 7.3 Enters End of Life Today—Free Upgrade Assessment

PHP on IBM iPHP 7.3 entered end of life today and will no longer receive fixes—including security fixes.

If you’re still running applications on PHP 5.4, 5.6 or 7.3 (run php -v to check), it’s time to schedule a free upgrade assessment.

PHP upgrades are easier now, thanks to IBM’s adoption of RPM-based open source packages. Over the past year, our clients have reported smooth and even enjoyable migrations to CommunityPlus+ PHP 7.4 and 8.0.

Read more

PHP 8.1 Released for IBM i

PHP 8.1 and IBM i

Good news everyone! In cadence with the release of PHP 8.1 by PHP.net last week, companies running PHP on IBM i can now download PHP 8.1 for use with their own applications.

According to this briefing with IBM i’s Open Source Business Architect, Jesse Gorzinski, staying current with PHP is a best practice for many reasons—for security and security audits, to fix deprecated code before you dig a huge technical debt hole, to keep your PHP environment running smoothly, and so on.

I’ll cover how to access the IBM i version of PHP 8.1 later in this post. First, though, let’s survey our favorite enhancements in this new release. We’re a big fan of PHP’s own release notes, so we recommend that you read them.

Read more

Optimize Your IBM i Web Application Using FastCGI

(Co-written with Alan Seiden)

FastCGIFastCGI speeds up web applications by pre-starting and managing jobs for popular languages such as PHP. FastCGI can be configured to handle any language that supports the FastCGI interface, as shown in this FastCGI configuration for node.js. When it comes to PHP, you can trust tools such as our CommunityPlus+ PHP siteadd to set good FastCGI defaults. You can also customize fastcgi.conf to accommodate higher traffic, multiple environments, and to solve problems. Read on as we explain how FastCGI works and how to configure it.

Read more

Speed Up Web Pages Using Apache’s mod_deflate

Apache HTTP Server ProjectWhen we do performance assessments for web applications running on HTTP Server (Powered by Apache) for i, one of the first things we do is enable a powerful Apache extension called mod_deflate. Just as zipping up files on your PC saves space and accelerates file transfers, mod_deflate compresses output from your server before sending it over your network.

Does it really work? My tests show a speed improvement of 10 to 50 percent!

Read more

Visual Studio Code, IBM i & PHP

Visual Studio Code 1.35 iconEvery post about Code for IBM i thus far has been how it can be used for writing RPG, CL, COBOL, etc. But what about other languages? Of course, PHP is another one of those very popular languages on IBM i. Calvin wrote a little while ago about how it’s possible to use RDi to write PHP code on the server, which is great. I think we can take it up a notch, which brings us to this post.

Read more

Solving “getaddrinfo() thread failed to start”

Curl-logoIf you download files onto your system using PHP, Yum, RPM, or other tools, there’s a good chance curl is involved, be it part of a library (such as PHP’s curl extension and the Guzzle HTTP client) or called as its own program.

IBM i PASE provides a version of curl that speeds up common tasks like DNS lookups by using additional threads. When threading support is not available, however, curl fails.

Read more

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

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

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

Sending Email from PHP on IBM i

With reliable email functionality being one of the top concerns of IBM i PHP users, we’ve made sure that CommunityPlus+ PHP includes everything you need to send email. The PHP mail() function works well, as do components such as Zend\Mail and PHPMailer.

Over the past couple of years, we’ve been hearing from disappointed PHP users that mail() didn’t work in other Community PHP distributions (and some builds of Zend Server). PHP mail() requires an external program that implements the sendmail interface. If your PHP distribution lacked sendmail or equivalent, you might have received a cryptic error message such as:

sh: -t:  not found

This article discusses your options for sending email using CommunityPlus+ PHP.

Read more