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
——————————————————-
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 တစ္ခုတည္ေဆာက္ၿပီး
<?php
phpinfo();
?>
ဆုိၿပီး သိမ္းဆည္းလိုက္ပါ။ ၿပီးလွ်င္ 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
20190921
Advertisements

JHipster

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 :: https://www.jhipster.tech/installation/

 

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”

Solution:

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

http://thisinterestsme.com

Programming and development site
https://www.geeksforgeeks.org/

Unofficial Solutions to the Training by Codility

http://a4academics.com/interview-questions/53-database-and-sql/397-top-100-database-sql-interview-questions-and-answers-examples-queries?showall=&limitstart=

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

Solution

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’, ‘127.0.0.1’),
‘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’

Cheers

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

VERSION=v8.11.3
DISTRO=linux-x64
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
export PATH=$NODEJS_HOME:$PATH

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
/project_name/public/to_compile_again.php

<?php
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
eg
http://test.aceinspirationtest.webstarterz.com/to_compile_again.php

5) Run the subdomain / configured domain from browser