Starting with Laravel on Ubuntu

Starting with laravel on ubuntu

Final Update

I finally solved it, what happened was that the laravel folder was read protected, what i had to do was to set chmod 755 -R laravel and then chmod -R o+w storage and voila i had laravel up and running, thanks to everybody that contributed.

setting up existing laravel project in Ubuntu

Some of things you need to consider for new setup. If you have setup git repo then

  1. You can just pull from git If not copy/paste all folders except vendor, node_modules.
  2. Use composer install to make vendor folder
  3. Use npm install to make node_modules folder if you already using
  4. Use php artisan migrate to make database structure
  5. Use php artisan db:seed if you set any seeding to fill tables data
  6. Use php artisan key:generate to make security.
  7. Create/Update .env file to make work configuration from environment

Now you have to point your domain with root folder of laravel you created here.

How to move laravel project to localhost in ubuntu?

First install Xampp for linux https://www.apachefriends.org/download.html

Then install it and change permission :

chmod 755 xampp-linux-*-installer.run
sudo ./xampp-linux-*-installer.run

This will open the installer and just click “next” and it will install xampp files in /opt/lampp folder. You should first check if lampp is functioning properly. To test this,

  sudo /opt/lampp/lampp start

Let it start everything for you. Now just go to http://localhost and see it is working. We will need to setup security settings as well.

  sudo /opt/lampp/lampp security

Set all the passwords etc, and you are done!

Now you install composer :

 curl -sS https://getcomposer.org/installer | php
sudo mv composer.phar /usr/local/bin/composer

Now you need to get important dependencies of laravel - mcrypt.

  sudo apt-get install php5-mcrypt php5-json

And now run:

  sudo php5enmod mcrypt

To make sure it is running,

    php -i | grep mcrypt

It will output

    .......
mcrypt support => enabled
mcrypt_filter support => enabled
.......

Now go to htdocs folder inside lampp and place your laravel project and it will work .

I have a problem installing laravel on ubuntu

You are missing the mbstring in your SO:

Install the package:

sudo apt-get install php7.2-mbstring

Restart Server:

sudo service apache2 restart
or
sudo service nginx restart

Now you should see mbstring as enabled in a file with below code:

<?php echo phpinfo(); ?>

How to install laravel 5.6 in ubuntu 16.04?

You need to,

Install mbstring:

sudo apt-get install php7.1-mbstring
sudo apt-get install libapache2-mod-php7.1

and then,

Restart your server:

sudo service apache2 restart
or
sudo service nginx restart

To solve the error with composer, run:

sudo composer self-update

sudo composer clear-cache

sudo composer config -g secure-http false

install laravel on a system running both windows 10 and ubuntu 17.04

Linux Ubuntu and Fedora require kernel-headers package which is not shipped with fresh installation.

For Ubuntu run: sudo apt-get install build-essential linux-headers-`uname -r` dkms

For Fedora run: sudo yum install kernel-devel

Laravel 5 Installation in Ubuntu: laravel command not found

Got fixed after setting path for composer vendors.So the correct step which worked is,

Download laravel installer: composer global require "laravel/installer=~1.1"

Setup PATH: export PATH="~/.composer/vendor/bin:$PATH"

Then run command : laravel new project-name or sudo laravel new project-name

For mac,

echo 'export PATH="$HOME/.composer/vendor/bin:$PATH"' > ~/.bashrc
source ~/.bashrc

Ubuntu 16.04 with latest laravel installer

Install composer if not exists,

php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('SHA384', 'composer-setup.php') === '55d6ead61b29c7bdee5cccfb50076874187bd9f21f65d8991d46ec5cc90518f447387fb9f76ebae1fbbacf329e583e30') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php
php -r "unlink('composer-setup.php');"
sudo mv composer.phar /usr/local/bin/composer

Install laravel installer,

composer global require "laravel/installer"

Edit environment config,

nano .bashrc

Then add,

export PATH="$PATH:$HOME/.config/composer/vendor/bin"

Then reload path config,

source ~/.bashrc

Ubuntu 17.04 and 17.10:

export PATH="~/.config/composer/vendor/bin:$PATH"

Ubuntu 18.04

export PATH="$HOME/.composer/vendor/bin:$PATH"


Related Topics



Leave a reply



Submit