Skip to content

Latest commit

 

History

History
61 lines (41 loc) · 1.77 KB

readme.md

File metadata and controls

61 lines (41 loc) · 1.77 KB

laravel-mongo Proof Of Concept

Installation

Server Requirements

See here

A working installation of Apache 2.4 or higher with PHP 5.6 or higher. The MongoDB PHP driver installed. You can find installation instructions here

WARNING: The old mongo PHP driver is not supported anymore in versions >= 3.0.

Installing the project

Install Composer if you don't have it installed already.

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

Clone to a directory accessible by the web server. eg. /var/www

git clone https://github.com/fgiannar/laravel-mongo-POC.git

Set up database

Run on a MongoDB shell:

use mongovel
db.createUser(
    {
      user: "mongovel",
      pwd: "mongovel",
      roles: [ "readWrite", "dbAdmin" ]
    }
)

Install dependencies, configure permissions, and configure database

To avoid any issues with the artisan cli tool, the .env mongodb host should be set to 127.0.0.1 instead of 'localhost'. If the mongodb is installed on a separate server this is not required.

cd laravel-mongo-POC
composer install
chmod -R 777 storage
cp .env.example .env
vi .env # set at least database values
php artisan key:generate
php artisan migrate:refresh --seed

Configure Web Server to proper root directory

At this point the application is ready. All we need is to point our web server to the correct directory, eg /var/www/laravel-mongo-POC/public, and restart our web server.

Last thing is to make sure that Apache's mod_rewrite is enabled and that AllowOverride is set to All for our directory.

a2enmod rewrite
service apache2 restart