2/26/2009

More PHP Woes: PHP 5.2.8 and libxml 2.7.x

Filed under:Computers, FreeBSD — jim @ 10:31 pm

EDIT: PHP 5.2.9 is out for FreeBSD, so this may be fixed.

There seems to be a bug in the way PHP’s xml library handles data when compiled against libxml 2.7.x. Supposedly, this will be fixed in the next release of PHP, but for now you have to back down to libxml 2.6.x, or compile against expat instead of libxml.

I first noticed this with a Joomla installation, a component was erroring out, saying “Fatal error: Call to a member function getTagName() on a non-object” (Z Weather, for those interested in knowing). Investigating this led me to this bug entry for PHP. I then found another server of mine with problems, this one was using XMLRPC and was getting back responses stripped of the < and > characters, rendering returned HTML code quite broken.

For those of you on FreeBSD who have no idea how to downgrade to the earlier version, it’s actually pretty simple, it can be done like so:

# cd /usr/ports/ports-mgmt/portdowngrade/
# make DEFAULT_CVS_SERVER="anoncvs@anoncvs1.FreeBSD.org:/home/ncvs" install clean
# portdowngrade libxml2

When presented with the choice, choose textproc/libxml2 (Probably option #2).
It will then start listing all prior version of the libxml2 port. When you see version 2.6.32, press enter. Use the most recent copy of 2.6.32, for me it was timestamped 2008/11/19 19:23:07.
Press the number (probably 3) at the start of the line for the version you want, and let portdowngrade do its thing. As suggested by the output of portdowngrade, finish up like so:

# portsdb -Uu
# portupgrade -f libxml2
# /usr/local/etc/rc.d/apache22 restart

Be aware that the portsdb -Uu run can take a while on older systems. Also, you may substitute that last line with whatever command you typically use to restart apache (shutdown and start again, not a graceful restart)

Danger Will Robinson!: Note that if you update your ports tree it will bring libxml2 back to the most recent version, be careful not to upgrade it again until after the next release of PHP!

end

2/24/2009

Fix for Belt-Driven CD-ROM/DVD Drives that won’t open

Filed under:Computers — jim @ 12:10 pm

Lately I’ve had a rash of optical drives (DVD-RW/CD-ROM/CD-RW) that refuse to open without a little nudge from a paper clip via the manual eject mechanism. I’d press the button and hear a soft “thunk” but the drive tray barely budged. All of the drives that have this issue have been belt-driven. The old gear-driven trays were louder, but they worked much more reliably.

After cleaning the drive trying to replace the belt without success, and even trying to replace a drive motor, I stumbled upon an answer so simple I didn’t believe it would work: Wash the belt in soap and water! For good measure, I also used a Q-Tip with rubbing alcohol on it to clean the pulleys. This has saved several drives from the trash heap, and likely many more in the future.

If you have the right tools, you can even unloop the belt, wash it off, and replace it without removing the drive case. Just be careful, and make sure the power is off before you attempt to work inside the drive.

I hope this saves others a bit of sanity.

end