system() just does nothing

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Adrian Stutz [anime_layer]

    system() just does nothing

    Hello,

    I try to do a mysql backup using mysqldump. I've written a php script that
    uses system() to execute mysqldump. I have two unix servers and the script
    runs fine on the frist one but fails without any error on the second server. I
    have following script to test it:
    ----------------------------------
    <?php
    print system ('/usr/bin/mysqldump --opt -u user -ppassword database 2>
    /home/user/public_html/backup/error.txt | gzip >
    /home/user/public_html/backup/bck120404.sql.g z');
    ?>
    ----------------------------------
    This script doesn't return anything. No error.txt and no bck120404.sql.g z are
    written. It's a unix server and register_global s is off. All directories
    should be fine and "print system ('ls');" runs ok. I also tried exec(),
    passthru() and shell_exec().
    Any idea what I'm overlooking?

    Thanks,
    Adrian

    --
    Sou desu-ka? O_o -_- x_x _
    http://www.animelayer.net/ (Reviewdatenban k)

  • Chris Hope

    #2
    Re: system() just does nothing

    Adrian Stutz [anime_layer] wrote:
    [color=blue]
    > I try to do a mysql backup using mysqldump. I've written a php script that
    > uses system() to execute mysqldump. I have two unix servers and the script
    > runs fine on the frist one but fails without any error on the second
    > server. I have following script to test it:[/color]

    <snip>

    Try turning more error reporting levels on with the error_reporting ()
    http://www.php.net/error_reporting and see if it then gives you an error.

    eg error_reporting (E_ERROR | E_WARNING | E_PARSE | E_NOTICE)

    Chris

    --
    Chris Hope
    The Electric Toolbox Ltd

    Comment

    • Adrian Stutz [anime_layer]

      #3
      Re: system() just does nothing

      Right, forgot that. Tried to set it to E_ALL and what you proposed and I still
      get no error. :(

      Thanks,
      Adrian

      Chris Hope <blackhole@elec trictoolbox.com > wrote:[color=blue]
      >Try turning more error reporting levels on with the error_reporting ()
      >http://www.php.net/error_reporting and see if it then gives you an error.
      >
      >eg error_reporting (E_ERROR | E_WARNING | E_PARSE | E_NOTICE)
      >
      >Chris[/color]

      --
      Sou desu-ka? O_o -_- x_x _
      http://www.animelayer.net/ (Reviewdatenban k)

      Comment

      • Jan Pieter Kunst

        #4
        Re: system() just does nothing

        In article <c5dirt$u3i$1@n ewshispeed.ch>,
        anime_layer@j-kult.net (Adrian Stutz [anime_layer]) wrote:
        [color=blue]
        > Right, forgot that. Tried to set it to E_ALL and what you proposed and I still
        > get no error. :([/color]

        Did you check if the command works if you enter it manually on the
        command line?

        JP

        --
        Sorry, <devnull@cauce. org> is een "spam trap".
        E-mail adres is <jpk"at"akamail .com>, waarbij "at" = @.

        Comment

        • Adrian Stutz [anime_layer]

          #5
          Re: system() just does nothing

          Jan Pieter Kunst <devnull@cauce. org> wrote:[color=blue]
          >Did you check if the command works if you enter it manually on the
          >command line?[/color]

          Yes. Works perfectly fine.

          --
          Sou desu-ka? O_o -_- x_x _
          http://www.animelayer.net/ (Reviewdatenban k)

          Comment

          • Pertti Kosunen

            #6
            Re: system() just does nothing

            "Adrian Stutz [anime_layer]" <anime_layer@ j-kult.net> wrote in message
            news:c5doqv$5hc $1@newshispeed. ch...[color=blue]
            > Yes. Works perfectly fine.[/color]

            Root or normal user?


            Comment

            • Adrian Stutz [anime_layer]

              #7
              Re: system() just does nothing

              "Pertti Kosunen" <pertti.kosunen @kolumb.us.fi_i nvalid> wrote:[color=blue]
              >Root or normal user?[/color]

              I don't have root access to the server. Normal user.

              Hmm... I just noticed that they aren't two seperate server but ony two
              seperate accounts on the same server. Setup should be exactly the same (Unix,
              Apache 1.3.29, PHP 4.3.3). As mentioned, the script runs fine on one account
              but after I copy it to the other account and change the path and mysql
              settings it won't work anymore.

              Ja ne
              Adrian

              --
              Sou desu-ka? O_o -_- x_x _
              http://www.animelayer.net/ (Reviewdatenban k)

              Comment

              • Adrian Stutz [anime_layer]

                #8
                Re: system() just does nothing

                *doh* I'm stupid.
                The permissions for the directory weren't set correctly. PHP runs as another
                user and couldn't write to the dir. Since I was directing the error output
                there it couldn't write the error.txt (bit unpractical, though).
                Works fine now. Thanks to everyone for the help.

                Ja ne
                Adrian

                --
                Sou desu-ka? O_o -_- x_x _
                http://www.animelayer.net/ (Reviewdatenban k)

                Comment

                Working...