Skip to main content

Prerequisites

Before installing Ecom, ensure your system meets the following requirements:
System Requirements:
  • PHP >= 8.0.2
  • Composer
  • MySQL >= 5.7 or PostgreSQL >= 9.6
  • Node.js >= 14.x and NPM
  • Web server (Apache/Nginx)

Required PHP Extensions

The following PHP extensions must be installed and enabled:
  • OpenSSL PHP Extension
  • PDO PHP Extension
  • Mbstring PHP Extension
  • Tokenizer PHP Extension
  • XML PHP Extension
  • Ctype PHP Extension
  • JSON PHP Extension
  • BCMath PHP Extension
  • Fileinfo PHP Extension
  • GD PHP Extension

Installation Steps

1

Clone or Download the Repository

Download the Ecom source code to your local machine or server.
# If using git
git clone <repository-url> ecom
cd ecom
2

Install PHP Dependencies

Install all required PHP packages using Composer:
composer install
This will install all dependencies defined in composer.json, including:
  • Laravel Framework 9.2
  • Payment gateway packages (Stripe, PayPal, Razorpay, etc.)
  • Image processing (Intervention Image)
  • PDF generation (mPDF, Laravel PDF)
  • Excel support (Maatwebsite Excel)
  • And 30+ other packages
The installation may take several minutes depending on your internet connection.
3

Create Environment File

Copy the example environment file and configure it:
cp .env.example .env
The .env file will be automatically created if it doesn’t exist during the post-install process.
4

Generate Application Key

Generate a unique application encryption key:
php artisan key:generate
This key is used by Laravel’s encrypter service. Keep this key secure and never commit it to version control.
The key will be automatically set in your .env file as APP_KEY.
5

Configure Database

Edit your .env file and update the database configuration:
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=your_database_name
DB_USERNAME=your_database_user
DB_PASSWORD=your_database_password
Ecom supports multiple database systems:
  • MySQL (recommended)
  • PostgreSQL
  • SQLite
  • SQL Server
6

Run Database Migrations

Create all necessary database tables:
php artisan migrate
This will create tables including:
  • users - User accounts
  • products - Product catalog
  • product_queries - Customer questions
  • password_resets - Password reset tokens
  • And many more e-commerce tables
7

Seed Database (Optional)

If you want to populate the database with sample data:
php artisan db:seed
Seeding is optional and typically used for development/testing environments.
8

Set Proper Permissions

Set the correct file permissions for storage and cache:
chmod -R 775 storage bootstrap/cache
chown -R www-data:www-data storage bootstrap/cache
Proper permissions are critical for file uploads, caching, and logging.
9

Install Frontend Dependencies (Optional)

If you plan to modify frontend assets, install Node.js dependencies:
npm install
npm run dev
For production builds:
npm run production
10

Clear Configuration Cache

Clear and rebuild the configuration cache:
php artisan config:clear
php artisan cache:clear
php artisan view:clear
11

Start Development Server

For local development, start the Laravel development server:
php artisan serve
Your application will be available at http://localhost:8000
For production deployment, see the Deployment Guide.

Post-Installation

After successful installation:
  1. Visit your application URL
  2. Complete the initial setup wizard (if available)
  3. Configure payment gateways in the admin panel
  4. Set up email configuration
  5. Configure storage settings

Troubleshooting

Ensure you have PHP 8.0.2 or higher installed:
php -v
Update Composer to the latest version:
composer self-update
Make sure the web server user has write access to storage and cache directories:
sudo chown -R www-data:www-data storage bootstrap/cache
sudo chmod -R 775 storage bootstrap/cache
Ensure your database exists and credentials are correct in .env:
# Test database connection
php artisan migrate:status
Check your web server error logs and ensure:
  • Storage directory is writable
  • APP_KEY is set in .env
  • All required PHP extensions are installed
php artisan optimize:clear

Next Steps

Configuration

Configure application settings

Environment Setup

Set up environment variables

Database Setup

Learn about database configuration

Deployment

Deploy to production

Build docs developers (and LLMs) love