Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Print error from CLI scripts when system/exec function is disabled #5744

Closed
scroom opened this issue May 1, 2017 · 5 comments
Closed

Print error from CLI scripts when system/exec function is disabled #5744

scroom opened this issue May 1, 2017 · 5 comments

Comments

@scroom
Copy link

scroom commented May 1, 2017

I wanted to update RC from 1.2.3 to 1.2.5 but the script shows me an error:

name@server:~/roundcubemail-1.2.5$ sudo bin/installto.sh /opt/www/roundcubemail/
Upgrading from 1.2.3. Do you want to continue? (y/N)
y
Copying files to target location...Error 500: Failed to execute command: rsync -aC --out-format "%n" --delete /home/name/roundcubemail-1.2.5/program/* /opt/www/roundcubemail/program/

I'm using the root-account on an Ubuntu 16.04 machine. It seems that some other are experiencing the same issue:

  1. http://www.roundcubeforum.net/index.php?topic=24183.0
  2. http://www.roundcubeforum.net/index.php/topic,23998.0.html
@alecpl
Copy link
Member

alecpl commented May 1, 2017

Did you try with removed doble-quotes in the command as proposed in the thread on the forum?

@alecpl alecpl added this to the 1.3.0 milestone May 1, 2017
@scroom
Copy link
Author

scroom commented May 4, 2017

Tried to remove the double-quotes. Here comes my changed part of the installto.sh:

 foreach ($dirs as $dir) {
    // @FIXME: should we use --delete for all directories?
    $delete  = in_array($dir, array('program', 'installer')) ? '--delete ' : '';
    $command = "rsync -aC --out-format \%n\ " . $delete . INSTALL_PATH . "$dir/* $target_dir/$dir/";
    if (!system($command, $ret) || $ret > 0) {
      rcube::raise_error("Failed to execute command: $command", false, true);
    }
  }
  foreach (array('index.php','.htaccess','config/defaults.inc.php','composer.json-dist','CHANGELOG','README.md','UPGRADING','LICENSE','INST$
    $command = "rsync -a --out-format \%n\ " . INSTALL_PATH . "$file $target_dir/$file";
    if (file_exists(INSTALL_PATH . $file) && (!system($command, $ret) || $ret > 0)) {
      rcube::raise_error("Failed to execute command: $command", false, true);
    }

But as well as the user report in the forum it is not working. I still get this error message:

root@server:/home/user/roundcubemail-1.2.5# bin/installto.sh /opt/www/roundcubemail/
Upgrading from 1.2.3. Do you want to continue? (y/N)
y
Copying files to target location...Error 500: Failed to execute command: rsync -aC --out-format %n\ --delete /home/user/roundcubemail-1.2.5/program/* /opt/www/roundcubemail/program/

This bug seems to be in the installer scripts of 1.2.4, 1.2.5 and the 1.3 beta.

@scroom
Copy link
Author

scroom commented May 4, 2017

I'm sorry! I've realized that in my /etc/php/7.0/cli/php.ini the system variable has been disabled. After enabling the variable the script worked as expected. I've thought, that my /etc/php/7.0/apache2/php.ini is the only relevant. Sorry!

@alecpl
Copy link
Member

alecpl commented May 4, 2017

So what? Does it work with double-quotes or not? Maybe we should add some hint to the error message e.g. "Is system() function enabled in php.ini?" or sth?

@scroom
Copy link
Author

scroom commented May 4, 2017

Yes it worked with double-quotes after I've enabled the system function.

@alecpl alecpl changed the title Upgrade script seems to be broken Print error from CLI scripts when system/exec function is disabled May 4, 2017
@alecpl alecpl added enhancement and removed bug labels May 4, 2017
@alecpl alecpl closed this as completed May 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants