|
|
Subject: Re: [PHP-INSTALL] mail() sendmail problems - msg#00156
List: php.install
Elijah A. Chancey wrote:
I'm having difficulty with the php mail() function. Freebsd 4.9,
apache 2.0.48, php 4.3.4
Here is my code:
<?php
mail("sysadmin@xxxxxxxxxxxxx", "subject", "body");
?>
The problem:
The mail is not being delivered to my address. PHP returns no errors.
Can a normal user send email? If so then it is a php problem, if not a
sendmail one. I think that will help to narrow it down a bit.
HTH
Chris
Was this page helpful?
Thread at a glance:
Previous Message by Date:
click to view message preview
[PHP-INSTALL] Php sablotron
For a while now I have been trying to
Install php with Sablotron support.
I am using php4.3.4 and Apache 2. After setting
The LDFLAG variable to -lstdc++ I was finally able to
Compile. PHP runs and works with mysql, and some other
Php enabled pages. But when I try to run a sample transform
With the following files, I receive this message:
Warning: xslt_process(): supplied argument is not a valid XSLT Processor
resource in /usr/local/apache2/htdocs/xml/person.php on line 10
I have tried some other sample files copied from tutorials and get other
Error messages:
Parse error: parse error in /usr/local/apache2/htdocs/xtest.php on line
2
The XML,XSL,PHP files and PHP compile, version, and config information
is
Below.
Any suggestions greatly appreciated.
John Rutherford
<?
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
PHP SCRIPT:
// store XML and XSL content as variables
$xmlstring = join('', file('person.xml'));
$xslstring = join('', file('person.xsl'));
xslt_process($xslstring, $xmlstring, $result);
// output the result
echo $result;
?>
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
XSL FILE:
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<head>
</head>
<body>
<h1>Contact information for <b><xsl:value-of select="me/name"
/></b></h1>
<h2>Mailing address:</h2>
<xsl:value-of select="me/address" />
<h2>Phone:</h2>
<xsl:value-of select="me/tel" />
<h2>Email address:</h2>
<xsl:value-of select="me/email" />
<h2>Web site URL:</h2>
<xsl:value-of select="me/url" />
</body>
</html>
</xsl:template>
</xsl:stylesheet>
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
XML FILE:
<?xml version="1.0"?>
<me>
<name>John Doe</name>
<address>94, Main Street, Nowheresville 16463, XY</address>
<tel>738 2838</tel>
<email>johndoe@xxxxxxxxxxxxxx</email>
<url>http://www.unknown_and_unsung.com/</url>
</me>
Configure options are listed below:
'./configure' '--with-apxs2=/usr/local/apache2/bin/apxs'
'--enable-track-vars' '--with-dom=/usr/local' '--enable-sockets'
'--enable-wddx' '--with-xmlrpc' '--enable-xslt'
'--with-xslt-sablot=/usr/local/' '--with-zlib-dir=/usr/local/include'
'--with-expat-dir=/usr/local' '--with-iconv-dir=/usr/local/'
'--with-mysql=/usr/local/mysql'
Phpinfo reports that all of the modules are installed:
XSLT support enabled
Backend Sablotron
Sablotron Version 1.0.1
Sablotron Information Cflags: -g -O2 Libs: -L/usr/local/lib -liconv
-lexpat Prefix: /usr/local
core library version xmlrpc-epi v. 0.51
php extension version 0.51
author Dan Libby
homepage http://xmlrpc-epi.sourceforge.net
open sourced by Epinions.com
XML Support active
XML Namespace Support active
EXPAT Version expat_1.95.5
DOM/XML enabled
DOM/XML API Version 20020815
libxml Version 20604
HTML Support enabled
XPath Support enabled
XPointer Support enabled
Next Message by Date:
click to view message preview
[PHP-INSTALL] Please help -- postgres DB not connecting
We've been getting the following error when testing our PHP pages that make calls to our postgres database:
Fatal error: Call to undefined function: pg_pconnect() in /var/www/<testpageX>.php on line 14
According to research, it seems as though we failed to compile PHP with postgres support at install time. We used Debian packages to install PHP and don't recall whether compiling with postgres was an option.
- Should we remove PHP and start over with the regular PHP compiler?
- Is there a "Debian way" to install PHP with postgres support?
- Are we totally missing the boat here?
We've diligently searched the PHP installation pages with no forthcoming solution.
Here's our versions:
Kernel 2.4.18-bf2.4
Apache1.3.26-0woo
openssl0.9.6c-2.wo
open ssh3.4p1-1.woo
postgres 7.2.1-2wood
php 4.1.2-6wood
php pear
TIA for any and all assistance.
--
Danny O'Brien
Previous Message by Thread:
click to view message preview
[PHP-INSTALL] mail() sendmail problems
I'm having difficulty with the php mail() function. Freebsd 4.9, apache 2.0.48, php 4.3.4
Here is my code:
<?php
mail("sysadmin@xxxxxxxxxxxxx", "subject", "body");
?>
The problem:
The mail is not being delivered to my address. PHP returns no errors.
The webserver (fenchurch) does not run a mail relay. The nearest mail server is @ IP 216.111.143.7 (allows relaying from webserver). I have added the following line to the sendmail .mc file:
FEATURE(`msp', `[216.111.143.7]')dnl
I then ran 'make install'
Solutions I've tried:
Installing postfix, exim, qmail (with mailwrapper). They all give the same results. Since sendmail is the default, I've decided to scrap the other MTA's and make sendmail work.
Sendmail permissions:
ls -al /usr/sbin/sendmail
lrwxr-xr-x 1 root wheel 24 Feb 20 12:34 /usr/sbin/sendmail -> /usr/local/sbin/sendmail
ls -al /usr/local/sbin/sendmail
-r-xr-sr-x 1 root smmsp 561922 Feb 20 12:32 /usr/local/sbin/sendmail
Info from /var/log/maillog
Feb 23 09:30:00 fenchurch sendmail[75790]: i1NEU0PO075790: from=root, size=500, class=0, nrcpts=1, msgid=<200402231430.i1NEU0PO075790@xxxxxxxxxxxxxxxxxxxxxxx>, relay=root@localhost
Feb 23 09:30:00 fenchurch sendmail[75790]: i1NEU0PO075790: to=root, ctladdr=root (0/0), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30500, relay=[216.111.143.7] [216.111.143.7], dsn=2.0.0, stat=Sent (ok 1077547537 qp 14019)
phpinfo() is available here: http://fenchurch.netlinkip.com/info.php
If anyone has any ideas, please let me know!
Elijah Chancey
sysadmin@xxxxxxxxxxxxx
Next Message by Thread:
click to view message preview
Re: [PHP-INSTALL] mail() sendmail problems
Elijah A. Chancey wrote:
Can a normal user send mail via which means?
e
On Feb 23, 2004, at 11:35 AM, Chris Hewitt wrote:
Elijah A. Chancey wrote:
I'm having difficulty with the php mail() function. Freebsd 4.9,
apache 2.0.48, php 4.3.4
Here is my code:
<?php
mail("sysadmin@xxxxxxxxxxxxx", "subject", "body");
?>
The problem:
The mail is not being delivered to my address. PHP returns no errors.
Can a normal user send email? If so then it is a php problem, if not
a sendmail one. I think that will help to narrow it down a bit.
HTH
Chris
Yes, all users on a unix box should be able to send email. From a prompt:
mail -s "mysubject" toyou@xxxxxxxxxxx <filewithmessage
will do it. Do a "man mail" for more information. It will use whatever
email system you have set up on the computer, thus it is a good test to
see where email may be going wrong. When you have email going from a
normal user OK then its time to check from php again.
HTH
Chris
|
|