SQLSTATE[42000]: Syntax error or access violation: 1055 Expression #3 of SELECT list is not in GROUP BY clause and contains nonaggregated

how to solve it?

check this answer.

OR Just Run the

$ sudo mysql -u root -p

change the SQL Mode for Your MySQL Server Instance

mysql > SET GLOBAL sql_mode=(SELECT REPLACE(@@sql_mode,'ONLY_FULL_GROUP_BY',''));



its work for me, cheers !


Cara Install Phalcon Di Ubuntu 16.04

Pada kesempatan kali ini saya akan berbagi kepada sobat tentang cara Install Phalcon Di Ubuntu 16.04 tentu saja cara ini tidak sama seperti halnya kita Install Phalcon Di Ubuntu 14.04. Sebelum sobat menginstall ini pastikan dahulu sobat mengenal phalcon jika belum kenal sobat bisa baca artikel saya sebelumnya tentang Perkenalan Framework Phalcon dan saya akan membuat tutorial series yang artinya setiap artikel yang satu dengan yang lain saling berkaitan. Nantikan tulisan saya lainnya tentang Tutorial Phalcon yang lainnya.

Yang berbeda cara installasi phalcon diubuntu 14.04 & ubuntu 16.04 adalah versi php yang berbeda. Perlu kalian ketahui bahwa ubuntu 16.04 hanya support menginstall dan menggunakan php7 , sementara ubuntu 14.04 menggunakan php 5. Tentu sangat berbeda apabila kita install ubuntu 16.04 dengan cara ubuntu 14.04.

1. Install LAMP-stack (Apache2, Mysql, Php 7)
Untuk cara penginstallan tidak akan saya jelaskan disini karena akan menjadi artikel yang sangaat panjang hahaha untuk saya rekomendasikan sobat untuk bisa ikuti cara di : http://tecadmin.net/install-apache-mysql-php-lamp-stack-on-ubuntu-16-04/
Setelah berhasil Install LAMP-stack kita akan mulai melakukan instalasi phalcon diharap untuk ikuti baik-baik step-by-stepnya.

2. Installasi Phalcon Ubuntu 16.04
Masukan command dibawah ini melalui terminal sobat secara bertahap satu per-satu.


$ sudo apt-add-repository ppa:phalcon/stable
$ sudo apt-get update
$ sudo apt-get install php7.0-phalcon
$ sudo apt-get install -y gcc make re2c libpcre3-dev php7.0-dev build-essential php7.0-zip


3. Aktifkan Extensi Phalcon
$ sudo apt-get install gcc make autoconf libc-dev pkg-config
$ git clone --depth=1 git://github.com/phalcon/cphalcon.git
$ cd cphalcon/build
$ sudo PATH=/opt/sp/php7.0/bin:$PATH ./install
4. Tambahkan Extensi Phalcon Ke Apache
$ sudo bash -c "echo extension=phalcon.so > /etc/php7.0/conf.d/phalcon.ini"
$ sudo service php7.0-fpm restart


5. Cek Ekstensi Phalcon.
Cek ekstensi phalcon apakah sudah aktif atau belum.
Runing terlebih dahulu Apache2 sobat “sudo service apache2 start”
lalu buat file php.info didirektori default apache2 /var/www/html/ cari ekstensi phalcon ctrl + f phalcon.
Selamat! Kini Phalcon v.3.0.1 telah diinstall diubuntu 16.04 sobat silahkan untuk terbang bersama phalcon ?

How To Install Apache MySQL PHP (LAMP Stack) on Ubuntu 16.04

LAMP (Linux, Apache, MySQL and PHP ) Stack is the most popular environment in PHP website development and hosting. Linux is the operating system, Apache is the popular web server developed by Apache Foundation. MySQL is relational database management system used for storing data and PHP is an development language.

This article will help you to Install Apache 2.4, MySQL 5.7 and PHP 7.0 . on Ubuntu 16.04 LTS Systems.

Step 1 – Install PHP

PHP 7 is the default available packages in Ubuntu 16.04 repositories. Simply use the following commands to update apt cache and install PHP packages on your system.

