[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

php-pear etc. on an Apache2 server



I'm running Buster on my local server which, among other things, I use for developing web sites before copying them onto a public host. I've recently been getting into a little php coding because there seem to a lot of sample code out there for things I want to do. Usually they work right away when I try running them after having installed libapache2-mod-php.

Right now I'm trying to get a script working that is actually fairly small and seems straightforward. It displays a form that allows you to send an e-mail with an attachment. I actually have some similar scripts working locally that do pretty much the same thing, but I'm trying to get this one to work because the host I use for one site that needs this type of form has broken the script I had been using (I also didn't like it because it seemed overly complicated and under-featured).

This script use the Pear libraries to handle the heavy lifting, which seems like a reasonable design decision. I installed the php-pear package and also php-mail-mime. Unfortunately, the script failed to work. It was uploading the file but failing to send the e-mail.

I was able to find the line that was failing but it puzzles me. The line is

        $message = new Mail_mime();

which should be working. I ran the (frequently recommended) php-info page (<?php  phpinfo();) and it shows a lot of information but nothing about mime. I'd expect that is something php handles though.

I got the script to send an e-mail by removing all the mime parts and just using the php mail() function. However that's not really useful. I need the mime bits to add the attachment.

Anyway, it looks like I need to do something more (besides restarting Apache2) to get php to use the php-mail-mime library but I'm not sure what. All the Debian information I've found just says "install the package php-<whatever> and it will work". Can anyone help me here?


Reply to: