php - Parse error: syntax error, unexpected 'ssh2_exec' (T_STRING) -
i want dump mysql database ssh connection.
<?php $vps_ip= 'xxxxxx'; $user="yyyy"; $passwd="zzzz"; $connection = ssh2_connect($vps_ip, 22); ssh2_auth_password($connection, $user,$passwd); $cmd="mysqldump -u root -pmypass database > /home/back.sql" ssh2_exec($connection,$cmd); ?>
the error message:
parse error: syntax error, unexpected 'ssh2_exec' (t_string) in **** on line 7
i can dump mysql database /home/back.sql
mysqldump -u root -pmypass database > /home/back.sql
how fix parser error in 'ssh2_exec'?
try:
$vps_ip= 'xxxxxx'; $user="yyyy"; $passwd="zzzz"; $connection = ssh2_connect($vps_ip, 22); ssh2_auth_password($connection, $user,$passwd); $cmd="mysqldump -u root -pmypass database > /home/back.sql" ; //error here, missing ; ssh2_exec($connection,$cmd);
Comments
Post a Comment