Laravel Gmail not working, “Username and Password not accepted. Learn more…”

If you got error while sending email by using gmail (as sender ) at live server.

error message” Username and Password not accepted. Lea$
535 5.7.8 w187sm24324471pfw.62 – gsmtp”

Go to this link and disable unlock Captcha

This is simply because Google blocked unsecure login to SMTP by default because for security

Ubuntu OS မွာ Apache ၿဖင္႔ PHP ကို Multiple Versions ေၿပာင္းလဲ အသံုးၿပဳၿခင္း

Ubuntu OS မွာ Apache ၿဖင္႔ PHP ကို Multiple Versions ေၿပာင္းလဲ အသံုးၿပဳၿခင္း
အကယ္၍ မိမိ development လုပ္ေနေသာ Environment မွာ PHP ကို Version တစ္မ်ဴိးထက္ပိုၿပီး Install လုပ္ထားရတယ္ ( eg. 5.6 and 7.3 )။ မိမိရဲ႕ Project ရဲ႕လုိအပ္ခ်က္အရ PHP ကို Version 5.6 နဲ႕ 7.3 Version ၂ မ်ဴိးလံုးအသံုးၿပဳဖုိ႕လိုအပ္ခဲ႕လွ်င္
ဥပမာ အေနနဲ႕
Project1 – Yii Framework Version 1 – PHP 5.6
Project2 – Laravel Framework Version 5.7 – PHP 7.3
user_name@ubuntu1804:~$ sudo update-alternatives –config php

There are 3 choices for the alternative php (providing /usr/bin/php).

Selection Path Priority Status

First Way 

user_name@ubuntu1804:~$ sudo update-alternatives –config php

0 /usr/bin/php7.3 73 auto mode
1 /usr/bin/php5.6 56 manual mode
2 /usr/bin/php7.2 72 manual mode
* 3 /usr/bin/php7.3 73 manual mode

Press <enter> to keep the current choice[*], or type selection number: 3

user_name@ubuntu1804:~$ php -v
PHP (cli) (built: Nov 28 2019 07:37:16) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.12, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache, Copyright (c) 1999-2018, by Zend Technologies

user_name@ubuntu1804:~$ sudo systemctl restart nginx


Another Way
How to change PHP Version for Apache
Enable php 5.6  and disable php 7.3
sudo a2dismod php7.3
sudo a2enmod php5.6
sudo service apache2 restart
Enable php 7.3  and Disable php 5.6
sudo a2dismod php5.6
sudo a2enmod php7.3
sudo service apache2 restart
/var/www/html folder ထဲတြင္ info.php ဆိုၿပီး PHP Script File တစ္ခုတည္ေဆာက္ၿပီး
ဆုိၿပီး သိမ္းဆည္းလိုက္ပါ။ ၿပီးလွ်င္ Browser မွ http://localhost/info.php ဆိုၿပီးေခၚၿကည္႔လုိက္ပါ။
မိမိရဲ႕ Apache Web Server ရဲ႕ လက္ရွိ PHP Version ကို ၿမင္ရပါလိမ္႔မယ္။
How to change PHP Version for Ubuntu ( command line usage )
Terminal ( Command Line ) တြင္
sudo update-alternatives –config php
PHP Version selection Questions ေပၚလာပါလိမ္႔မယ္။ မိမိ အလုိရွိေသာ PHP Version ကိုေရြးခ်ယ္ ေၿပာင္းလဲလုိ႕ရပါသည္။ ေၿပာင္းလဲၿပီးစီးသည္႔အခါ Teminal တြင္
php -v
ၿဖင္႔ PHP current version ကို ေခၚၿကည္ႏုိင္ပါသည္။
OS – Ubuntu – 16.04 / 18.04
Web Server – Apache
PHP – 5.6 & 7.3
Wai Yan Aung


HOw to install JHipster ( Latest Version )

Quick setup

  1. Install Java 11. We recommend you use AdoptOpenJDK builds, as they are open source and free.
  2. Install Node.js from the Node.js website (please use an LTS 64-bit version, non-LTS versions are not supported)
  3. Install JHipster: npm install -g generator-jhipster
  4. (optional) If you want to use a module or a blueprint (for instance from the JHipster Marketplace), install Yeomannpm install -g yo

Ref ::


How to install JHipster Old Version
npm install -g generator-jhipster@5.2.1


Uninstall JHipster 
whereis jhipster
sudo rm -rf /opt/node-v10.16.0-linux-x64/bin/jhipster


