By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,636 Members | 2,334 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,636 IT Pros & Developers. It's quick & easy.

system() just does nothing

P: n/a
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.gz');
?>
----------------------------------
This script doesn't return anything. No error.txt and no bck120404.sql.gz are
written. It's a unix server and register_globals 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/ (Reviewdatenbank)

Jul 17 '05 #1
Share this Question
Share on Google+
7 Replies


P: n/a
Adrian Stutz [anime_layer] wrote:
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:


<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
http://www.electrictoolbox.com/
Jul 17 '05 #2

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

Thanks,
Adrian

Chris Hope <bl*******@electrictoolbox.com> wrote:
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


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

Jul 17 '05 #3

P: n/a
In article <c5**********@newshispeed.ch>,
an*********@j-kult.net (Adrian Stutz [anime_layer]) wrote:
Right, forgot that. Tried to set it to E_ALL and what you proposed and I still
get no error. :(


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

JP

--
Sorry, <de*****@cauce.org> is een "spam trap".
E-mail adres is <jpk"at"akamail.com>, waarbij "at" = @.
Jul 17 '05 #4

P: n/a
Jan Pieter Kunst <de*****@cauce.org> wrote:
Did you check if the command works if you enter it manually on the
command line?


Yes. Works perfectly fine.

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

Jul 17 '05 #5

P: n/a
"Adrian Stutz [anime_layer]" <an*********@j-kult.net> wrote in message
news:c5**********@newshispeed.ch...
Yes. Works perfectly fine.


Root or normal user?
Jul 17 '05 #6

P: n/a
"Pertti Kosunen" <pe************@kolumb.us.fi_invalid> wrote:
Root or normal user?


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/ (Reviewdatenbank)

Jul 17 '05 #7

P: n/a
*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/ (Reviewdatenbank)

Jul 17 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.