Re: [PHP] first time using exec() - are getting parse error.

2003-08-17 Thread Chris Hayes
At 12:06 17-8-2003, you wrote:
Hi,

I'm trying to call mysqldump from within a php-script, like this:
$backuptime = date(ymdHi);
$backupfile = un . $backuptime . .txt;
exec(mysqldump --opt -u$dbuser -p$dbpassword $dbdatabase $alltables  
/web/un/backup/$backupfile);

It works fine on my local Win2k, php 4.3.1, but not on my ISP:s Sun 
Solaris/php 4.3.2 machine I get a parse error. What am I doing wrong?

Is there a better way to backup my database?
I made a script to use mysqldump (in my script the result is send as an 
email attachment, with a debug option so it tells you what may be wrong. In 
your case, it is possible that mysqldump is not in the path, or even 
absent. Read the comments in the script. It needs some time to set up, with 
all the paths and other settings.
http://www.hieris.info/over/backup/backup.php.txt

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] first time using exec() - are getting parse error.

2003-08-17 Thread John W. Holmes
anders thoresson wrote:
Hi,

I'm trying to call mysqldump from within a php-script, like this:
$backuptime = date(ymdHi);
$backupfile = un . $backuptime . .txt;
exec(mysqldump --opt -u$dbuser -p$dbpassword $dbdatabase $alltables  
/web/un/backup/$backupfile);   

It works fine on my local Win2k, php 4.3.1, but not on my ISP:s Sun 
Solaris/php 4.3.2 machine I get a parse error. What am I doing wrong?

Is there a better way to backup my database?

What is the error you get? Print out the command you're trying to run to 
make sure it looks right. Remember that commands run as the web server 
user, so ensure that use has permission to run mysqldump. You may need 
to provide the complete path to mysqldump.

--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

PHP|Architect: A magazine for PHP Professionals - www.phparch.com





--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] first time using exec() - are getting parse error.

2003-08-17 Thread anders thoresson
What is the error you get?
Problem solved: it was a combination of permissions and wrong options.

--
anders thoresson
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php