php-windows Digest 3 Feb 2011 23:46:18 -0000 Issue 3913

Topics (messages 30493 through 30496):

Re: Problem in sending email from localhost
        30493 by: Niel Archer
        30494 by: Chuck Reeves
        30495 by: Tommy Pham

xsl:include fails after upgrading PHP version; is libxml/libxslt version 
mismatch the issue?
        30496 by: Clark A. Wise

Administrivia:

To subscribe to the digest, e-mail:
        php-windows-digest-subscr...@lists.php.net

To unsubscribe from the digest, e-mail:
        php-windows-digest-unsubscr...@lists.php.net

To post to the list, e-mail:
        php-wind...@lists.php.net


----------------------------------------------------------------------
--- Begin Message ---
> Hi,
> 
>   I am trying to send mail from my localhost but i am getting the below
> error
> ""Warning: mail() [function.mail]: Failed to connect to mailserver at
> "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini
> or use ini_set() in F:\test\xampp\htdocs\sendmail.php on line 42'"
> 
> I am using xampp server. Can anyone please tell me what is the error


Only Server versions have an MTA available, so if you are using XP,
Vista, or 7; for example, then there is no MTA listening on localhost,
hence the error.

See the documentation for mail(), in particular the notes for Windows
specifics, at:
http://www.php.net/manual/en/function.mail.php

However, this is only relevant as your .ini settings seem to be ignored.
Make sure this is in fact the ini file being used. use phpinfo() and
check the used ini path is the same as the one you think should be used.

> My "php.ini" code is
> [mail function]
> ; For Win32 only.
> ; http://php.net/smtp
> SMTP = smtp.gmail.com
> ; http://php.net/smtp-port
> smtp_port = 587

I'm not sure, but I think you may be barking up the wrong tree here.  I
don't know how you can use mail() to authenticate with gmail's smtp
server over TLS, as mail() does not have parameters for username and
password. You might be better trying the PEAR::Mail package


> ; For Win32 only.
> ; http://php.net/sendmail-from
> ;sendmail_from = xxxxx...@gmail.com
> 
> ; For Unix only.  You may supply arguments as well (default:
> "sendmail -t -i").
> ; http://php.net/sendmail-path
> ;sendmail_path = "\"F:\test\xampp\sendmail\sendmail.exe\" -t"
> 
> ; Force the addition of the specified parameters to be passed as
> extra parameters
> ; to the sendmail binary. These parameters will always replace the value of
> ; the 5th parameter to mail(), even in safe mode.
> ;mail.force_extra_parameters =
> 
> ; Add X-PHP-Originating-Script: that will include
> uid of the script followed by the filename
> mail.add_x_header = Off
> 
> ; Log all mail() calls including the full path of the script, line
> #, to address and headers
> ;mail.log = "F:\test\xampp\apache\logs\php_mail.log"

--
Niel Archer



--- End Message ---
--- Begin Message ---
Check with your isp to see if they block smtp traffic. Most of the tme they
require you to use there smtp in an effort to thwart spammers

Thank You
Chuck Reeves
www.manchuck.com



On Thu, Feb 3, 2011 at 12:13 AM, Niel Archer <n...@chance.now> wrote:

> > Hi,
> >
> >   I am trying to send mail from my localhost but i am getting the below
> > error
> > ""Warning: mail() [function.mail]: Failed to connect to mailserver at
> > "localhost" port 25, verify your "SMTP" and "smtp_port" setting in
> php.ini
> > or use ini_set() in F:\test\xampp\htdocs\sendmail.php on line 42'"
> >
> > I am using xampp server. Can anyone please tell me what is the error
>
>
> Only Server versions have an MTA available, so if you are using XP,
> Vista, or 7; for example, then there is no MTA listening on localhost,
> hence the error.
>
> See the documentation for mail(), in particular the notes for Windows
> specifics, at:
> http://www.php.net/manual/en/function.mail.php
>
> However, this is only relevant as your .ini settings seem to be ignored.
> Make sure this is in fact the ini file being used. use phpinfo() and
> check the used ini path is the same as the one you think should be used.
>
> > My "php.ini" code is
> > [mail function]
> > ; For Win32 only.
> > ; http://php.net/smtp
> > SMTP = smtp.gmail.com
> > ; http://php.net/smtp-port
> > smtp_port = 587
>
> I'm not sure, but I think you may be barking up the wrong tree here.  I
> don't know how you can use mail() to authenticate with gmail's smtp
> server over TLS, as mail() does not have parameters for username and
> password. You might be better trying the PEAR::Mail package
>
>
> > ; For Win32 only.
> > ; http://php.net/sendmail-from
> > ;sendmail_from = xxxxx...@gmail.com
> >
> > ; For Unix only.  You may supply arguments as well (default:
> > "sendmail -t -i").
> > ; http://php.net/sendmail-path
> > ;sendmail_path = "\"F:\test\xampp\sendmail\sendmail.exe\" -t"
> >
> > ; Force the addition of the specified parameters to be passed as
> > extra parameters
> > ; to the sendmail binary. These parameters will always replace the value
> of
> > ; the 5th parameter to mail(), even in safe mode.
> > ;mail.force_extra_parameters =
> >
> > ; Add X-PHP-Originating-Script: that will include
> > uid of the script followed by the filename
> > mail.add_x_header = Off
> >
> > ; Log all mail() calls including the full path of the script, line
> > #, to address and headers
> > ;mail.log = "F:\test\xampp\apache\logs\php_mail.log"
>
> --
> Niel Archer
>
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--- End Message ---
--- Begin Message ---
1)  Which SMTP server are you trying to use?  On your local system? Or
smtp.gmail.com?
2a) If local system, which are are using?  MS' SMTP or 3rd party like hmail?
Are you sure the server is configured properly and that the service is
running?  Run this in command prompt:  

