Category: PHP

Drupal 7: It is recommended to install the PECL uploadprogress library

When installing Plupload module to work with Media module on a Hostgator site, I got the error:

Your server is capable of displaying file upload progress, but does not have the required libraries. It is recommended to install the PECL uploadprogress library (preferred) or to install APC.

Looking at the suggested library (pecl.php.net) it was a shell script that pretty obviously required privileges that I would not have on a shared host. However, Hostgator has another library already installed that implements PECL: CodeGen_PECL. It just has to be enabled.

Continue reading
Wordpress logo

WordPress: SimpleLDAP plugin updated to work with v3.5

The SimpleLDAP plugin by Cliff Griffin is exactly what I needed for a proof-of-concept WordPress site I’m working on, but it hasn’t been officially updated in a while and was not entirely compatible with WordPress v.3.5.

I’ve updated the plugin to eliminate the errors I was getting, and it now works fine on my site, but it could probably use some TLC from someone more experienced with working with WordPress.

The original version of the plugin I used as a basis is v1.4.0.5.1, available at http://wordpress.org/plugins/simple-ldap-login/.

Continue reading

Drupal 7: Fatal error: Allowed memory size of 52428800 bytes exhausted

Working with Drupal 7, you may get an error like the one below. (The actual number may be different.)

Fatal error: Allowed memory size of 52428800 bytes exhausted

If you don’t have one already, add a text file called “php.ini” to the root directory of the Drupal 7 site, and add a line like:

memory_limit = 96M

or

memory_limit = 128M

Continue reading
Wordpress logo

WordPress: Notice: has_cap was called with an argument that is deprecated since version 2.0!

I’ve been experimenting with LDAP and Cosign login plugins for WordPress. Most of them are out of date and are more or less incompatible with WordPress v.3.5. Usually the first error that comes up is

Notice: has_cap was called with an argument that is deprecated since version 2.0!

All this means is that instead of using the numerical role identifier argument in a function that adds a menu or submenu, the required capability should be used instead.

Continue reading

Tips on getting PHP to work on Windows/IIS

Trying to set up php on a Windows server running IIS from scratch can be a challenge. I would recommend first trying out the Microsoft’s Web Platform Installer because it is so easy to use, but sometimes that doesn’t set things up correctly. In my experience it usually works, but occasionally the installation fails to create a working environment. In such cases it may be easier to do the installation from scratch by downloading and running the correct PHP installer for your system from php.net.

If you decide to install from scratch, the following tips may help you resolve problems you are likely to encounter along the way.

Continue reading

Mcrypt extension error after installing phpMyAdmin on IIS

If you install phpMyAdmin on IIS and get the error:

PROBLEM: cannot load mcrypt extension. please check your php configuration

This could be due to the extension being missing or that it is not listed correctly in php.ini file. Listed below are the instructions from around the web that I followed to get this working:

Continue reading

Using the Qualtrics API with PHP and javascript to create custom reports

Qualtrics.com is an extraordinarily full-featured online survey application that offers nearly every type of built-in report on your survey data you could ever want. But eventually, there comes a time when nothing but a custom report will do. Or you may want to integrate Qualtrics data into another application. For those times, Qualtrics has an extensive API which allows access to both data and functionality.

Qualtrics University doesn’t have many details of how to use the API, so to help you get started, I’m providing an example of how I used the Qualtrics API with a PHP proxy and Adobe’s Spry Framework to build a simple custom report.


Continue reading