Loading ...
Sorry, an error occurred while loading the content.
 

Please, System calls in PHP Apache

Expand Messages
  • Johnny Karlsen
    I have to try to get some attention again on this one since I am at the end of the road. Am I really the only one having this problem? Please, if you could try
    Message 1 of 9 , Jul 14, 2005
      I have to try to get some attention again on this one since I am at the end of the road. Am I really the only one having this problem? Please, if you could try and see what you experience, I would really apreciate it.


      I have a problem with PHP together with Apache. Trying to run .php
      scripts which include exec, system or passthru will without exception
      cause Apache to hang. Running the same script from the shell gives the
      right output. Safe mode is not on in PHP. Are there any other security
      settings in Apache to allow exec, system,.... I am using Unslung 5,
      php 5.0.4-1, apache 2.0.54-2.

      Try for example

      <?php exec('/opt/bin/whoami',$res);
      var_dump($res); ?>

      Is this reproduceable or can someone indicate where to start looking.
      Otherwise all php scripts run nicely!

      Thanks

      [Non-text portions of this message have been removed]
    • nslu2newb
      I am confronting the same issue as described below. I can t seem to run .php scripts which includ exec, system or passthru without hanging up Apache. I get a
      Message 2 of 9 , Nov 5, 2005
        I am confronting the same issue as described below. I can't seem to
        run .php scripts which includ exec, system or passthru without hanging
        up Apache. I get a zombie process spawned. Is this a known bug, or
        did someone reply to the below query and I just can't find it. Thanks!

        --- In nslu2-general@yahoogroups.com, "Johnny Karlsen" <johnny@k...>
        wrote:
        >
        > I have to try to get some attention again on this one since I am at
        the end of the road. Am I really the only one having this problem?
        Please, if you could try and see what you experience, I would really
        apreciate it.
        >
        >
        > I have a problem with PHP together with Apache. Trying to run .php
        > scripts which include exec, system or passthru will without exception
        > cause Apache to hang. Running the same script from the shell gives the
        > right output. Safe mode is not on in PHP. Are there any other security
        > settings in Apache to allow exec, system,.... I am using Unslung 5,
        > php 5.0.4-1, apache 2.0.54-2.
        >
        > Try for example
        >
        > <?php exec('/opt/bin/whoami',$res);
        > var_dump($res); ?>
        >
        > Is this reproduceable or can someone indicate where to start looking.
        > Otherwise all php scripts run nicely!
        >
        > Thanks
        >
        > [Non-text portions of this message have been removed]
        >
      • nslu2newb
        I am confronting the same issue as described below. I can t seem to run .php scripts which includ exec, system or passthru without hanging up Apache. I get a
        Message 3 of 9 , Nov 5, 2005
          I am confronting the same issue as described below. I can't seem to
          run .php scripts which includ exec, system or passthru without hanging
          up Apache. I get a zombie process spawned. Is this a known bug, or
          did someone reply to the below query and I just can't find it. Thanks!

          --- In nslu2-general@yahoogroups.com, "Johnny Karlsen" <johnny@k...>
          wrote:
          >
          > I have to try to get some attention again on this one since I am at
          the end of the road. Am I really the only one having this problem?
          Please, if you could try and see what you experience, I would really
          apreciate it.
          >
          >
          > I have a problem with PHP together with Apache. Trying to run .php
          > scripts which include exec, system or passthru will without exception
          > cause Apache to hang. Running the same script from the shell gives the
          > right output. Safe mode is not on in PHP. Are there any other security
          > settings in Apache to allow exec, system,.... I am using Unslung 5,
          > php 5.0.4-1, apache 2.0.54-2.
          >
          > Try for example
          >
          > <?php exec('/opt/bin/whoami',$res);
          > var_dump($res); ?>
          >
          > Is this reproduceable or can someone indicate where to start looking.
          > Otherwise all php scripts run nicely!
          >
          > Thanks
          >
          > [Non-text portions of this message have been removed]
          >
        • Johnny Karlsen
          It is in the bug list, 195 and some others I think. Don t know if anyone is working on it though! /Johnny
          Message 4 of 9 , Nov 5, 2005
            It is in the bug list, 195 and some others I think. Don't know if anyone
            is working on it though!

            /Johnny

            nslu2newb wrote:

            >I am confronting the same issue as described below. I can't seem to
            >run .php scripts which includ exec, system or passthru without hanging
            >up Apache. I get a zombie process spawned. Is this a known bug, or
            >did someone reply to the below query and I just can't find it. Thanks!
            >
            >--- In nslu2-general@yahoogroups.com, "Johnny Karlsen" <johnny@k...>
            >wrote:
            >
            >
            >>I have to try to get some attention again on this one since I am at
            >>
            >>
            >the end of the road. Am I really the only one having this problem?
            >Please, if you could try and see what you experience, I would really
            >apreciate it.
            >
            >
            >>I have a problem with PHP together with Apache. Trying to run .php
            >>scripts which include exec, system or passthru will without exception
            >>cause Apache to hang. Running the same script from the shell gives the
            >>right output. Safe mode is not on in PHP. Are there any other security
            >>settings in Apache to allow exec, system,.... I am using Unslung 5,
            >>php 5.0.4-1, apache 2.0.54-2.
            >>
            >>Try for example
            >>
            >><?php exec('/opt/bin/whoami',$res);
            >>var_dump($res); ?>
            >>
            >>Is this reproduceable or can someone indicate where to start looking.
            >>Otherwise all php scripts run nicely!
            >>
            >>Thanks
            >>
            >>[Non-text portions of this message have been removed]
            >>
            >>
            >>
            >
            >
            >
            >
            >
            >
            >
            >
            >Yahoo! Groups Links
            >
            >
            >
            >
            >
            >
            >
          • Tim Bishop
            I ve run into the bug repeatedly, notably in the case of calls to the mail() function, but as far as I know there hasn t been any work on the bug since this
            Message 5 of 9 , Nov 5, 2005
              I've run into the bug repeatedly, notably in the case of calls to the
              mail() function, but as far as I know there hasn't been any work on the
              bug since this summer.

              I wish I had the skills to try and fix the bug, but I don't.

              sorry,

              Tim

              Johnny Karlsen wrote:
              > It is in the bug list, 195 and some others I think. Don't know if anyone
              > is working on it though!
              >
              > /Johnny
              >
              > nslu2newb wrote:
              >
              >
              >>I am confronting the same issue as described below. I can't seem to
              >>run .php scripts which includ exec, system or passthru without hanging
              >>up Apache. I get a zombie process spawned. Is this a known bug, or
              >>did someone reply to the below query and I just can't find it. Thanks!
              >>
              >>--- In nslu2-general@yahoogroups.com, "Johnny Karlsen" <johnny@k...>
              >>wrote:
              >>
              >>
              >>
              >>>I have to try to get some attention again on this one since I am at
              >>>
              >>>
              >>
              >>the end of the road. Am I really the only one having this problem?
              >>Please, if you could try and see what you experience, I would really
              >>apreciate it.
              >>
              >>
              >>
              >>>I have a problem with PHP together with Apache. Trying to run .php
              >>>scripts which include exec, system or passthru will without exception
              >>>cause Apache to hang. Running the same script from the shell gives the
              >>>right output. Safe mode is not on in PHP. Are there any other security
              >>>settings in Apache to allow exec, system,.... I am using Unslung 5,
              >>>php 5.0.4-1, apache 2.0.54-2.
              >>>
              >>>Try for example
              >>>
              >>><?php exec('/opt/bin/whoami',$res);
              >>>var_dump($res); ?>
              >>>
              >>>Is this reproduceable or can someone indicate where to start looking.
              >>>Otherwise all php scripts run nicely!
              >>>
              >>>Thanks
              >>>
              >>>[Non-text portions of this message have been removed]
              >>>
              >>>
              >>>
              >>
              >>
              >>
              >>
              >>
              >>
              >>
              >>
              >>Yahoo! Groups Links
              >>
              >>
              >>
              >>
              >>
              >>
              >>
              >
              >
              >
              >
              >
              >
              > Yahoo! Groups Links
              >
              >
              >
              >
              >
              >
            • nslu2newb
              OK. Thanks for your replies. I too am at a loss at how to fix the PHP system call problem. Similiarly I was trying to use exec, system, passthru, mail etc
              Message 6 of 9 , Nov 6, 2005
                OK. Thanks for your replies. I too am at a loss at how to fix the
                PHP system call problem.

                Similiarly I was trying to use exec, system, passthru, mail etc so I
                could automatically have an e-mail sent when an event occurs within in
                my PHP script. (My application forces me to use PHP so trying CGI,
                etc is out of the question.) Has anyone figured out any work
                around to this problem in order to be able to send mail from within an
                apache-PHP script?

                I was thinking, for example, of creating some sort of mail daemon that
                I had runnning in the background on my NSLU looking for certain files
                created by my PHP script...then if it saw them it would read their
                header and use this to smptclient mail the content it to its
                destination. I have never done something like this before, so was
                wondering if I might be missing a more elegant work-around? I have no
                problem creating files in PHP...just figuring out a way to have them
                automatically e-mailed since all of the commands I can think of in PHP
                cause Apache to hang. Thoughts or comments would be much appreciated.

                - NewB

                --- In nslu2-general@yahoogroups.com, Tim Bishop <geodog@c...> wrote:
                >
                > I've run into the bug repeatedly, notably in the case of calls to the
                > mail() function, but as far as I know there hasn't been any work on the
                > bug since this summer.
                >
                > I wish I had the skills to try and fix the bug, but I don't.
                >
                > sorry,
                >
                > Tim
                >
                > Johnny Karlsen wrote:
                > > It is in the bug list, 195 and some others I think. Don't know if
                anyone
                > > is working on it though!
                > >
                > > /Johnny
                > >
                > > nslu2newb wrote:
                > >
                > >
                > >>I am confronting the same issue as described below. I can't seem to
                > >>run .php scripts which includ exec, system or passthru without hanging
                > >>up Apache. I get a zombie process spawned. Is this a known bug, or
                > >>did someone reply to the below query and I just can't find it.
                Thanks!
                > >>
                > >>--- In nslu2-general@yahoogroups.com, "Johnny Karlsen" <johnny@k...>
                > >>wrote:
                > >>
                > >>
                > >>
                > >>>I have to try to get some attention again on this one since I am at
                > >>>
                > >>>
                > >>
                > >>the end of the road. Am I really the only one having this problem?
                > >>Please, if you could try and see what you experience, I would really
                > >>apreciate it.
                > >>
                > >>
                > >>
                > >>>I have a problem with PHP together with Apache. Trying to run .php
                > >>>scripts which include exec, system or passthru will without
                exception
                > >>>cause Apache to hang. Running the same script from the shell
                gives the
                > >>>right output. Safe mode is not on in PHP. Are there any other
                security
                > >>>settings in Apache to allow exec, system,.... I am using Unslung 5,
                > >>>php 5.0.4-1, apache 2.0.54-2.
                > >>>
                > >>>Try for example
                > >>>
                > >>><?php exec('/opt/bin/whoami',$res);
                > >>>var_dump($res); ?>
                > >>>
                > >>>Is this reproduceable or can someone indicate where to start
                looking.
                > >>>Otherwise all php scripts run nicely!
                > >>>
                > >>>Thanks
                > >>>
                > >>>[Non-text portions of this message have been removed]
                > >>>
                > >>>
                > >>>
                > >>
                > >>
                > >>
                > >>
                > >>
                > >>
                > >>
                > >>
                > >>Yahoo! Groups Links
                > >>
                > >>
                > >>
                > >>
                > >>
                > >>
                > >>
                > >
                > >
                > >
                > >
                > >
                > >
                > > Yahoo! Groups Links
                > >
                > >
                > >
                > >
                > >
                > >
                >
              • nslu2-general03@fixit.nospammail.net
                What about running an SMTP daemon (or using an external one)? That is already written and is all about sending email. If you can open a network socket to it
                Message 7 of 9 , Nov 6, 2005
                  What about running an SMTP daemon (or using an external one)? That is
                  already written and is all about sending email. If you can open a
                  network socket to it and speak SMTP, you can send email. SMTP isn't
                  very hard. It basically consists of...

                  HELO mydomain.net
                  MAIL FROM: <me@...>
                  RCPT TO: <them@...>
                  DATA
                  From: My Name <me@...>
                  To: Their Name <them@...>
                  Subject: Mail from my PHP script

                  The blank line above seperates the message from the header.
                  This is the message.
                  The message is terminated by a line with just a period in it.
                  .
                  QUIT

                  I'm going off of memory for the above, but it is basically like that.
                  If you don't care about server responses, you can just print that stuff
                  blindly to the server and wait for the connection to close. If there is
                  a PHP module that does the same thing, that would probably be even
                  easier.

                  If you have sendmail, postfix, exim, etc., then you already have an SMTP
                  daemon. I think that if the sender and receiver are local to the
                  domain that the SMTP server serves, you can leave of the
                  @... parts of the addresses, and they will default to the domain
                  of the SMTP server.


                  On Sun, Nov 06, 2005 at 01:21:52PM -0000, nslu2newb wrote:
                  > OK. Thanks for your replies. I too am at a loss at how to fix the
                  > PHP system call problem.
                  >
                  > Similiarly I was trying to use exec, system, passthru, mail etc so I
                  > could automatically have an e-mail sent when an event occurs within in
                  > my PHP script. (My application forces me to use PHP so trying CGI,
                  > etc is out of the question.) Has anyone figured out any work
                  > around to this problem in order to be able to send mail from within an
                  > apache-PHP script?
                  >
                  > I was thinking, for example, of creating some sort of mail daemon that
                  > I had runnning in the background on my NSLU looking for certain files
                  > created by my PHP script...then if it saw them it would read their
                  > header and use this to smptclient mail the content it to its
                  > destination. I have never done something like this before, so was
                  > wondering if I might be missing a more elegant work-around? I have no
                  > problem creating files in PHP...just figuring out a way to have them
                  > automatically e-mailed since all of the commands I can think of in PHP
                  > cause Apache to hang. Thoughts or comments would be much appreciated.
                  >
                  > - NewB
                • Tim Bishop
                  I posted last week on this list about a workaround using phpmailer and and an external smtp server. Works for me. Search for Workaround in the subject.
                  Message 8 of 9 , Nov 7, 2005
                    I posted last week on this list about a workaround using phpmailer and
                    and an external smtp server. Works for me. Search for "Workaround" in
                    the subject.

                    Thanks,
                    Tim

                    nslu2-general03@... wrote:
                    > What about running an SMTP daemon (or using an external one)? That is
                    > already written and is all about sending email. If you can open a
                    > network socket to it and speak SMTP, you can send email. SMTP isn't
                    > very hard. It basically consists of...
                    >
                    > HELO mydomain.net
                    > MAIL FROM: <me@...>
                    > RCPT TO: <them@...>
                    > DATA
                    > From: My Name <me@...>
                    > To: Their Name <them@...>
                    > Subject: Mail from my PHP script
                    >
                    > The blank line above seperates the message from the header.
                    > This is the message.
                    > The message is terminated by a line with just a period in it.
                    > .
                    > QUIT
                    >
                    > I'm going off of memory for the above, but it is basically like that.
                    > If you don't care about server responses, you can just print that stuff
                    > blindly to the server and wait for the connection to close. If there is
                    > a PHP module that does the same thing, that would probably be even
                    > easier.
                    >
                    > If you have sendmail, postfix, exim, etc., then you already have an SMTP
                    > daemon. I think that if the sender and receiver are local to the
                    > domain that the SMTP server serves, you can leave of the
                    > @... parts of the addresses, and they will default to the domain
                    > of the SMTP server.
                    >
                    >
                    > On Sun, Nov 06, 2005 at 01:21:52PM -0000, nslu2newb wrote:
                    >
                    >>OK. Thanks for your replies. I too am at a loss at how to fix the
                    >>PHP system call problem.
                    >>
                    >>Similiarly I was trying to use exec, system, passthru, mail etc so I
                    >>could automatically have an e-mail sent when an event occurs within in
                    >>my PHP script. (My application forces me to use PHP so trying CGI,
                    >>etc is out of the question.) Has anyone figured out any work
                    >>around to this problem in order to be able to send mail from within an
                    >>apache-PHP script?
                    >>
                    >>I was thinking, for example, of creating some sort of mail daemon that
                    >>I had runnning in the background on my NSLU looking for certain files
                    >>created by my PHP script...then if it saw them it would read their
                    >>header and use this to smptclient mail the content it to its
                    >>destination. I have never done something like this before, so was
                    >>wondering if I might be missing a more elegant work-around? I have no
                    >>problem creating files in PHP...just figuring out a way to have them
                    >>automatically e-mailed since all of the commands I can think of in PHP
                    >>cause Apache to hang. Thoughts or comments would be much appreciated.
                    >>
                    >>- NewB
                    >
                    >
                    >
                    >
                    >
                    > Yahoo! Groups Links
                    >
                    >
                    >
                    >
                    >
                    >
                    >
                  • nslu2newb
                    Tim, Workaround using phpmailer worked great for me! It also gave me some functionality I wasn t expecting (e.g. ability to send attachments). I m so happy
                    Message 9 of 9 , Nov 8, 2005
                      Tim,

                      Workaround using phpmailer worked great for me! It also gave me some
                      functionality I wasn't expecting (e.g. ability to send attachments).
                      I'm so happy right now (after banging my head against the wall for a
                      week). I appreciate your and others on the board help. Let me know
                      if you'd like any assistance adding the workaround to the wiki if you
                      think this will help others. Thanks again!

                      - NewB

                      --- In nslu2-general@yahoogroups.com, Tim Bishop <geodog@c...> wrote:
                      >
                      > I posted last week on this list about a workaround using phpmailer and
                      > and an external smtp server. Works for me. Search for "Workaround" in
                      > the subject.
                      >
                      > Thanks,
                      > Tim
                      >
                      > nslu2-general03@f... wrote:
                      > > What about running an SMTP daemon (or using an external one)? That is
                      > > already written and is all about sending email. If you can open a
                      > > network socket to it and speak SMTP, you can send email. SMTP isn't
                      > > very hard. It basically consists of...
                      > >
                      > > HELO mydomain.net
                      > > MAIL FROM: <me@m...>
                      > > RCPT TO: <them@t...>
                      > > DATA
                      > > From: My Name <me@m...>
                      > > To: Their Name <them@t...>
                      > > Subject: Mail from my PHP script
                      > >
                      > > The blank line above seperates the message from the header.
                      > > This is the message.
                      > > The message is terminated by a line with just a period in it.
                      > > .
                      > > QUIT
                      > >
                      > > I'm going off of memory for the above, but it is basically like that.
                      > > If you don't care about server responses, you can just print that
                      stuff
                      > > blindly to the server and wait for the connection to close. If
                      there is
                      > > a PHP module that does the same thing, that would probably be even
                      > > easier.
                      > >
                      > > If you have sendmail, postfix, exim, etc., then you already have
                      an SMTP
                      > > daemon. I think that if the sender and receiver are local to the
                      > > domain that the SMTP server serves, you can leave of the
                      > > @... parts of the addresses, and they will default to the
                      domain
                      > > of the SMTP server.
                      > >
                      > >
                      > > On Sun, Nov 06, 2005 at 01:21:52PM -0000, nslu2newb wrote:
                      > >
                      > >>OK. Thanks for your replies. I too am at a loss at how to fix the
                      > >>PHP system call problem.
                      > >>
                      > >>Similiarly I was trying to use exec, system, passthru, mail etc so I
                      > >>could automatically have an e-mail sent when an event occurs within in
                      > >>my PHP script. (My application forces me to use PHP so trying CGI,
                      > >>etc is out of the question.) Has anyone figured out any work
                      > >>around to this problem in order to be able to send mail from within an
                      > >>apache-PHP script?
                      > >>
                      > >>I was thinking, for example, of creating some sort of mail daemon that
                      > >>I had runnning in the background on my NSLU looking for certain files
                      > >>created by my PHP script...then if it saw them it would read their
                      > >>header and use this to smptclient mail the content it to its
                      > >>destination. I have never done something like this before, so was
                      > >>wondering if I might be missing a more elegant work-around? I have no
                      > >>problem creating files in PHP...just figuring out a way to have them
                      > >>automatically e-mailed since all of the commands I can think of in PHP
                      > >>cause Apache to hang. Thoughts or comments would be much appreciated.
                      > >>
                      > >>- NewB
                      > >
                      > >
                      > >
                      > >
                      > >
                      > > Yahoo! Groups Links
                      > >
                      > >
                      > >
                      > >
                      > >
                      > >
                      > >
                      >
                    Your message has been successfully submitted and would be delivered to recipients shortly.