Posts Tagged ‘PHP’

Send Email with attachments in PHP

Although there are ways to send email in PHP using PEAR and other libraries, sometimes you’ll get stuck in a situation where that either isn’t possible or just too much of a faff.

The other day I decided to create a function for this purpose that I can use in my own library of code.

It can be dropped into your include files and used for simple emails without attachments, HTML emails or complex emails with multiple attachments.

I haven’t spent a great deal of time on this so it might not be 100% but works well for me so let me know if there are any flaws that need to be taken care of.

You can download the function (and supporting functions) from here: send email with attachments in PHP

PHP upgrade to 5.x from 4 on CentOS

One of my customers has recently purchased a VPS for their website.  My Linux VPS is on WebFusion, theirs is on EasySpace.

Now unfortunately EasySpace seem to bugger off at 5pm so I had to rely on Google and hope that some of the Linux boys and girls out there were writing in an intelligible way.

Thankfully for me, I was not let down.

My first source was the AtomiCorp wiki: http://www.atomicorp.com/wiki/index.php/PHP

Then I ran into a little problem with a "dummy" library causing my "yum" to fail.  Similar except here: http://languor.us/error-missing-dependency-glibc-common-2-3-4-2-25-needed-package-glibc-dummy-centos-4

With that removed (on account of it being labelled somethink like xxxxxx-dummy-centos-4) I re-ran the update and succesfully upgraded to PHP 5.2.6.

All seems fine (including Plesk) although I expect the packages in Plesk might be out of synch so I'll need to remember the method in case I have to re-install the VPS anytime soon.

Return top