WPAU: The function exec ()

Posted on May 1st, 2010 in Web Programming

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:

  1. $permission =  exec(“ls -l $theFile |awk ‘{print $1}’”, $output, $error);
  2. if($error == 0) {
  3. //get the perms
  4. $thePerms = $this->chmodnum(substr($permission, 1));
  5. //if its 644 or 744 we cannot run man
  6. //tell our wpau guy out there we need to change perms
  7. //we only can write files when they are 766 or 666 lets see
  8. $this->userPermission = $thePerms[0];
  9. if($thePerms[2] <6) {
  10. $canRun = false;
  11. }
  12. }
  13. else {
  14. $canRun = false;
  15. }
Changed to:
PHP:
  1. $permission = is_writable($theFile);
  2. if($permission == false){
  3. $canRun = false;
  4. } else {
  5. $canRun = true;
  6. }
Edit zip_backup function (the variation of permission), on file wpau_db_backup.class.php
Before being variation:
PHP:

  1. exec(“chmod 755 $archiveName”);
PHP:

  1. chmod($archiveName, 0755);
access amp article browser Click code com company content course design end Engine error example file function Home html information Internet line Link market message method name online page php process Search service site sitemap System Text time title type Use way Web Website world

Comments are closed.