Aplikasi desktop dengan php

PHP Desktop is an open source project founded by Czarek Tomczak in 2012 to provide a way for developing native desktop GUI applications using web technologies such as PHP, HTML5, JavaScript and SQLite. Think of it as Electron for PHP. It is a convienient tool for converting PHP web apps and PHP CLI tools to desktop applications with little effort. The development workflow you are used to while creating web applications remains the same, there is no new framework / API to learn. The process of turning an existing website into a desktop application is basically a matter of copying it to the "phpdesktop/www/" directory.

In a certain sense phpdesktop acts as a PHP to EXE compiler. It embeds a web browser, a multi-threaded web server and a PHP interpreter. All embedded into a single application, a portable folder that you can easily distribute to end users by packing it to zip archive or by making an . The web server embedded is a custom edition of Mongoose, a web server used by NASA on the International Space Station. Supported browsers are Internet Explorer and Google Chrome via open source Chromium. The package with Chrome embedded has no external dependencies, everything is included in phpdesktop binaries and works out of the box on a user's computer.

All popular PHP frameworks are supported, see the PHP frameworks support wiki page for example configurations for CakePHP, CodeIgniter, Laravel, Symfony, Yii and Zend Framework. You can create a standalone executable for distribution with the help of the . PHP sources can be protected with the many of the available . PHP Desktop is released under non-restrictive license, thus it is .

It is one of the top goals for PHP Desktop to be stable, to work reliably. PHP Desktop does not suffer from memory leaks. PHP by design was never intended for running long hours/days, as desktop applications usually do. This is not a concern when using PHP Desktop, as it is running an internal web server and serving pages through CGI. So when PHP script execution ends, PHP-CGI process is killed and all memory is always freed.

Lots of other useful information can be found on the Knowledge Base wiki page and on the PHP Desktop Forum.

Downloads

  • Windows
    • PHP Desktop v57.0 for Windows release
    • PHP Desktop MSIE v1.14 wiki page
  • Linux
    • PHP Desktop v72.1 for Linux release
  • Mac
    • No release yet, see the ongoing funding in Issue #208

There are two ways to be notified about new releases:

  • Watch the project with the "Releases only" option checked
  • Subscribe to the RSS/Atom feed

Support

  • Documentation is on the Wiki Pages. Start with the Knowledge Base, Settings and Chrome settings wiki pages.
  • Ask questions and report problems on the PHP Desktop Forum
  • See also this externally maintained tutorial: Create your first Desktop Application with PHP and PHP Desktop

Fundings for new features

Here is a list of ongoing fundings for new features in PHP Desktop:

FeatureFunds gatheredIssueStatusChrome v100 release for Windows$890 of $2,000Issue #227Ongoing fundingInitial Mac release$2,000 of $2,000Issue #208Work started

Below is a list of completed fundings with features already implemented:

FeatureFunds gatheredIssueStatusInitial Linux release$1,500 of $1,500Issue #221Done

Fundings for other features submitted in the issue tracker and the ones presented on the PHP Desktop Pro wiki page are also possible, just let know Czarek.

Support development

If you would like to support PHP Desktop general development efforts by making a donation please click the Donate button below:

Aplikasi desktop dengan php

Seeking sponsors

PHP Desktop is seeking companies to sponsor further development of the project. There are many proposals for new features submitted in the issue tracker and on wiki pages. Most notable are:

  • Monthly releases with latest Chrome
  • An automated build system
  • Cross-platform support with full functionality on Mac and Linux
  • More Javascript and PHP API exposed for accomplishing desktop specific tasks
  • Better integration with desktop, taskbar and systray
  • HTTPS/SSL support
  • Custom window themes
  • Running app in background
  • SQLite encryption
  • Desktop notifications

If your company would like to sponsor PHP Desktop development efforts then please contact Czarek. Long term sponsorships are welcome and Czarek is open to ideas about the project. He would love to spend more time on developing this project, but he can't afford doing so in his free time.

Aplikasi PHP merupakan aplikasi web yang berorientasi pada sisi server. Aplikasi PHP jika dilengkapi dengan database akan menghasilkan konten yang dinamis. Aplikasi PHP tidak harus selalu diakses dari server online yang memerlukan koneksi internet, namun untuk keperluan tertentu dapat diakses secara offline (localhost).

Suatu waktu, saya bertemu klien yang meminta untuk dibuatkan aplikasi pergudangan sederhana berbasis web. Aplikasi tersebut digunakan untuk memantau lalulintas barang masuk dan barang keluar. Di dalam aplikasi tersebut sudah termasuk manajemen dan pengelolaan data barang yang diambil dari database. Operasi database CRUD (Create, Read, Update dan Delete) sudah dipastikan ada didalamnya untuk memasukkan data-data yang terbaru.

