Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #231824

Re: php-pear etc. on an Apache2 server [resolved]

From Gary Dale <gary@extremeground.com>
Newsgroups linux.debian.user
Subject Re: php-pear etc. on an Apache2 server [resolved]
Date 2021-02-18 15:10 +0100
Message-ID <BJSae-8pO-11@gated-at.bofh.it> (permalink)
References <BJhu2-1JA-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 2021-02-16 17:56, Gary Dale wrote:
> 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?
>

The issue turned out to be that script had an incorrect include. It 
asked for Mail_Mime/mime.php when the actual include should have been 
Mail/mime.php. I suspect that the php package names may have changed 
since the author wrote the script and they never bothered to update it.

Back to linux.debian.user | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

php-pear etc. on an Apache2 server Gary Dale <gary@extremeground.com> - 2021-02-17 00:00 +0100
  Re: php-pear etc. on an Apache2 server [resolved] Gary Dale <gary@extremeground.com> - 2021-02-18 15:10 +0100
    Re: php-pear etc. on an Apache2 server [resolved] Gary Dale <gary@extremeground.com> - 2021-02-19 15:20 +0100
      Re: php-pear etc. on an Apache2 server [resolved] Gary Dale <gary@extremeground.com> - 2021-02-19 23:30 +0100

csiph-web