Fixing “Call to undefined function ctype_alnum()”

As I mentioned last time, I switched to AMPPS for my local development environment on my Mac.

Once over in AMPPS, however, there was a certain PHP script that seemed to give me a problem.

“Call to undefined function ctype_alnum()”

The solution was simple: to enable the PHP extension called ctype.

  1. AMPPS Application > PHP Tab > PHP Extensions > Check “ctype” > Apply.
  2. Restart Apache server.



Recently I switched from MAMP to AMPPS for local web development on my Mac.

Like MAMP, AMPPS is an “installable full stack” that can be used to unintrusively run an Apache/MySQL/PHP/Perl/Python stack on Linux/Windows/Mac. And, like MAMP, it installs as an application, and the server daemons can be switched on or off as needed.

The main motivation for the switch was that my trial license for MAMP PRO expired, and its PRO benefits were not really benefitting me enough to purchase a license and continue using it. However, it was not a simple thing to simply switch over to MAMP (non-PRO), as my database settings were seemingly not reflecting after the switch. Additionally, AMPPS comes with Softaculous, which is a suite of scripts that lets one easily install many web apps that can run on the stack.

An example of such an app is WordPress. From an administration screen it’s possible to enter a few site details and after clicking a button, the site is up and ready. As we now develop a lot for WordPress at work, this ability to get WordPress instances up and running quickly has been very helpful.

Try AMPPS, it’s totally free.


WordPress plugin in PhpStorm 10

I needed to create a new plugin for WordPress, so I decided to take advantage of the JetBrains Toolbox license I have and use a PHP IDE called PhpStorm. The support for WordPress is supposed to be great, with coding assistance specific to WordPress. Setting things up took a bit of figuring out so I’m going to document the steps.

Note: This might not be any different than it was in PhpStorm 8 or 9.

In my examples I’m using MAMP as my Web Server and PHP.

  1. First we start PhpStorm and click “Create New Project”


  1. Next, we give the plugin a name and enter the WordPress installation path. Click “Create”.


  1. We are presented with the main IDE of PhpStorm.


  1. In the status section (click the bottom-right corner to bring it up if it’s not up), click the links to enable WordPress code style and WordPress installation.


  1. If no Interpreters are listed here then you may need to add the reference to one by clicking the ellipsis button next to the dropdown and summoning the dialog box shown below. The screenshot shows an example of a path to the PHP that comes with MAMP.


  1. In Preferences | Build, Execution, Deployment | Deployment, add a “web server” by clicking the + sign. Enter a name and specify its type as “local or mounted folder” so that PhpStorm can upload files into the plugin folder easily.


  1. Now, in the “Connection” tab, specify the WordPress folder as the “Upload/Download project files” folder (this is the directory that PhpStorm will treat as the project root when deploying). Specify the Web server root URL if you have your web server accessible at some URL. In the case of MAMP it would be http://localhost:8888.


  1. Next, in the “Mappings” tab, enter for Deployment path on server the value of “wp-content/plugins/<project-name>”. This means that when you choose to “deploy” this project, its files will be placed in this folder. After all, we are creating a WordPress plugin. Click “OK”.


  1. Back in the main IDE, there should now be an “Upload to <web server name>” item in the Tools | Deployment menu. Click it, and this should “upload” the files to the plugin directory of your local WordPress installation.


  1. Now enter the WordPress Admin and go to Plugins. Now you see the plugin here!