Namun permasalahan muncul, karena klien tidak tahu dan tidak akan pernah mengerti bagaimana cara menghidupkan dan menjalankan server agar aplikasi yang berisi file PHP dapat dijalankan pada browser. Klien hanya tahu bagaimana cara mengoperasikan aplikasi yang sudah jadi. Nah, sebagai programmer atau pengembang yang baik dan bijak, diharuskan dapat menyelesaikan permasalahan yang dihadapi klien.

Untuk mengatasi hal tersebut, perlu dibuatkan alur yang lebih sederhana bagaimana menjalankan aplikasi PHP hanya dengan sekali klik. Idenya hampir sama dengan file exe (executable) pada Windows. Jika pengguna mengklik icon shortcut program pada desktop windows, maka program tersebut akan langsung ditampilkan dan digunakan saat itu juga.

Untuk menjalankan aplikasi PHP dengan sekali klik, dapat menggunakan file .bat. File .bat tersebut nantinya berisi rangkaian perintah untuk menghidupkan server, dan saat server sudah menyala (jeda waktu 10 detik) maka web browser dengan alamat URL aplikasi PHP akan secara otomatis ditampilkan dan siap digunakan.

Membuat File .bat

File dengan ekstensi bat merupakan file script pada DOS, OS/2 dan Microsoft Windows yang berisikan rangkaian perintah yang akan dieksekusi oleh penerjemah command-line, biasanya disimpan dalam bentuk file text sederhana. File .bat memiliki rangkaian perintah hampir sama dengan command prompt yang digunakan untuk berbagai keperluan dengan nilai aksi yang beragam.

Untuk membuat file .bat, silahkan buka text editor yang menghasilkan file ASCII murni misalnya notepad pada Windows. Kemudian menuliskan rangkaian perintah yang nantinya akan dieksekusi oleh Windows. Lalu simpan dengan nama dan ekstensi bat misalnya shortcut_project.bat. Untuk memudahkan menetapkan lokasi penyimpanan, silahkan simpan pada Desktop.

Aplikasi desktop dengan php

Jika menggunakan server Xampp, berikut isi file shortcut_project.bat :

1
2
3
4
5
6
7
@echo off
cd "C:\xampp\"
start xampp_start.exe
TIMEOUT 10
cd "C:\Program Files (x86)\Google\Chrome\Aplication"
start chrome.exe 127.0.0.1\selamat_datang.php
exit

Jika menggunakan server Wamp, berikut isi file shortcut_project.bat :

1
2
3
4
5
6
7
@echo off
cd "C:\wamp\"
start wampmanager.exe
TIMEOUT 10
cd "C:\Users\User\AppData\Local\Google\Chrome\Aplication"
start chrome.exe 127.0.0.1\selamat_datang.php
exit

Untuk file PHP (sample), misalnya selamat_datang.php :

1
2
3
  echo "

Selamat datang di websiteku..

";
?>

Membuat Icon Shortcut Pada Desktop Windows

File yang sudah berhasil dibuat merupakan file bat. Anda dapat mengeksekusinya secara langsung dengan melakukan double klik pada file bat tersebut. Namun karena tujuannya adalah memudahkan klien supaya terdapat icon shortcut pada desktop windows. Dan nantinya klien dapat mengeksekusi file bat tersebut sehingga dengan sekali klik, aplikasi dapat langsung berjalan.

Untuk membuat icon shortcut, silhkan klik kanan pada file shortcut_project.bat kemudian pilih Send to → Desktop (create shortcut). Kemudian tekan tombol windows + D untuk menuju Desktop. Dan icon shortcut sudah berhasil dibuat.

Aplikasi desktop dengan php

Anda dapat mengganti tampilan icon shortcut agar lebih menarik. Silahkan klik kanan pada icon tersebut lalu pilih Properties, lalu masuk ke tab Shortcut dan pilih Change Icon. Silahkan pilih icon sesuai dengan tema aplikasi yang digunakan.

Aplikasi desktop dengan php

Berikut gambar / video progress saat pertama icon shortcut pada desktop ditekan, kemudian server berhasil dijalankan sampai dengan web browser dengan URL berhasil ditampilkan :

Demikian artikel tentang bagaimana menjalankan aplikasi PHP pada windows seperti file executable. Semoga bermanfaat .

Aplikasi desktop menggunakan bahasa pemrograman apa?

Java bisa digunakan untuk membuat aplikasi berbasis desktop, website, mobile, hingga aplikasi embedded device seperti perangkat pintar atau microprosesor. Banyak aplikasi android yang dibuat menggunakan bahasa pemrograman Java.

Aplikasi desktop seperti apa?

Desktop application atau aplikasi desktop adalah suatu aplikasi yang dapat berjalan sendiri atau independen tanpa menggunakan browser atau koneksi internet disuatu komputer otonom.