php, sendmail, works only from command line

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • CoralineSage

    php, sendmail, works only from command line

    hello all,

    Ok, I have another instance of php only working from a command line (i
    refer to an early post of mine).

    I run a very simple script to send email:

    <?php
    print mail ('test@anyemail .com',
    'No need for reply -- PHP test!', /* subject */
    "hi John\nLine 2\n"); /* body */
    ?>

    I get a 1 message as a result, which means that the php worked, but I
    get no email + no mail log entries...i.e. no trace of the email at
    all.

    If I run the php from the command line the email gets sent, delivered
    and received fine to local users and non-local users.

    Any suggestions?

    Any help would be greatly appreciated.

    sincerely

    CoralineSage
  • Pedro Graca

    #2
    Re: php, sendmail, works only from command line

    CoralineSage wrote:[color=blue]
    > Ok, I have another instance of php only working from a command line (i
    > refer to an early post of mine).[/color]

    Do you mean news:9d066669.0 402111128.3e846 cfc@posting.goo gle.com ?
    [color=blue]
    > I run a very simple script to send email:
    >
    > <?php
    > print mail ('test@anyemail .com',
    > 'No need for reply -- PHP test!', /* subject */
    > "hi John\nLine 2\n"); /* body */
    > ?>
    >
    > I get a 1 message as a result, which means that the php worked, but I
    > get no email + no mail log entries...i.e. no trace of the email at
    > all.
    >
    > If I run the php from the command line the email gets sent, delivered
    > and received fine to local users and non-local users.
    >
    > Any suggestions?[/color]

    Is the configuration for command line and web server php the same?

    compare the browser result of phpinfo() with its command line version:
    php -i


    HTH
    --
    --= my mail box only accepts =--
    --= Content-Type: text/plain =--
    --= Size below 10001 bytes =--

    Comment

    • B. Johannessen

      #3
      Re: php, sendmail, works only from command line

      -----BEGIN PGP SIGNED MESSAGE-----
      Hash: SHA1

      CoralineSage wrote:[color=blue]
      > If I run the php from the command line the email gets sent, delivered
      > and received fine to local users and non-local users.
      >
      > Any suggestions?[/color]

      Check with the server admin that the user the webserver is
      running under is allowed to queue mail...


      Bob

      - --
      | B. Johannessen <bob@db.org> +47 97 15 20 09 - http://db.org/
      | Mail & Spam - News, Drafts & Standards - http://db.org/blog/
      | On The Origin Of Spam; Spam Statistics - http://db.org/spam/
      - --
      -----BEGIN PGP SIGNATURE-----

      iD8DBQFANEZ9ooi sUyMOFlgRAh+nAJ 9pkF+y7+RpY2lp8 KT5BgSIO6pFRACg i7MA
      Ou/8Tsx6yLRcCgEHc4 SJv/o=
      =s4sV
      -----END PGP SIGNATURE-----

      Comment

      • CoralineSage

        #4
        Re: php, sendmail, works only from command line

        Guess what it was? I had to re-compile PHP at some point and it added
        an extra "LoadModule php" directive in my httpd.conf and that was
        causing the problem. Everytime I would restart the server it would
        "warn" me that the module was already loaded so it would ignore the
        instruction...I had planned to look into it to delete the extra line,
        but since it said it was ignoring it I figure I could wait 'till
        later.

        Anyway, after I removed the extra loadmodule it worked great.

        Thanks to both of you for replying! Your time is much appreciated.

        Sincerely,
        Chrys Li

        "B. Johannessen" <bob@db.org> wrote in message news:<1EXYb.505 4$rj4.70438@new s2.e.nsc.no>...[color=blue]
        > -----BEGIN PGP SIGNED MESSAGE-----
        > Hash: SHA1
        >
        > CoralineSage wrote:[color=green]
        > > If I run the php from the command line the email gets sent, delivered
        > > and received fine to local users and non-local users.
        > >
        > > Any suggestions?[/color]
        >
        > Check with the server admin that the user the webserver is
        > running under is allowed to queue mail...
        >
        >
        > Bob
        >
        > - --
        > | B. Johannessen <bob@db.org> +47 97 15 20 09 - http://db.org/
        > | Mail & Spam - News, Drafts & Standards - http://db.org/blog/
        > | On The Origin Of Spam; Spam Statistics - http://db.org/spam/
        > - --
        > -----BEGIN PGP SIGNATURE-----
        >
        > iD8DBQFANEZ9ooi sUyMOFlgRAh+nAJ 9pkF+y7+RpY2lp8 KT5BgSIO6pFRACg i7MA
        > Ou/8Tsx6yLRcCgEHc4 SJv/o=
        > =s4sV
        > -----END PGP SIGNATURE-----[/color]

        Comment

        Working...