How to install

1. Requirements
2. Installation
3. Configuration
3.a. Setup on server
3.b. For shared-host service
1. Requirements

- PHP ^7.3|^8.0 (S-Cart 6.x)
- PHP ^8.0.2 (S-Cart 7.x)
- PHP ^8.1 (S-Cart 8.x)
- OpenSSL PHP Extension
- PDO PHP Extension
- Mbstring PHP Extension
- Tokenizer PHP Extension
- XML PHP Extension
- Ctype PHP Extension
- JSON PHP Extension


2. Installation
Step 1: Download S-Cart  here 

SCart-folder/
├── app
├── databases
├── public
│     ├── index.php
│     └── install.php
├── resources
└──...

Step 2: Make sure the directories and its subdirectories are writable: storage,  vendor, public/data
Step 3: Install vendor (If the source code does not have a vendor folder)
Access to folder S-Cart, run commandline:

php composer.phar install

After successful vendor installation, "vendor" folder will appear

Step 4: Create a new database
Step 5: Create virtual host, then point domain to folder s-cart-folder/public
(In case of automatic s-cart installation via php artisan serve, please delete or rename the .env file if it exists, as it may cause errors during installation)
Step 6: Then, access link your-domain.com/install.php to install automatic.

Video install SCart automatic:

 
(If the automatic installation fails, please see the manual installation guide below.)
Step 6: Please remove or rename file public/install.php.
Video guide: HERE

OR manual installation:

- Step1: Create database, then import file .sql in folder database or  /vendor/s-cart/core/src/DB/s-cart-yyyy-mm-dd.sql to database.
- Step2: Rename or delete file public/install.php
- Step3: Copy file .env.example to .env if file .env not exist.
- Step4: Generate API key if APP_KEY is null. 
  Use command "php artisan key:generate"
- Step5: Generates the encryption keys. 
  Use command "php artisan passport:keys"
- Step6: Config value of file .env:
APP_DEBUG=false (Set "false" is security)
DB_HOST=127.0.0.1 (Database host)
DB_PORT=3306 (Database port)
DB_DATABASE=s-cart (Database name)
DB_USERNAME=root (User name use database)
DB_PASSWORD= (Password connect to database)
APP_URL=http://localhost (Your url)
ADMIN_PREFIX=sc_admin (Path to admin)
DB_PREFIX=sc_ (Must be "sc_" because it is fixed in the .sql file)

Video install manual:



3. Configuration
- Make sure the directories and its subdirectories are writable: vendor, storage, public/data, app/Plugins
- Make sure the virtual host of the website points to the public directory.
- Link admin: your-domain/sc_admin. User/pass default admin/admin.

3.a. Setup on server
(*)Please make sure your virtual host points to s-cart's "public" directory. You can refer to the vhost configuration as below:
For websever Nginx

server {
        listen 80;
        root /home/domain/you-domain.com/public/;
        index index.php index.html index.htm;
        server_name your-domain.com;
        location / {
                try_files $uri $uri/ /index.php?$query_string;
        }
        location ~ \.php$ {
                try_files $uri =404;
                fastcgi_split_path_info ^(.+\.php)(/.+)$;
                fastcgi_pass unix:/run/php-fpm/php-fpm.sock;
                fastcgi_index index.php;
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                include fastcgi_params;
        }
}

For websever Apache

 ServerAdmin your-domain.com
 DocumentRoot "C:\xampp\htdocs\s-cart/public"
 ServerName your-domain.com


3.b For shared-host service:  
Because you do not have editing rights on the server, so before installing SCart, contact the vendor.
Make sure the hosting service you are using supports website built with Laravel (which is the foundation of SCart).
The website must point to the "Folder-SCart/public".

Related topics

Latest Document