Tampilkan postingan dengan label Laravel. Tampilkan semua postingan
Tampilkan postingan dengan label Laravel. Tampilkan semua postingan

How To Install Laravel 5 Framework on Ubuntu 15.10, 14.04, 12.04 & LinuxMint

How To Install Laravel 5 Framework on Ubuntu 15.10, 14.04, 12.04 & LinuxMint
Laravel is an open source PHP framework, designed for the faster development of MVC web applications in PHP. This article will help you to install Laravel 5 PHP Framework on Ubuntu 15.10, 14.04 LTS, 12.04 LTS, Debian and LinuxMint operating systems.

Step 1 – Install LAMP

To start with Laravel, we first need to set up a running LAMP server. If you have already running LAMP stack skip this step else use followings commands to set up lamp on Ubuntu system.

Install PHP 5.5

$ sudo apt-get install python-software-properties
$ sudo add-apt-repository ppa:ondrej/php5
$ sudo apt-get update
$ sudo apt-get install -y php5 php5-mcrypt php5-gd 

Install Apache2

$ apt-get install apache2 libapache2-mod-php5

Install MySQL

$ apt-get install mysql-server php5-mysql

Step 2 – Install Composer

Composer is required for installing Laravel dependencies. So use below commands to download and use as a command in our system.
$ curl -sS https://getcomposer.org/installer | php
$ sudo mv composer.phar /usr/local/bin/composer
$ sudo chmod +x /usr/local/bin/composer

Step 3 – Install Laravel

To download latest version of Laravel, Use below command to clone master repo of laravel from github.
$ cd /var/www
$ git clone https://github.com/laravel/laravel.git
Navigate to Laravel code directory and use composer to install all dependencies required for Laravel framework.
$ cd /var/www/laravel
$ sudo composer install
Dependencies installation will take some time. After than set proper permissions on files.
$ chown -R www-data.www-data /var/www/laravel
$ chmod -R 755 /var/www/laravel
$ chmod -R 777 /var/www/laravel/app/storage

Step 4 – Set Encryption Key

Now set the 32 bit long random number encryption key, which used by the Illuminate encrypter service.
$ php artisan key:generate

Application key [uOHTNu3Au1Kt7Uloyr2Py9blU0J5XQ75] set successfully.
Now edit config/app.php configuration file and update above generated application key as followings. Also make sure cipher is set properly.
'key' => env('APP_KEY', 'uOHTNu3Au1Kt7Uloyr2Py9blU0J5XQ75'),

'cipher' => 'AES-256-CBC',

Step 5 – Create Apache VirtualHost

Now add a Virtual Host in your Apache configuration file to access Laravel framework from web browser. Create Apache configuration file under /etc/apache2/sites-available/ directory and add below content.
$ vim /etc/apache2/sites-available/laravel.example.com.conf

        
        ServerName laravel.example.com
        DocumentRoot /var/www/laravel/public

        
                Options FollowSymLinks
                AllowOverride None
        
        
                AllowOverride All
        

        ErrorLog ${APACHE_LOG_DIR}/error.log
        LogLevel warn
        CustomLog ${APACHE_LOG_DIR}/access.log combined
Finally lets enable website and reload Apache service using below command.
$ a2ensite laravel.example.com
$ sudo service apache2 reload

Step 6 – Access Laravel

At this point you have successfully completed Laravel 5 PHP framework on your system. Now make host file entry to access your Laravel application in web browser. Change 127.0.0.1 with your server ip and laravel.example.com with your domain name configured in Apache.
$ sudo echo "127.0.0.1  laravel.example.com" >> /etc/hosts
And access http://laravel.example.com in your favorite web browser as below.
install laravel 5
Let’s start building an awesome application using Laravel 5 PHP Framework. Thanks.

Ref :  http://opensourcego.blogspot.co.id/2016/02/how-to-install-laravel-5-framework-on.html

Nyemplungin Project PHP ke Github (Install + Konfigurasi Git dan Upload Project)

