How To Install Laravel On Ubuntu 16.04 With Phpmyadmin and Mysql8 min read
Laravel is an open-source php web technology. I have to show how to install Laravel on your ubuntu 16.04 with mysql and phpmyadmin for database configuration. Mainly PHP is a server side oriented language. At the present many CMS web site created by PHP language such as WordPress, Joomla, Durpal, October, BBPress and many more. Upto 5o + CMS web site created by PHP language.
★ How To Configure Static IP address On Ubuntu 18.04
★ How To Install Zabbix Server On Ubuntu 18.04
Step #01: At first your machine ready for update and upgrade.
[email protected]:~# apt-get update && apt-get update -y
Step #02: Install python software.
[email protected]:~# apt-get install python-software-properties
Step #03: Add PHP repository for correctly installation PHP packages.
[email protected]:~# add-apt-repository ppa:ondrej/php
Check update your package
[email protected]:~# apt-get update
Step #04: Now install php packages. All package in one line.
[email protected]:~# apt install php7.1 php7.1-xml php7.1-mbstring php7.1-mysql php7.1-json php7.1-curl php7.1-cli php7.1-common php7.1-mcrypt php7.1-gd libapache2-mod-php7.1 php7.1-zip
Check apache2 server if don’t install.
[email protected]:~# apt-get install apache2
Step #05: Install mysql database server.
[email protected]:~# apt-get install mysql-server
Laravel used as composer must be run standard user. So at first create one user with password.
Step #06: Create new User for run composer.
[email protected]:~# adduser techrss
Add your user info or not.
Download composer command below.
[email protected]$ curl -sS https://getcomposer.org/installer | php
Move composer on the local bin folder. So must be using as root user for move composer.
[email protected]:# mv composer.phar /usr/local/bin/composer
Complete full permission for run composer file.
[email protected]:~# chmod +x /usr/local/bin/composer
Step #07: Goto www directory cd /var/www/ then download Laravel full file from git repo.
[email protected]:/var/www# git clone https://github.com/laravel/laravel.git
Then create permission www directory
[email protected]:/var/www# chmod -R 777 /var/www/
[email protected]:/var/www# chown -R www-data:www-data /var/www/
Switch create user for run composer.
[email protected]:/var/www/laravel# su techrss
Now installing composer
[email protected]:/var/www/laravel$ composer install
If you can see error
Failed to decode response: zlib_decode(): data error
Retrying with degraded mode, check https://getcomposer.org/doc/articles/troubleshooting.md#degraded-mode for more info
[email protected]:/var/www/laravel$ su root
Then fix this error. Run below command for disable ipv6.
[email protected]:/var/www/laravel# sh -c “echo ‘precedence ::ffff:0:0/96 100’ >> /etc/gai.conf”
[email protected]:/var/www/laravel$ su root
[email protected]:/var/www/laravel$ composer install
Wait for at least 30 minutes see below image.
Step #08: Change sample env file and generate artisan key command below.
[email protected]:/var/www/laravel$ su root
[email protected]:/var/www/laravel# mv .env.example .env
[email protected]:/var/www/laravel# php artisan key:generate
Application key [base64:U8N2p37022gFviYEp/A1CLXXocXg9DfiW99JXv1KG2I=] set successfully.
Insert generated key into app.php file.
'key' => env('APP_KEY', 'U8N2p37022gFviYEp/A1CLXXocXg9DfiW99JXv1KG2I='), 'cipher' => 'AES-256-CBC',
[email protected]:/var/www/laravel# vi /config/app.php
[email protected]:/var/www/laravel# cd /etc/apache2/sites-available
Create laravel.conf file or open laravel.conf file then save it.
touch laravel.conf
[email protected]:/etc/apache2/sites-available# vi laravel.conf
<VirtualHost *:80> ServerName http://10.66.50.20 DocumentRoot /var/www/laravel/public ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined Options Includes <Directory "/var/www/laravel/public"> AllowOverride All </Directory> </VirtualHost>
Reload new conf file and apache2 web server.
[email protected]:/etc/apache2/sites-available# a2ensite laravel.conf
[email protected]:/etc/apache2/sites-available# service apache2 reload
Got root home directory goto root home directory
[email protected]:/etc/apache2/sites-available# cd
Install phpmyadmin for manage mysql database from web gui
Step #09: Run phpmyadmin command from terminal.
[email protected]:# apt install phpmyadmin -y
Please choose the web server that should be automatically configured to run phpmyadmin.
Web server to reconfigure automatically:
[*] apache2
[] lighttpd
Then select package configuration Yes
Once after few times then create mysql root password.
Please provide a password for phpmyadmin to register with the database server. If left blank, a random password will be generated.
Mysql application password for phpmyadmin:
Again confirm mysql root password.
Reload phpmod command below.
[email protected]:~# phpenmod mcrypt
[email protected]:~# phpenmod mbstring
Reload apache2 web server
[email protected]:~# systemctl reload apache2
Successfully installation process completed.
Now goto your using browser and type your server IP address then show as like below:
If face any problem then see my YouTube video and Subscribe my channel. Please subscribe my channel for more update.
- 9 Ways to Speed Up Your MacBook Yosemite - February 21, 2023
- How To Install GitLab CE on Ubuntu 22.04 - December 15, 2022
- 7 Things to Know About Laptop Internet Cards - October 26, 2022
We really appreciate for your support for buying me a coffee.
It takes us a while to compose and upload new content, as they have to be checked to see if Properly works. We appreciate you if you help me for one cup of coffee to keep us awake and always deliver good quality content.
No contribution is small of an amount. We are grateful for any amount you support us with. Thank you!