Definitive guide to install laravel

I want to install laravel on my system. (I already have got php, apache, mariadb and php-apache modules installed).
I could do pacman -S composer and then do composer global require "laravel/installer".
But I wonder if that way all the laravel system requirements are met because on laravel server requirements it says:

However, if you are not using Homestead, you will need to make sure your server meets the following requirements:

PHP >= 7.0.0
OpenSSL PHP Extension
PDO PHP Extension
Mbstring PHP Extension
Tokenizer PHP Extension
XML PHP Extension

You're experience and knowleadge will be appreciated.
And please don't tell me just to install from github because that is what I have read in other posts.
A step by step command tutorial will be great.

You want someone to write a detailed step by step Laravel installation guide for you?

If someone has some knowledge to share I am sure they will help you out, but the Arch way is to research, learn and then write a tutorial or wiki entry for others to learn from.

Apparently it already has been done, just not in writing.

@dannysantos1985 GLHF

https://www.youtube.com/watch?v=d4HRDHwFK_U

Maybe a general note on composer.

Composer will only install php library dependencies. PHP libraries are usually written in php and needed by another php "application".

Composer will not install any php Extension. If it's a Composer platform package it will inform you about something like this. But it will not install a extension.

Check phpinfo(); in a php script if you don't know which extensions you have installed.

I have researched before posting and I got confused that's why this post was born.
My question is:
I want to install laravel and for that I need composer.
For composer I can do sudo pacman -S composer, that's easy. But to install laravel do I need to change something in php.ini before doing composer global require "laravel/installer" since in Laravel's website it says:

?

No. Before using Laravel as a framework maybe.

Did you checked with phpinfo(); in a php script which extensions are installed and enabled? If not, do it and your question is answered.

use php -m for show modules list, after you can add somes in .ini

with apache not edit /etc/php/php.ini but add your php.ini (or laravel.ini) with only your additions in /etc/php/conf.d/
/etc/php/conf.d/php.ini

; one exemple
[php]
memory_limit = 2628M
display_errors = On
extension=sodium
extension=gd
extension=iconv
; extension=mysqli
extension=xmlrpc

ps: we have php 7.2 not add .so

1 Like

I use vagrant with Homestead.
I do it to isolate the development environment and to be able to adjust it to a future production environment.

Vagrant works for ruby, python or php.

If you're going to start doing any web development please read up on how server-side web applications work first, e.g. http://php.net/docs.php

Just copying and pasting some commands then running headlong into PHP development without any idea of how the tooling works is going to end up with you deploying code in an environment that "only-just works" but which is woefully insecure (see also: people using XAMMP).

I also suggest you start with something like OWASP's Top 10 Security Risks for 2017 and associated cheat sheet. These are complicated - but you should research what these all mean before writing some software that "works" but is vulnerable.

For installing and running PHP under Manjaro/Arch, have a read of https://wiki.archlinux.org/index.php/PHP, but keep in mind pretty much noone deploys to an Arch-based server, so you might be better with a CentOS virtual machine (or as @dagorret suggests, use vagrant).

3 Likes

I did this and checked that every system requirement for laravel comes "out of the box" with a php install.
So, for future information to people, to install laravel 5.5 all you have to do is:
sudo pacman -S php apache php-apache mariadb   -> installs your server and database
sudo pacman -S composer   -> installs composer (needed for laravel to work)
composer global require "laravel/installer"
and then to have do:
echo 'export PATH="$HOME/.config/composer/vendor/bin:$PATH"' >> .bashrc
to add laravel executable to your PATH.
Now just quit the terminal and enter it again and you have laravel on your system :wink:

6 Likes

MAN you saved me, thnx

1 Like

A post was split to a new topic: How to install PHP?

8 posts were split to a new topic: How to run PHP commands directly in the terminal

thanks

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.

Forum kindly sponsored by