Laravel 5.7 showing “Failed to clear cache. Make sure you have the appropriate permissions”

Laravel 5.7 showing “Failed to clear cache. Make sure you have the appropriate permissions”

Got error while running “php artisan cache:clear”


If the “data” directory (storage/framework/cache/data) doesn’t exist you will have this error.
This “data” folder doesn’t exist by default on a fresh/new installation.
Creating the “data” directory at (storage/framework/cache) manually should fix this issue.

Useful Website Links

Programming and development site

Unofficial Solutions to the Training by Codility

How to install apache tomcat for java (web) on ubuntu 16.04

How To Install Apache Tomcat 8 on Ubuntu 16.04

Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes (SQL: alter table `users` add unique `u sers_email_unique`(`email`))

Got error message while running “php artisan migrate” at laravel 5.7


For laravel 5.7
This solution solve my problem
go to config/database.php
Find the code below

‘mysql’ => [
‘driver’ => ‘mysql’,
‘host’ => env(‘DB_HOST’, ‘’),
‘port’ => env(‘DB_PORT’, ‘3306’),
‘database’ => env(‘DB_DATABASE’, ‘forge’),
‘username’ => env(‘DB_USERNAME’, ‘forge’),
‘password’ => env(‘DB_PASSWORD’, ”),
‘unix_socket’ => env(‘DB_SOCKET’, ”),
‘charset’ => ‘utf8mb4’,
‘collation’ => ‘utf8mb4_unicode_ci’,
‘prefix’ => ”,
‘strict’ => true,
‘engine’ => null,
Change this two field

‘charset’ => ‘utf8mb4’,
‘collation’ => ‘utf8mb4_unicode_ci’

With This

‘charset’ => ‘utf8’,
‘collation’ => ‘utf8_unicode_ci’


How to install Node.js via binary archive on Linux (node-v8.11.3-linux-x64.tar.xz)

1) Node version = node-v8.11.3-linux-x64.tar.xz
Unzip the binary archive to any directory you wanna install Node, I use /usr/local/lib/nodejs

sudo mkdir /usr/local/lib/nodejs
sudo tar -xJvf node-v8.11.3-linux-x64.tar.xz -C /usr/local/lib/nodejs
sudo mv /usr/local/lib/nodejs/node-v8.11.3-linux-x64 /usr/local/lib/nodejs

2) Set the environment variable sudo nano ~/.profile, add below to the end

# Nodejs
export NODEJS_HOME=/usr/local/lib/nodejs/node-v8.11.3-linux-x64/bin

3) Refresh profile
. ~/.profile
( . is including within command )

4) Test installation using
$ node -v

How to deploy Laravel Project at CPanel without installing Composer

How to deploy Laravel Project at CPanel without installing Composer

1) Generate – Compile the whole project at local and add one php file to run php scripts at Server

system(‘php ../artisan config:clear’);
system(‘php ../artisan config:cache’);
system(‘php ../artisan cache:clear’);
system(‘php ../artisan config:cache’);

2) Upload the whole project to the server at CPanel
3) Create a new subdomain
4) Run the subdomain from the browser
5) Compile the whole project from Browser

5) Run the subdomain / configured domain from browser

Myanmar Font in TC/PDF export in PHP with laravel

You need to download the font ttf file

<?php namespace App\Core;

use Validator;
use Auth;
use DB;
use App\Http\Requests;
use App\Session;
use PDF;

class Utility
// Use Pdf Export
public static function exportPDF($html,$pdfTitle = 'exportPDF')

require_once(base_path() . '/vendor/tecnickcom/tcpdf/include/tcpdf_fonts.php');
$fontname = TCPDF_FONTS::addTTFfont(app_path() .'/Core/Export/Zawgyi-One-20051130.ttf', 'TrueTypeUnicode', '', 32);

// $font1 = PDF::addTTFfont('/home/waiyan/Downloads/Zawgyi-One-20051130.ttf', 'TrueTypeUnicode', '', 8);
PDF::SetFont($fontname, '', 15, '', false);

// set font
//PDF::SetFont('helvetica', '', 12);
PDF::writeHTML($html, true, false, false, false, '');

PDF::Output($pdfTitle . '.pdf');



namespace App\Core\Export;

use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Input;
use App\Core\Config\Config;
use App\Core\Utility;
use PDF;

class ServicePdfGenerator implements IPDFGeneratorInterface
public function generate($paramObj)


$html = <<<EOD

.table_main {
font-size: 10;

.table_border {
border: 1;

ကခဂ ကခဂ ကခဂ ကခဂ


return true;