$ sudo apt update
$ sudo apt install -y php

Verify installed PHP version using following command.

rahul@tecadmin:~$ php -v

PHP 7.0.4-7ubuntu2 (cli) ( NTS )
Copyright (c) 1997-2016 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies
    with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies

Step 2 – Install Apache2

After installing PHP on your system, let’s start installation of Apache2 in your system. Your also required to install libapache2-mod-php module to work PHP with Apache2.

$ sudo apt install apache2 libapache2-mod-php

Step 3 – Install MySQL

Finally install mysql-server packages for MySQL database. Also install php-mysql package to use MySQL support using php. Use following command to install it.

$ sudo apt install mysql-server php-mysql

Installer will prompt for root password, This password will work for your MySQL root user. After installing MySQL execute following command for initial settings of MySQL server. You will she that script will prompt about more settings than earlier mysql versions like password validation policy etc.

$ sudo mysql_secure_installation

Step 4 – Restart Apache2, MySQL Services

After installing all services on your system, start all required services.

$ sudo systemctl restart apache2.service
$ sudo systemctl restart mysql.service

Step 5 – Open Access in Firewall

If you are using iptables, Use following commands to open port 80 for public access of webserver.

Iptables Users:

$ sudo iptables -A INPUT -m state --state NEW -p tcp --dport 80 -j ACCEPT

UFW Users:

$ sudo ufw allow 80/tcp

Step 6 – Test Setup

After completing all setup. Let’s create a info.php file website document root with following content.

Now access this file in web browser. You will see the screen like below with all details of PHP on server.


Congratulation’s! You have successfully configured web server on your ubuntu System.

credit : https://tecadmin.net/

Uploading multiple files with Phalcon PHP and HTML5.

First of all, if you just fell here and don’t know what Phalcon is, I recommend you to first take a ride at its website, or documentation. If you feel ready or already knew it, then we can go on.

Note: if you want the tl;dr version you can go down the page, download the whole project and see the code by yourself.

Note²: my goal here is just show the simplest way to implement a multiple file upload system using Phalcon, so don’t expect to see security rules such as file size limiters, file extension filtering, upload bot blocking, etc.

For this example we will be using the native HTML5 multiple attribute for file inputs, which according to CanIUse, its suported by: IE10+, Chrome, Firefox, Safari 7+, iOS 5+, and Android 4.4+.

So, first of all lets create a new Phalcon project (you can create it manually or using Phalcon Dev Tools, which I highly recommend you to use, you can find more about it here).

Using Dev Tools we can simply use this command to create all Phalcon project structure and files automatically:

$ phalcon project multiple-uploader-example

Where “multiple-uploader-example” is the name you want to give to our project.

Ok, so now we have our fresh created project which will have an structure like this:

Dat Sublime Text 2 Theme…

See these green arrows pointing to IndexController.php and index.volt? These are the only files we will be working at.

Also, we need to create a folder that we will call temp inside public’s folder which will receive the uploaded files:

Ok, so now we need to create a form in the view (index.volt) to send our images, it will be something like this:

<form action=”index/upload” method=”post” enctype=”multipart/form-data”>
 <input type=”file” name=”files[]” multiple>
 <input type=”submit” value=”Send File(s)”>

The form itself is pretty common, the magic happens when we add the multiple attribute and the brackets in input’s name, now our input supports multiple files. Also, as you can see, the action is leading to index/upload which we will be coding bellow.

In our IndexController.php we now need to handle the upload action, checking if there is any file sent, and handling them properly.

Our yet untouchable IndexController.php is probably looking like this:

class IndexController extends ControllerBase
 public function indexAction()

You can see that there is already a function which responds to /index actions which is empty, now we need to create the one that will handle /index/upload. To do this we will create another action:

class IndexController extends ControllerBase
 public function indexAction()
 public function uploadAction()

And then put the code which will handle the uploaded files:

