Category: Drupal

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

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

Drupal error message: “call_user_func_array() expects parameter 1 to be a valid callback”

After doing a series of updates to a Drupal installation, the following error appeared on all admin pages and edit pages:

“call_user_func_array() expects parameter 1 to be a valid callback, function ‘clients_access_callback “

Other symptoms included that the database could not be updated to complete some of the following updates, and search no longer worked.

Continue reading

Spam prevention on Drupal sites

I run a Drupal site with several thousand users. Users self-register, and there are no other moderators but myself, so it needs to be virtually maintenance free to be sustainable.

And for years, it was! Since the site’s members are well-behaved, the only major maintenance besides keeping the Drupal installation updated was cleaning up spam posts. Usually, there weren’t many to clean: perhaps a few per week, but nothing that took a lot of work to get rid of. Early on, I had installed the Anti-spam module which provides three anti spam services to choose from. I selected Defensio, which offers a free filtering service for sites with less than 25,000 posts/month.

Continue reading

Settings to get Drupal 7 working on Hostgator

At the moment, Hostgator’s default PHP version is v.5.2.4, although version 5.3 is available. Drupal 7 requires 5.3, so until they make it the default, it is necessary to manually tell Drupal where to find PHP v. 5.3. Do this by adding

Action application/x-hg-php53 /cgi-sys/php53
AddType application/x-hg-php53 .php 

to an .htaccess file located in the public_html directory of your site. If Drupal is not at the root of your site, and you don’t want to change the entire site over, it works just as well to modify the .htaccess file in the Drupal directory.

An .htaccess file is just a text file named “.htacess” which can contain many different types of directives understood by the apache server.

Continue reading

Drupal OpenWYSIWYG text editor

openwysiwyg_0.thumbnail.gif

One of the biggest drawbacks of Drupal for several years has been the lack of a single rich-text editor that is totally compatible with all browsers. Two years ago, I tested all of the WYSIWYG modules available at the time, found they were all riddled with bugs and incompatibilities, and finally settled on the YUI editor for a large Drupal site I run.

Unfortunately, it never really worked that well: the site’s members upload lots of photos, and it did a poor job of sizing them – users had no idea how to ensure they were not displayed at full resolution – and with 10 megapixel cameras, full resolution is enormous!

Continue reading

Drupal YUI Rich Text Editor: Set maximum image dimensions on uploaded images

The search for the perfect WYSIWYG text editor in Drupal goes on. The best I’ve seen yet is YUI Rich Text Editor, but it still has some serious browser incompatibilities and usability problems. One significant is that there is nothing stopping users from upload a huge image, and not resizing it down using the provided resizing tools.

Now that just most cameras produce images of enormous resolution, users in my Drupal sites’ users often upload gigantic photos, which remain splashed across the entire layout until I get around to fixing them. I finally got tired of correcting users’ posts for them and fixed the CSS so it will never happen again.

Continue reading