News about our company, tutorials about IT and much more you will find in this page.
Laravel is one of the PHP language frameworks designed for web application development and works on an MVC basis. The Laravel Framework makes it easy to program PHP web applications and makes PHP projects easy to develop.
The Laravel framework is built on various components of the Symfony framework and gives your program a great base of reliable and tested code if you install Laravel.
Laravel provides a collection of the best solutions with meaningful and creative syntax that are done right. As a result, by simplifying common tasks such as authentication, routing, sessions, working with databases, etc.
Which is used in almost all web projects. Laravel reduces development problems for both the developer and the client. Laravel, Symphony, KickPh, and Igniter code are some of the most popular PHP language frameworks, which test their popularity on Google Trend, reflecting the growing growth of Laravel frameworks.
If you need the Laravel framework and do not know where to start, this article is for you, and you can learn Laravel step by step, but keep in mind that you must have a Linux VPS with a CentOS distribution. Installed. Because in this tutorial, we will teach Laravel on Santos 7.
If you do not have a Linux VPS server, I suggest you buy from OperaVPS so that if you encounter any problems during the installation process, our team can solve the problem for you.
From the link I mentioned below, you can buy a Linux VPS server and start the Laravel installation tutorial: https://evoluso.com/
First of all, we need to add REMI and EPEL rpm repositories to the Centos system. These containers have updated packages.
Connect to VPS with Putty and run the below command:
rpm -Uvh http://dl.fedoraproject.org/pub/epel/7/x86_64/Packages/e/epel-release-7-11.noarch.rpm
Then
rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
Here is a brief guide to installing LAMP. You need to run the Laravel framework on your CentOS system.
Use this command to install Apache.
yum --enablerepo=remi,epel install httpd
To install MySQL, use the following commands.
yum --enablerepo=remi,epel install mysql-server
Then
service mysqld start
Then
/usr/bin/mysql_secure_installation
To install PHP using the following command.
yum --enablerepo=remi,epel install php php-zip php-mysql php-mcrypt php-xml php-mbstring
Then restart the Apache.
service httpd restart
Composer is required to install Laravel, and one of Laravel’s prerequisites is to install.
You can install Composer using the following commands.
curl -sS https://getcomposer.org/installer | php
Then
mv composer.phar /usr/bin/composer
Then
chmod +x /usr/bin/composer
You can install the latest version of Laurel using the following command.
cd /var/www
Then
git clone https://github.com/laravel/laravel.git
After entering the above command, use Composer to solve the Laravel prerequisite problem.
cd /var/www/laravel
Then
composer install
The prerequisite installation is a bit long but wait until it’s fully installed and enter the following commands.
chown -R apache.apache /var/www/laravel
Then
chmod -R 755 /var/www/laravel
Then
chmod -R 755 /var/www/laravel/storage
Use the command to write to the storage directory.
chcon -R -t httpd_sys_rw_content_t /var/www/laravel/storage
Laravel uses the .evn file to configure the environment. Use the .evn file to configure all the environment variables for your program, such as database, SMTP, security key, etc.
cp .env.example .env
Now set the 32-bit random encryption key given to you by the Illuminati Encryption Service.
php artisan key:generate
Then
Application key set successfully.
Now add a virtual host to your Apache configuration file to access Laravel through the web browser.
To do this, edit the Apache /etc/httpd/conf/httpd.conf configuration file and add the following code at the end of the file.
Enter the following command to edit the Apache configuration file
vim /etc/httpd/conf/httpd.conf
Put the following command in this file.
<VirtualHost *:80>
ServerName laravel.example.com
DocumentRoot /var/www/laravel/public
<Directory /var/www/laravel>
AllowOverride All
</Directory>
</VirtualHost>
Restart the Apache service, access Laravel using your favorite web browser, and start developing a great web application.
Use the following command to restart the Apache service.
service httpd restart
Artisan is a robust command-line interface that comes pre-installed with Laravel. On your machine, open the command line terminal. Navigate to the directory containing your Laravel application. Then, using the PHP artisan command, verify the Laravel version.
php artisan --version
Now access your Laravel website in a web browser using the server name that we have defined.
The username that we have used is laravel.example.com