To expand on the isssue:
1) The default interpreter for the update.sh is
which will use the default php.ini.
2) Since many people do (and should) have "system", in their disable functions, the system() call made in the update.sh will fail.
3) So.. as a workaround, we run this code, to swap out the interpreter to load php with the -n option, so no php.ini is used at all
Code:
perl -pi -e 's#^\#\!/usr/bin/env php#\#\!/usr/local/bin/php \-n#' ${REALPATH}/bin/update.sh
which should work just fine.. right?
4) In some random cases, we've found that using /usr/local/bin/php -n as the interpreter has some strange effects.
I was able to debug it down to the system call (one of many in the update.sh):
Code:
system(INSTALL_PATH . "bin/updatedb.sh --package=roundcube --version=" . $opts['version'] . " --dir=" . INSTALL_PATH . DIRECTORY_SEPARATOR . "SQL", $res);
where the INSTALL_PATH defined variable is not using the correct value.
The kicker is that I added this line immediately before that system call:
Code:
echo "Install path is INSTALL_PATH\n";
which echo'ed the exact correct path.
BUT.. for whatever reason, once system get's it's hands on it, the variable becomes:
Code:
[COLOR=#333333]/usr/local/php[/COLOR]
instead of
Code:
/var/www/html/roundcubemail-0.9.1
inside the system() command and we get the error:
Code:
sh: /usr/local/php/bin/updatedb.sh: No such file or directory
sh: /usr/local/php/bin/indexcontacts.sh: No such file or directory
Why? That's beyond me. It doesn't make much sense. Could be a php bug, not sure.
5) I went one step further and used this as the interpreter:
Code:
#!/usr/local/bin/php -c /usr/local/lib/php.ini
which should essentially do the exact same thing as
.. but, it doesn't. It throws the same error.
My only guess right now is that something in the environment is playing a major role in the INSTALL_PATH variable.
Any hints are welcome
6) The next thing to try would be to see if:
works.. which might be the proper solution... but I'm still confused why we can call php directly without php deciding it wants to re-label INSTALL_PATH to a wrong value.
EDIT: This does not work.. the extra -n can't be used on a shebang line.
Just as a note, it's defined higher up in the script:
Code:
define('INSTALL_PATH', realpath(dirname(__FILE__) . '/..') . '/' );
and *does* have the correct path for all tests... until system() runs it, and it's changed within the system call.
For anyone who are playing with this you'd need to edit the "build" script, and in the doroundcube() function comment out the line
Code:
rm -rf ${ALIASPATH}/installer
so that after you run ./build roundcube, everythinh is left behind, so the update.sh can be run manually.
John