How to install Laravel PHP Framework on OpenSUSE 15?

0
213
Programming
Programming

OpenSUSE is a Linux distribution, sponsored by SUSE. It is a great new distribution, stable and with outstanding tools like Yast. That’s why more and more developers are using it as their main system, which indicates its broad functionality. So, I will teach you how to install Laravel PHP Framework on OpenSUSE 15.

As you know, we like Laravel, and that’s why we talked about it here. In case you don’t know, Laravel is a PHP framework that pays a lot of mind to the application code. That is to say, it stands out for being very understandable to the user, without leaving aside the speed and security of the data.

So, let’s start to install Laravel PHP Framework on OpenSUSE 15. It’s simple.

0. Prerequisites

The installation of Laravel, should not cost much work, however, there are a series of minimum requirements to be able to do the procedure in the best possible way. First of all, it is necessary to know the Linux terminal.

On the other hand, your user must be able to use sudo because packages have to be installed and permission as root is required.

Finally, your computer must be able to run PHP and Apache. Don’t worry, any modern computer should.

1. Upgrade OpenSUSE

The first step to install Laravel PHP on OpenSUSE 15 is to upgrade the operating system. It is recommended to do this at all times.

1.- Upgrade OpenSUSE
1.- Upgrade OpenSUSE

With this your system will have the latest security patches and will be more robust.

2. Install Apache web server

Now you need to install Apache to be able to work more comfortably on your project. To do this, run on a terminal:

2.- Install Apache
2.- Install Apache

Next, enable and start the service.

3.- Start Apache
3.- Start Apache

Set the firewall rule for Apache.

4.- Set the firewall rule
4.- Set the firewall rule

Now, open your web browser and go to http://IP_SERVER. You will see this.

5.- Apache default page
5.- Apache default page

The image says we don’t have permission to access Apache’s root. Don’t worry, that’s OpenSUSE policy and for now I won’t modify it. So, Apache is installed.

2. Install MariaDB

If you are going to develop in Laravel, you will need a database manager. Laravel supports several, but I will install MariaDB.

6.- Install MariaDB
6.- Install MariaDB

When the installation is complete. It is necessary to start the MariaDB service. Then, it is time to define a root password using the mysql_secure_installation script.

7.- Start the MariaDB service
7.- Start the MariaDB service

8.- Using mysql_secure_installation script
8.- Using mysql_secure_installation script

After defining the root password, you will be asked some questions regarding the configuration of the MariaDB server. You can answer as you like, I did it this way.

3. Install PHP

The latest stable version of Laravel requires at least PHP 7.1. It’s a good version. In OpenSUSE 15 version 7.2 is available via official repositories. So there are no problems.

9.- Insall PHP
9.- Insall PHP

As you can see, I have also installed some PHP modules required by Laravel.

Then, enable PHP module and restart Apache2.

4. Install Laravel PHP Framework

A simple and efficient way to install Laravel PHP Framework on any Linux distribution is with Composer.

Composer is a PHP dependency manager that greatly simplifies the handling of dependencies. So, let’s install it first.

10.- Installing Composer
10.- Installing Composer

Next, create a new Laravel project.

11.- Install Laravel PHP Framework
11.- Install Laravel PHP Framework

Of course, replace example with the name of your project.

12.- Laravel is installed
12.- Laravel is installed

Next, serve your project.

This will serve you project on http://localhost:8000. However, you can serve the project with a specific host and port. But you have to open the ports.

13.- Serve the project
13.- Serve the project

Now, open your web browser and go to http://IP_SERVER:8765/. Or http://localhost:8000 depending on the case.

14.- Laravel default page
14.- Laravel default page

And that’s it.

Conclusion

The installation of Laravel is something simple that can be achieved after a few minutes. Laravel is a very powerful framework that more and more people are using.

Please share this post with your friends.

Spread the love
  • 6
    Shares

PS. If you like this post please share it with your friends on the social networks using the buttons above.Thanks.

LEAVE A REPLY

Please enter your comment!
Please enter your name here