Rumahweb’s News, Article, and Tutorial of Web Development

  • Home
  • Kumpulan Artikel
  • Berlangganan melalui RSS

WPAU : Fungsi exec()

May 26th, 2008  |  Published in Artikel & Tutorial, Web Programming

Wordpress Automatic Plugin adalah salah satu plugin Wordpress yang cukup digemari saat ini karena menawarkan kemudahan untuk melakukan upgrade Wordpress ke versi terbaru secara otomatis.

Namun, plugin ini menggunakan fungsi exec() supaya dapat berjalan dengan baik. Dan sayangnya lagi, ketika berada pada shared hosting, fungsi exec() masuk ke dalam daftar disable_function php. Sehingga plugin tidak dapat berjalan dengan baik.

Apabila fungsi exec() di-disable pada server yang Anda gunakan, silahkan melakukan perubahan pada plugin WPAU tersebut. Berikut langkah-langkah nya :

  • Edit variabel $permission (function runFTPPrelimChecks) pada file wpau_prelimcheck.class.php
  • Sebelum dilakukan pengubahan :

    PLAIN TEXT
    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. }

    Diubah menjadi :

    PLAIN TEXT
    PHP:
    1. $permission = is_writable($theFile);
    2. if($permission == false){
    3.             $canRun = false;
    4.         } else {
    5.             $canRun = true;
    6.         }

  • Edit fungsi zip_backup (perintah pengubahan permission), pada file wpau_db_backup.class.php
    Sebelum dilakukan pengubahan :

    PLAIN TEXT
    PHP:
    1. exec("chmod 755 $archiveName");

    Diubah menjadi :

    PLAIN TEXT
    PHP:
    1. chmod($archiveName, 0755);

    Pengubahan seperti diatas telah kami coba untuk melakukan upgrade otomatis dari Wordpress versi 2.3.3 ke Wordpress versi 2.5.1.

    Selamat mencoba!

Bookmark Artikel Ini
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • BlinkList
  • feedmelinks
  • Furl
  • Ma.gnolia
  • MisterWong
  • Propeller
  • StumbleUpon
  • Technorati
  • TwitThis
  • YahooMyWeb
  • E-mail this story to a friend!
  • Live
  • Reddit
  • Slashdot

Leave a Response

Popular Posts

  • PHP & MySQL: Tutorial Dasar
  • Berkenalan dengan PHP
  • Bagaimana Cara Mengupload Website ke Rumahweb dengan FTP?
  • Indikator Status Yahoo! Messenger
  • Membuat Form Kontak
  • Cara Upload MySQL Database
  • Membangun CMS dengan PHP [Bag.3]
  • Cara Membuat Google Sitemap
  • Instalasi OsCommerce melalui Fantastico
  • Cara Mengupload website ke Rumahweb melalui File Manager

Categories

  • Artikel & Tutorial
  • Fantastico Review
  • Gangguan
  • Manual Hosting
  • News
  • Promo
  • SEO
  • The Lounge
  • Web Design
  • Web Hosting
  • Web Programming

Tags

account Admin alamat rumahweb bahasa Blogspot bug Change Password cPanel core coredump cPanel Domain domain murah email Email Account error FTP gadget Google Hosting Hosting Indonesia hosting murah Hosting US Joomla linux Mail Oscommerce panduan php Plugin Promo rumahweb rumahweb jakarta Search Engine SEO setting Sitemap SMTP Setting SPAM template Themes tips Upload Website widget Wordpress


Rumahweb’s News, Article, and Tutorial of Web Development is using WordPress and Gridline Lite theme.