23 December 2015

Tutorial Cakephp - Installation Cakephp 3


Mudah sekali cara install cakephp 3, berikut saya paparkan sedikit tutorial instalasi Cakephp 3.

Langkah-langkah

1. Buka official website cakephp di sini.
2. Klik Download, Anda akan diarahkan pada halaman instalasi.
3. Baca dulu Requirementnya.

Requirements

  • HTTP Server. For example: Apache. Having mod_rewrite is preferred, but by no means required.
  • PHP 5.4.16 or greater.
  • mbstring extension
  • intl extension
In both XAMPP and WAMP, the mbstring extension is working by default.
In XAMPP, intl extension is included but you have to uncomment extension=php_intl.dll in php.ini and restart the server through the XAMPP Control Panel.
In WAMP, the intl extension is “activated” by default but not working. To make it work you have to go to php folder (by default) C:\wamp\bin\php\php{version}, copy all the files that looks like icu*.dll and paste them into the apache bin directory C:\wamp\bin\apache\apache{version}\bin. Then restart all services and it should be OK.
While a database engine isn’t required, we imagine that most applications will utilize one. CakePHP supports a variety of database storage engines:
  • MySQL (5.1.10 or greater)
  • PostgreSQL
  • Microsoft SQL Server (2008 or higher)
  • SQLite 3
All built-in drivers require PDO. You should make sure you have the correct PDO extensions installed.
4. Cakephp membutuhkan composer. Anda dapat mendownloadnya di getcomposer.org.
5. Setelah menginstal composer, dan mensettingnya. Anda dapat memakainya dengan command seperti berikut
php composer.phar create-project --prefer-dist cakephp/app [app_name]
atau
composer create-project --prefer-dist cakephp/app [app_name]
6. Selesai, Cakephp 3 berhasil diinstall.

Mudah bukan? hehe,


Tips

Up to date

Agar selalu update dengan versi Cakephp terbaru. Anda dapat mengaturnya pada file composer.json. File tersebut dapat Anda dapatkan pada folder Cakephp.
standarnya seperti ini:
"require": {
    "cakephp/cakephp": "~3.0"
}
Ubah menjadi
"require": {
    "cakephp/cakephp": "dev-master"
}
Untuk meng updatenya cukup jalankan perintah composer install atau composer update.

Server

Cakephp dapat berjalan dengan webserver sendiri menggunakan Cakephp console.
jalankan command berikut
bin/cake server
secara default akan membuka port 8765. Jadi Anda dapat mengaksesnya di localhost:8765
Kustomisasi port
bin/cake server -H 192.168.13.37 -p 5673
-H = Host server
-p = Port
Anda dapat mengaksesnya di 192.168.13.37:5673

Untuk lebih jelasnya Anda dapat melihat disini:

No comments: