Call to undefined function Grav\Plugin\GitSync\exec()
ERROR : "Call to undefined function Grav\Plugin\GitSync\exec()"
/home/clients/xxxxxx/sites/xxxxx/user/plugins/git-sync/classes/Helper.php
/**
* Checks if the user/ folder is already initialized
*
* @return bool
*/
public static function isGitInitialized()
{
return file_exists(rtrim(USER_DIR, '/') . '/.git');
}
/**
* @param bool $version
* @return bool|string
*/
public static function isGitInstalled($version = false)
{
$bin = Helper::getGitBinary();
exec($bin . ' --version', $output, $returnValue);
$installed = $returnValue === 0;
if ($version && $output) {
$output = explode(' ', array_shift($output));
$versions = array_filter($output, static function($item) {
return version_compare($item, '0.0.1', '>=');
});
$installed = array_shift($versions);
}
return $installed;
}
/**
* @param bool $override
* @return string
*/
public static function getGitBinary($override = false)
Got same after installing plugin, any idea or solution?
Some PHP installs do not include/enable the exec function, so that might be something to confirm with your host setup.
OK, solved for me, i did not expect that the exec function wound be disabled on some domains and enabled on others. Same hosting, same server, same account, just different domains.
Some PHP installs do not include/enable the exec function, so that might be something to confirm with your host setup.
it' must be enable? it's strict security reason.
Yes it needs it to run the git command. It’s required for the whole functionality of the plugin.
Yes it needs it to run the
gitcommand. It’s required for the whole functionality of the plugin.
ouh i see, i have enabled git sync ... and it's running the exec command
Yes it needs it to run the
gitcommand. It’s required for the whole functionality of the plugin.
why you not use hook (like webhook) to access git function, beside using exec command?