Header background

Installation

Farjanul Nayem

Written by Farjanul Nayem

Last updated

Server Requirements:

  • Php 8.2

  • Laravel 10

  • MySQL 8.x

  • BCMath

  • Ctype

  • cURL

  • DOM

  • Intl

  • Fileinfo

  • JSON

  • Mbstring

  • OpenSSL

  • PCRE

  • PDO

  • Tokenizer

  • XML

  • ZIP

  • GD

  • PDO_MYSQL

  • Apache

  • mod_rewrite


Cpanel Installation

See the video: https://www.youtube.com/embed/LSLEd9wmJio


Manual Installation

See the video: https://www.youtube.com/watch?v=GFzoIlKhxzI


Ngnix Config AWS, Digital Ocean, GCP, Azure or Others

server {
    listen 80;
    server_name yourdomain.com; # Replace with your domain or server IP
    root /path/to/your/laravel/public; # Replace with the full path to the public folder of your Laravel app

    index index.php;

    error_log /var/log/nginx/laravel_error.log;
    access_log /var/log/nginx/laravel_access.log;

    location / {
        try_files $uri $uri/ /index.php?$query_string;
    }

    location ~ \.php$ {
        include fastcgi_params;
        fastcgi_pass unix:/var/run/php/php8.2-fpm.sock;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_index index.php;
    }

    location ~ /\.ht {
        deny all;
    }

    location ~ /\.(env|git|svn|htaccess|DS_Store) {
        deny all;
    }
}

Ubuntu Set Permission (If Need)

Set Ownership Assign ownership of your Laravel project to the web server user (usually www-data):

sudo chown -R www-data:www-data /path/to/your/laravel

Set Permissions Ensure the storage and bootstrap/cache directories are writable:

sudo chmod -R 775 /path/to/your/laravel/storage /path/to/your/laravel/bootstrap/cache

Alternative Permissions (for stricter environments) If you want to grant only the necessary permissions:

sudo find /path/to/your/laravel/storage -type d -exec chmod 775 {} \;
sudo find /path/to/your/laravel/storage -type f -exec chmod 664 {} \;
sudo find /path/to/your/laravel/bootstrap/cache -type d -exec chmod 775 {} \;
sudo find /path/to/your/laravel/bootstrap/cache -type f -exec chmod 664 {} \;

Optional: Assign Group Permissions You can add your user to the www-data group for easier management:

sudo usermod -a -G www-data your-username

Production Recommendation

Disable Debug Mode:
Set APP_DEBUG=false in the .env file for production environments.


For Better Performance (If you need):

php artisan config:cache
php artisan route:cache