Archive for the 'LAMP' Category

18th Sep 2003

Upgrading words and pictures

Image(147).jpg

A couple of entries ago, I was going on about the security problems of OpenSSH. In the back of my mind, I knew there was an update I needed to do to Movable Type (which despite all of its wonderfulness, has a really primitive approach to going from one minor version to another). Just did that. I won’t presume that everything is unbreakable though. Us Grizzled Silverbacks know better than that!

So that takes care of the words.

But here’s the fun one … PHP and handling images. What a rigamarole. I had upgraded to PHP 4.3.3 a few days back. It has some security patches, so that makes me feel good about that aspect and all … I’m doing my duty to protect my server, future clients, and am showing some due diligence. I wipe a patrotic tear away from my face as my installation script churns along to the background strains of “The Stars And Stripes Forever”.

But looky here, the new PHP can’t handle not-so-large images. I’m not talking about 15 meg large. I’m saying it gets memory errors on a 700k file. With a nod to Dr. Suess, This PHP New, it will not Do, it is Through. I will Compile Anew.

In other words, considering that I am developing a Photo Database, having PHP choke on a garden variety JPEG is baaa-aaa-aad. I scouted around, trying snapshots from snaps.php.net, trying the latest “stable” build. Broken Broken Broken. imagecreatefromjpeg() becomes ImageNahGonnaDoIt().

I momentarily thought about trying PHP5, which is very much beta. But if I want to demo FlexiPhoto next month in New York, having a beta app with a beta language doesn’t seem like a good plan. Folks would pat me the back, give me points for being so bleeding edge, and say “grab your umbrella, ’cause it’s time for you to leave Right Now, Mr. PHP Crasher!”

Some alternatives that I considered:

  • Call NetPBM apps through exec()
  • Call ImageMagick through exec()
  • Install the PEAR imagick package, and call the ImageMagick API that way

I’m going for Curtain #3. I’m not a big fan of calling outside executables if I can help it. Michael Montero, who wrote the imagick package that lets PHP talk to ImageMagick, assures me it’s a good move. Rockin.

Of course, all of this means that my requirements list for installing FlexiPhoto will get a little more involved (will need ImageMagick, will need the PEAR package for calling it). For the target audiences, that will be fine.

Posted in FlexiPhoto, LAMP, Tech, WebTech | Comments Off

10th Apr 2003

PHP and Heredocs article published

I wrote an article about PHP and Heredocs, which has just been published at ONLamp.com The gist of it is to use here documents to separate PHP classes, SQL statements and other resources, and HTML templates. The article evolved out of work I am doing on an upcoming web-based photo database. Enjoy!

Posted in LAMP | Comments Off

grupa LGBT