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.
root@Ubuntu-Serv16:~# apt-get update && apt-get update -y
Step #02: Install python software.
root@Ubuntu-Serv16:~# apt-get install python-software-properties
Step #03: Add PHP repository for correctly installation PHP packages.
root@Ubuntu-Serv16:~# add-apt-repository ppa:ondrej/php
Check update your package
root@Ubuntu-Serv16:~# apt-get update
Step #04: Now install php packages. All package in one line.
root@Ubuntu-Serv16:~# 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.
root@Ubuntu-Serv16:~# apt-get install apache2
Step #05: Install mysql database server.
root@Ubuntu-Serv16:~# 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.
root@Ubuntu-Serv16:~# adduser techrss
Add your user info or not.
Download composer command below.
root@Ubuntu-Serv16$ curl -sS https://getcomposer.org/installer | php
Move composer on the local bin folder. So must be using as root user for move composer.
root@Ubuntu-Serv16:# mv composer.phar /usr/local/bin/composer
Complete full permission for run composer file.
root@Ubuntu-Serv16:~# chmod +x /usr/local/bin/composer
Step #07: Goto www directory cd /var/www/ then download Laravel full file from git repo.
root@Ubuntu-Serv16:/var/www# git clone https://github.com/laravel/laravel.git
Then create permission www directory
root@Ubuntu-Serv16:/var/www# chmod -R 777 /var/www/
root@Ubuntu-Serv16:/var/www# chown -R www-data:www-data /var/www/
Switch create user for run composer.
root@Ubuntu-Serv16:/var/www/laravel# su techrss
Now installing composer
techrss@Ubuntu-Serv16:/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
techrss@Ubuntu-Serv16:/var/www/laravel$ su root
Then fix this error. Run below command for disable ipv6.
root@Ubuntu-Serv16:/var/www/laravel# sh -c “echo ‘precedence ::ffff:0:0/96 100’ >> /etc/gai.conf”
techrss@Ubuntu-Serv16:/var/www/laravel$ su root
techrss@Ubuntu-Serv16:/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.
techrss@Ubuntu-Serv16:/var/www/laravel$ su root
root@Ubuntu-Serv16:/var/www/laravel# mv .env.example .env
root@Ubuntu-Serv16:/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',
root@Ubuntu-Serv16:/var/www/laravel# vi /config/app.php
root@Ubuntu-Serv16:/var/www/laravel# cd /etc/apache2/sites-available
Create laravel.conf file or open laravel.conf file then save it.
touch laravel.conf
root@Ubuntu-Serv16:/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.
root@Ubuntu-Serv16:/etc/apache2/sites-available# a2ensite laravel.conf
root@Ubuntu-Serv16:/etc/apache2/sites-available# service apache2 reload
Got root home directory goto root home directory
root@Ubuntu-Serv16:/etc/apache2/sites-available# cd
Install phpmyadmin for manage mysql database from web gui
Step #09: Run phpmyadmin command from terminal.
root@Ubuntu-Serv16:# 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.
root@Ubuntu-Serv16:~# phpenmod mcrypt
root@Ubuntu-Serv16:~# phpenmod mbstring
Reload apache2 web server
root@Ubuntu-Serv16:~# 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.
- How To Install Zabbix Server 6.4 On AlmaLinux 8 Server - August 9, 2024
- How To Clear RAM Memory Cache Buffer Linux Server - February 29, 2024
- How To Install Apache Cloud Stack Management Server 4.17 On Ubuntu 22.04 - February 1, 2024
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!