netstat -ano | more

You should see something like this:

Proto  Local Address          Foreign Address        State           PID
 TCP    0.0.0.0:25             0.0.0.0:0              LISTENING       2744

If not, then that's your problem.  You don't have a SMTP server/service
running.  Notice that last number.  If you're running MS' SMTP, in the
taskmanager, it should match up with the process inetinfo.exe.  If you're
using 3rd party, it should match up with their executable.  In the case of
hmail, it should be hmailserver.exe.

2b)  If you're using gmail's, from the same system that your PHP code
resides on, are you able able to connect to the gmail's SMTP using Outlook
Express to check the validity of the account and no misconfigured
firewalls/routers (both hardware and software)?

3)  Run phpinfo();  and check "Loaded Configuration File" to ensure that
it's loading the right php.ini file.  Sometimes you think it loads the right
one but it doesn't.  Don't assume.  Verify.  Then either scroll down or
CTRL+F and look for 'SMTP'.  It should be as you configured it, that is if
it loads the php.ini file from the correct location.

FYI,  I suggest you stay away from non official packaged distributions as
those tend to put things in places you'll least expect.  Getting the
official distribution is strongly advised.  It may take you longer to
understand and get things going.  But in the long run, that knowledge can
further aid you as you can fine tune the configurations to your specific
needs and also helps with the troubleshooting of various errors like the one
you're having now.  Furthermore, should the need arise when you have to
upgrade for any reason, you don't have to rely on non official distribution
as sometimes those won't be updated quickly enough, especially when there's
a security bug fix release.

Regards,
Tommy


--- End Message ---
--- Begin Message ---
I'm running Windows XP with the precompiled PHP binaries available
from windows.php.net. I upgraded from PHP 5.2.5 to PHP 5.2.16, and now
the <xsl:include>s in some of my stylesheets stopped working. Testing
each version in succession, I discovered that it worked up through
5.2.8 and does not work in 5.2.9+. I now get the following three
errors for each <xsl:include>.

Warning: XSLTProcessor::importStylesheet()
[xsltprocessor.importstylesheet]: I/O warning : failed to load
external entity "file%3A/C%3A/path/to/included/stylesheet.xsl" in ...
on line 227

Warning: XSLTProcessor::importStylesheet()
[xsltprocessor.importstylesheet]: compilation error: file
file%3A//C%3A/path/to/included/stylesheet.xsl line 36 element include
in ... on line 227

Warning: XSLTProcessor::importStylesheet()
[xsltprocessor.importstylesheet]: xsl:include : unable to load
file%3A/C%3A/path/to/included/stylesheet.xsl in ... on line 227

I presume this is because it cannot find the specified file. Many of
the includes are in the same directory as the stylesheet being
transformed and have no directory in the path, i.e. <xsl:include
href="fileInSameDir.xsl">. Interestingly, in the first and third
errors, it is displaying the file:// protocol with only one slash
instead of the correct two. I'm guessing that's the problem. (When I
hard-code a full path using "file:/" it fails, but when I hard-code a
full path with "file://" it works.) But what could cause that? A bug
in libxslt/libxml? I also found an apparent version mismatch between
libxml and the version of libxml that libxslt was compiled against.

    5.2.5
    libxml Version => 2.6.26
    libxslt compiled against libxml Version => 2.6.26

    5.2.8

    libxml Version => 2.6.32
    libxslt compiled against libxml Version => 2.6.32

    === it breaks in versions starting at 5.2.9 ===
    5.2.9
    libxml Version => 2.7.3
    libxslt compiled against libxml Version => 2.6.32

    5.2.16
    libxml Version => 2.7.7
    libxslt compiled against libxml Version => 2.6.32

Up until PHP 5.2.9, libxslt was compiled against the same version of
libxml that was included with PHP. But starting with PHP 5.2.9,
libxslt was compiled against an older version of libxml than that
which was included with PHP. Is this a problem with the distributed
binaries or just a coincidence?

To test this, I imagine PHP could be built with different versions of
libxml/libxslt to see which combinations work or don't. Unfortunately,
I'm out of my element in a Windows world, and building PHP on Windows
seems over my head.

Regrettably, I've been thus far unable to reproduce this problem with
an example outside my app, so I'm struggling to narrow it down and
can't submit a specific bug.

So, do you think it is caused by

    * a version mismatch problem in the distributed binaries?
    * a bug introduced in PHP 5.2.9?
    * a bug introduced in libxml 2.7?
    * something else?

I'm stumped. Any thoughts that could point me in the right direction
are greatly appreciated.

Thanks,
Clark A. Wise

--- End Message ---

Reply via email to