WPAU: The function exec ()
Automatic Wordpress Plugin is one of the Wordpress plugin which is currently quite popular because it offers convenience to upgrade WordPress to the latest version automatically.
However, this plugin uses the functions exec () so they can run well. And unfortunately again, when you are on shared hosting, the function exec () into the list disable_function php. So the plugin can not run well.
If the function exec () is disabled on the server you are using, please make changes to the plugin WPAU. Here are his steps:
* Edit the variables $ permissions (runFTPPrelimChecks function) on the file wpau_prelimcheck.class.php
Before the conversion:
PHP:
-
$permission = exec(“ls -l $theFile |awk ‘{print $1}’”, $output, $error);
-
if($error == 0) {
-
//get the perms
-
$thePerms = $this->chmodnum(substr($permission, 1));
-
//if its 644 or 744 we cannot run man
-
//tell our wpau guy out there we need to change perms
-
//we only can write files when they are 766 or 666 lets see
-
$this->userPermission = $thePerms[0];
-
if($thePerms[2] <6) {
-
$canRun = false;
-
}
-
}
-
else {
-
$canRun = false;
-
}
Changed to:
PHP:
-
$permission = is_writable($theFile);
-
if($permission == false){
-
$canRun = false;
-
} else {
-
$canRun = true;
-
}
Edit zip_backup function (the variation of permission), on file wpau_db_backup.class.php
Before being variation:
Before being variation:
PHP:
-
exec(“chmod 755 $archiveName”);
PHP:
-
chmod($archiveName, 0755);
Web Site Design