1. Silahkan buat akun terlebih dahulu di situs github.com.
2. Setelah selesai, kita lanjutkan dengan mendownload software git di alamat ini http://git-scm.com/downloads. Sesuaikan dengan sistem operasi yang rekan-rekan gunakan. Disini saya menggunakan linux Mint sebagai sistem operasinya, jadi tinggal menginstallnya lewat terminal saja. Untuk OS Windows & Mac, gunakan pengaturan default seperti yang sudah tertera di panduan instalasi.
3. Seusai proses instalasi, buka aplikasi Git Bash (CLI version) jika rekan-rekan menggunakan OS Windows atau OS Mac. Jika menggunakan Linux seperti saya, cukup buka aplikasi terminal. Let’s go…
4. Masuk ke direktori aplikasi kita
Untuk versi Windows
1cd C:/repo/direktori_aplikasi
Untuk Linux & Mac
1cd /repo/direktori_aplikasi
5. Lakukan inisialisasi repositori
1git init
Akan keluar tulisan :
1Initialized empty Git repository in /home/lumbung/repo/psb/.git/
6. Masukkan semua aplikasi ke dalam antrian repositori, kalo error tambahkan saja -f jadi git add -f * ( memaksa file dimasukkan)
1git add *
7. Lihat status progresnya
1git status
Akan muncul hasil seperti ini :
1# On branch master
2#
3# Initial commit
4#
5# Changes to be committed:
6# (use "git rm --cached ..." to unstage)
7#
8# new file: admin/daftar-siswa.php
9# new file: admin/daftar-user.php
10# new file: admin/edit-pesan.php
11# new file: admin/edit-petugas.php
8. Lakukan commit terhadap file-file yang sudah masuk ke dalam daftar repo
1git commit -m "Commit Pertama"
Akan muncul progress seperti di bawah ini :
1[master (root-commit) 7b73710] Commit Pertama
2
375 files changed, 2611 insertions(+), 0 deletions(-)
4create mode 100644 admin/daftar-siswa.php
5create
6
7mode 100644 admin/daftar-user.php
9. Sekarang saatnya login ke akun github yang telah rekan-rekan buat. Buat sebuah repo dengan meng-klik link di pojok kanan atas “Create New Repo”.

10. Kita akan mendapatkan akses url untuk alamat repo yang baru kita buat. Contohnya pada tutorial ini ialah https://github.com/gedelumbung/OptionMenu.git
11. Kembali ke terminal atau Git Bash, ketikkan perintah berikut untuk menginisialisasi alamat repo / melakukan remoting pada repo yang akan kita gunakan :
12. Kemudian ketik perintah selanjutnya untuk melakukan Pull dari Github ke lokal repo komputer kita

1git pull origin master
2
3Akan muncul hasil seperti berikut :
4
51
6warning: no common commits
7remote: Counting objects: 6, done.
8remote: Compressing objects: 100% (2/2), done.
9remote: Total 6 (delta 0), reused 0 (delta 0)
10Unpacking objects: 100% (6/6), done.
12* branch master -> FETCH_HEAD
13Merge made by recursive.
14README.md | 3 +++
151 files changed, 3 insertions(+), 0 deletions(-)
16create mode 100644 README.md
13. Dan yang terakhir, kita akan melakukan Push folder project aplikasi kita ke situs Github
1git push origin master
Kita akan diminta untuk memasukkan username dan password dari akun Github yang kita gunakan. Hasilnya seperti di bawah ini :
1Username:
2Password:
3Counting objects: 82, done.
4Delta compression using up to 4 threads.
5Compressing objects: 100% (81/81), done.
6Writing objects: 100% (81/81), 194.61 KiB, done.
7Total 81 (delta 8), reused 0 (delta 0)
95b641f5..0b590a9 master -> master
14. Setelah itu, mari kita cek direktori repo yang telah kita buat. Jika berhasil, maka akan terlihat daftar file-file dan folder aplikasi kita sudah nangkring di sana.

15. Selesai

Cukup mudah kan?? Hehe, kelihatannya memang mudah, tetapi sebenarnya lumayan rumit juga jika kita belum mengerti konsep dari cara Git ini. Kata-kata gaul kalau kita sudah bermain-main dengan github ialah, “Fork Me” :D. Istilah Fork adalah menyalin repo dari milik seseorang, dimana kita bisa berkontribusi dalam pengembangan source code dari si pemilik repo asli. Beginilah cara kerja team yang baik dalam pengembangan software-software besar seperti software-software open source maupun sistem operasi open source. 

Ref : http://gedelumbung.com/git-tutorial-cara-installkonfigurasi-git-dan-upload-project-aplikasi-ke-github/

composer error : laravel cann't install


 [Composer\Repository\RepositorySecurityException]                           
  The contents of http://packagist.org/p/symfony/browser-kit$7243ec71a1525094 
  0c9d6c520acf1894c56aed85abb53ce09abb1ddf7702855a.json do not match its signature. This should indicate a man-in-the-middle attack. Try running composer again and report this if you think it is a mistake.


type this command :

composer config -ge

add this script



"repositories": {
        "packagist": { "url": "https://packagist.org", "type": "composer" }
    }
 
 
be like this
 



 Ref : https://github.com/composer/composer/issues/2835#issuecomment-38678249