#check if there is any file
if($this->request->hasFiles() == true){
 $uploads = $this->request->getUploadedFiles();
 $isUploaded = false;
 #do a loop to handle each file individually
 foreach($uploads as $upload){
 #define a “unique” name and a path to where our file must go
 $path = ‘temp/’.md5(uniqid(rand(), true)).’-’.strtolower($upload->getname());
 #move the file and simultaneously check if everything was ok
 ($upload->moveTo($path)) ? $isUploaded = true : $isUploaded = false;
 #if any file couldn’t be moved, then throw an message
 ($isUploaded) ? die(‘Files successfully uploaded.’) : die(‘Some error ocurred.’);
 #if no files were sent, throw a message warning user
 die(‘You must choose at least one file to send. Please try again.’);

Kind of fuzzy eh? As Medium don’t support syntax highlight (yet! I hope) I think that a image of the whole controller would become handy and easier to understand:

This image is the code above in any editor with syntax highlight

Aaand this is it! Now all you need to do is run your project in a browser (in an apache environment with phalcon installed, obviously) and see the magic happens!

If you want to see what we just created here, you can download the example project here (watch out, its a .rar file, it may contain viruses that will eat you brain inside out while singing shitty pop songs).

If you got stuck somewhere or have any doubts you can always leave a comment in the part you are having troubles. →

And a good week for everyone. ☺

Raw SQL Query PhalconPHP

Phalcon is a high perfomance PHP framework based on MVC pattern.  Phalcon has good performance in handle many request/second compared to other PHP framework, such as : Laravel, Zend, Code Igniter, and Kohana.

This tutorial will show you how to call raw SQL query for insert,update,select, and delete in Phalcon PHP Framework.

1. Select

This example shows you how to call raw select from Phalcon controller class.

public function selectAction()
    $result=$this->db->query("SELECT employee_id,employee_name FROM employee order by employee_id desc");
        echo $row['employee_id']." ".$row['employee_name']."<br>";


2. Insert

This example shows you how to call raw insert from Phalcon controller class.

public function insertAction()
    $success=$this->db->execute("INSERT INTO employee (employee_id,employee_name)
                            VALUES ('14','Aditya Nugraha')");
    if($success)echo "Success!!";
    else echo "Failed!!";


3. Update

This example shows you how to call raw update from Phalcon controller class.

public function updateAction()
    $success=$this->db->execute("UPDATE employee SET employee_name='Aditya'
                                WHERE employee_id='14'");
        echo $updatedCount." rows updated";
    else echo "Failed!!";


4. Delete

This example shows you how to call raw delete from Phalcon controller class.

public function deleteAction()
    $success=$this->db->execute("DELETE FROM employee
                                WHERE employee_id='14'");
        echo $updatedCount." rows deleted";
    else echo "Failed!!";

Cara Upload Project ke Github Melalui CMD

Upload File ke Github

1. Pertama yang harus kalian lakukan adalah mendaftar akun Github terlebih dahulu. Prosesnya terbilang mudah 3 Step untuk bisa membuat akun di Github.

Disini https://github.com/

2.   Setelah berhasil di buat akun Githubnya. Lihat pada pojok kanan atas pilih tanda + samping gambar profil Github kalian. Lalu pilih New repository.

New repository Github

3. Lalu pada bagian Create a new repository . Kalian bisa isikan  Nama Repository di kolom bagian atas. Lalu bagian bawah (optional) kalian bisa mengisikan deskripsinya. Setting ke Public , jika sudah pilih tombol Create Repository yang bewarna hijau. 

Create Repository Github

4.   Jika sudah Copykan alamat atau url repository gitnya. Alamat ini akan kita gunakan untuk tempat meremote folder atau file kita di Github.

alamat atau url Github remote

5. Sekarang kembali ke Command Prompt atau Git Bash, masuk ke dalam folder dan file sebelumnya
( folder : belajargit file : latihan1.txt).

6. Lalu ketikan perintah git config

git config adalah suatu perintah untuk mengkonfigurasi username,  dan alamat email Github kita agar tersimpan di dalam Command Line.


git config cmd Windows
git config

git config –global user.name “username Github”
git config –global user.email “alamat email Github”

7.  Kemudian ketikan perintah  git init

8. Sekarang kita akan coba tambahkan 3 file tambahan. Ketikan git add * 

9.  Jika di artikel sebelumnya kita sudah menambahkan commit , sekarang kita tambahkan lagi yaitu dengan mengetikan.

 git commit –m “Upload di Github”

10.  Setelah itu kita akan meremote ke alamat , atau url repository git yang sudah kita copykan tadi.

git remote adalah perintah untuk tempat meremote folder atau file kita sebelumnya yang sudah terinisiaisasi Git, yang tersimpan di local (Komputer kita ) ke server atau tempat repository (Github)

Ketikan perintah :

git remote add origin <alamat git kalian>

//origin adalah nama remote yang telah kita tambahkan
//jika kalian ingin mengubah url remote atau mensetting kembali remote kalian bisa mengetikan perintah :
git remote set-url origin <alamat git>

git remote cmd windows
git remote

11. Lalu ketikan

 git pull origin master.


git pull digunakan untuk menarik atau nama lain dari mengunduh,  beberapa file di dalam project yang tersimpan di repository (server),  ke dalam tempat penyimpanan Komputer kita (local).


Biasanya ini digunakan untuk suatu project yang dikerjakan atau dikembangkan lebih dari satu orang (kolaboratif) , dan kita mengambil beberapa file yang telah di kerjakan oleh orang tersebut. Jadi ketika ada perubahan dan penambahan file di server atau repository Github, kalian harus menggunakan git pull terlebih dahulu sebelum mempush (git push).


12. Terakhir kita ketikan.

 git push origin master

git push digunakan untuk mengupload atau menyimpan,  beberapa file di dalam project dari  tempat penyimpanan Komputer kita (local) , ke dalam project yang tersimpan di repository (server).

Tapi tunggu dulu jika kalian memiliki kegagalan saat mempush  , atau kendala erorr dan server (Github) menolak project  kita seperti pada gambar dibawah:

git push error cmd Windows
git push error

Tenang kalian bisa mencari solusinya di forum diskusi tanya jawab.

Disini : StackOverflow.com

atau kalian bisa ketikan perintah berikut :

git reset –mixed origin/master
git add .
git commit -m “Upload Github Lagi”
git push origin master

 Jika berhasil maka tampilanya akan seperti ini :

git push sukses cmd Windows
git push sukses

Nah sekarang kita lihat ke akun github kita, Jika tampilanya seperti gambar dibawah. Maka project kita telah sukses di upload atau disimpan ke server (Repository) Github.

project sukses tersimpan atau terupload di Github
Oh ya kalian juga dapat mengkloning atau mendownload,  project Github kalian atau orang lain  lewat Command Line dengan perintah:

git clone <alamat git>

git clone alamat git
git clone

Tambahan jika kalian ingin melakukan perubahan atau penambahan :

  • 1. Jadi intinya gini jika kita ingin menambahkan folder ( harus berisi file ) atau file baru dan perubahan pada beberapa file ,kita bisa menampilkan status folder atau file tersebut dengan perintah: git status.
  • 2. Nah ketika status folder atau file tersebut terlihat maka akan di tandai dengan warna merah. Artinya folder atau file dalam mode (unstaged) belum di daftarkan ke system Git.
  • 3. Selanjutnya agar folder atau file tersebut terdaftar ke system git , dan beralih ke mode (staged) , yang dimana telah terjadi perubahan atau penambahan pada project, kita bisa mengetikan perintah git add <namafile> atau git add *.
  • 4. Setelah itu kita beri keterangan atau pesan, kepada system Git, bahwa terjadi perubahan pada project tersebut dengan perintah: git commit -m “Pesan kalian”
  • 5. Lalu baru lah kalian bisa mengupload atau menyimpan project kalian ke repository Github (Server), dengan mengetikan perintah : git push origin master.
Alur Langkah Langkah Mengupload Project ke Github
Alur Mengupload Project ke Github

Selengkapnya jika ingin melihat Basic Git Command lainya ( Perintah Dasar Git ):

Kurang lebih itu saja  tentang Cara Mengupload Project ke Github Melalui Command Line. Jika terdapat kekurangan disana sini mohon maaf sebelumnya. Terima kasih.

How to Install PHP 7 on CentOS/RHEL 7.1 & 6.7

PHP 7.1 is the latest stable release of PHP. May of popular yum repositories are providing rpm packages for PHP 7. This article is using webtatic yum repository and used the same for testing on CentOS 7 server. This article will help you to install PHP 7 on CentOS & Red Hat 7.1 & 6.7 servers.

Install Yum Repository

First of all you need to enable Webtatic and EPEL yum repositories on your system. Use the following command to install EPEL repository on your CentOS and Red Hat 7/6 systems

Use this command to install epel-release yum repository.

# yum install epel-release

and now execute one of the following command as per your operating system version to install webtatic yum repository.

On CentOS/RHEL 7:

# rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm

On CentOS/RHEL 6:

# rpm -Uvh https://mirror.webtatic.com/yum/el6/latest.rpm

Install PHP 7

Use the following command to install PHP 7 on your system.

# yum install php70w

Verify Install PHP Version

Now use the following command to check installed PHP version on your system.

# php -v

PHP 7.0.0 (cli) (built: Dec  2 2015 20:42:32) ( NTS )
Copyright (c) 1997-2015 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2015 Zend Technologies

Install PHP Modules

You may also want to install additional php modules based on your application requirements. Below command will install some more useful php modules.

# yum install php70w-xml php70w-soap php70w-xmlrpc
# yum install php70w-mbstring php70w-json php70w-gd php70w-mcrypt

To find out other available php modules use the following command.

# yum search php70 

php70w.x86_64 : PHP scripting language for creating dynamic websites
php70w-bcmath.x86_64 : A module for PHP applications for using the bcmath library
php70w-cli.x86_64 : Command-line interface for PHP
php70w-common.x86_64 : Common files for PHP
php70w-dba.x86_64 : A database abstraction layer module for PHP applications
php70w-devel.x86_64 : Files needed for building PHP extensions
php70w-embedded.x86_64 : PHP library for embedding in applications
php70w-enchant.x86_64 : Enchant spelling extension for PHP applications
php70w-fpm.x86_64 : PHP FastCGI Process Manager
php70w-gd.x86_64 : A module for PHP applications for using the gd graphics library
php70w-imap.x86_64 : A module for PHP applications that use IMAP
php70w-interbase.x86_64 : A module for PHP applications that use Interbase/Firebird databases
php70w-intl.x86_64 : Internationalization extension for PHP applications
php70w-ldap.x86_64 : A module for PHP applications that use LDAP
php70w-mbstring.x86_64 : A module for PHP applications which need multi-byte string handling
php70w-mcrypt.x86_64 : Standard PHP module provides mcrypt library support
php70w-mysql.x86_64 : A module for PHP applications that use MySQL databases
php70w-mysqlnd.x86_64 : A module for PHP applications that use MySQL databases
php70w-odbc.x86_64 : A module for PHP applications that use ODBC databases
php70w-opcache.x86_64 : An opcode cache Zend extension
php70w-pdo.x86_64 : A database access abstraction module for PHP applications
php70w-pdo_dblib.x86_64 : MSSQL database module for PHP
php70w-pear.noarch : PHP Extension and Application Repository framework
php70w-pgsql.x86_64 : A PostgreSQL database module for PHP
php70w-phpdbg.x86_64 : Interactive PHP debugger
php70w-process.x86_64 : Modules for PHP script using system process interfaces
php70w-pspell.x86_64 : A module for PHP applications for using pspell interfaces
php70w-recode.x86_64 : A module for PHP applications for using the recode library
php70w-snmp.x86_64 : A module for PHP applications that query SNMP-managed devices
php70w-soap.x86_64 : A module for PHP applications that use the SOAP protocol
php70w-tidy.x86_64 : Standard PHP module provides tidy library support
php70w-xml.x86_64 : A module for PHP applications which use XML
php70w-xmlrpc.x86_64 : A module for PHP applications which use the XML-RPC protocol

credit : tecadmin.net