I am getting the following error after updating:
warning: preg_match() expects parameter 2 to be string, array given in /var/www/vhosts/domain.com/httpdocs/cms/includes/bootstrap.inc on line 670.

Comments

dopry’s picture

Status: Active » Postponed (maintainer needs more info)

What do you do when this error occurs? There should be more info in your watchdog.

davegan’s picture

I had this problem - thought I had imagemagick installed but I didn't.

Try enabling the ImageAPI GD2 and disabling the ImageAPI ImageMagick module.

marcoBauli’s picture

same error here. there's another issue dealing with this at http://drupal.org/node/269159

PS: imagemagick not installed. I also get:

warning: mkdir() expects at most 2 parameters, 3 given in /backup/tmphome/kiteatla/public_html/test/sites/all/modules/imagecache/imagecache.module on line 440.

but might be related to permissions to create folders on the server.

Images do not show up..

dopry’s picture

@marcobauli, upgrade to php5 imagecache 2.x requires it.

@portrait: gonna answer that question so someone can try to help you?

portait’s picture

I don't remember how but I got it resolved.
Thanks

marcoBauli’s picture

dopry, yes, i'm on PHP 5.0.4 on a site, and 5.2 on another server, and see the error in both of them actually..

in the watchdog i get

"preg_match() expects parameter 2 to be string, array given in /home/www/includes/bootstrap.inc in row 670."

and

Failed generating an image from bilder/IMG_6542_0.JPG using imagecache preset .

(another similar or probably duplicate issue is here)

thx

marcoBauli’s picture

Title: error after update » Warning: preg_match() expects parameter 2 to be string

PS: this happens also on a fresh install of Imagecache 2 (no update)

(editing title to something easier to remember)

dopry’s picture

Marco bauli sounds likes you need to update the imagecache preset for something... an empty preset is being called...

if you're using CCK on admin/content/type/$type/display, resubmit the options where imagecache formatters are used.

grafik’s picture

Same problem with PHP Version 4.3.9 and Imagecache: 5.x-2.x-dev (same with 5.x-2.0)

log file:

imagecolortransparent(): 80 is not a valid Image resource in /var/www/httpdocs/sites/all/modules/imageapi/imageapi_gd.module on line 134.
imagecolorsforindex(): 80 is not a valid Image resource in /var/www/httpdocs/sites/all/modules/imageapi/imageapi_gd.module on line 139.
imagecopyresampled(): 80 is not a valid Image resource in /var/www/httpdocs/sites/all/modules/imageapi/imageapi_gd.module on line 63.
preg_match() expects parameter 2 to be string, object given in /var/www/httpdocs/includes/bootstrap.inc on line 670.
imagecache_scale_image failed. image: %image, data: Array ( [width] => 180 [height] => 180 [upscale] => 0 ) .
action(id:2): imagecache_scale failed for files/test/test.jpg
Anonymous’s picture

I'm getting this Error too:

warning: preg_match() expects parameter 2 to be string, array given in /var/www/vhosts/simonsuter.ch/httpdocs/includes/bootstrap.inc on line 670.

Im recently tried to set up my first gallery by following the instructions of Elliot Rothman's Screencast http://www.theartlab.net/drupal-school-009-maintainable-gallery

After the 4th time trying it everything went right exept that I get this error.

Can anyone say exactly what I have to do now?

Bootstrap.inc on line 670 says: " return (preg_match('/^./us', $text) == 1);"

I'm currently not enough educated in php to understand that yet. So... Tips and Solutions are very welcome!

Thx, sai-gon

drewish’s picture

Status: Postponed (maintainer needs more info) » Fixed

the preg_match part of the error was fixed over on #263058: Error in watchdog message. upgrade to 5.x-2.1 and see if this is still a problem. if so re-open this.

jlmeredith’s picture

I had the same issue with this error. My solution was to disable the module that allows for photo uploading during registration. http://drupal.org/project/reg_with_pic Disabled - error goes away.

marcoBauli’s picture

discovered that the error was appearing when trying to resize bitmaps.

The format type filter was not working well in previous versions, so users could still upload .bmp

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

asak’s picture

@jlmeredith : THANK YOU !!!

This was killing me...