Hello, @gkdev
Greetings!
As you confirmed, you were previously working on the master branch, which contains the newer Bagisto 2.5 version, and then switched to the 2.4 branch.
Please note that once Bagisto has been installed, you cannot move back to an older version simply by switching branches. If you need to use the older branch/code, you will need to reinstall Bagisto using the required version.
If your project contains any production data, we strongly recommend that you do not downgrade or switch to an older version, as the database structure of a newer Bagisto version may not be compatible with an older version.
If you do not have any production data and want to start with a fresh Bagisto 2.4 installation, you can clone the Bagisto 2.4 branch and install it using:
composer install
php artisan bagisto:install
Note: If you have any important data, customizations, or changes, please make sure to take a complete backup before reinstalling.
Also, please note that the database of a newer Bagisto version cannot simply be used with an older Bagisto version, as the database structure and migrations may differ between versions.
Regarding the 403 Forbidden Error
The 403 Forbidden error is generally related to server configuration or file permissions. Please ensure that the web-server user has the required read/write permissions for the Bagisto application directories.
For a standard Linux server using www-data as the web-server user, you can use the following commands from the Bagisto project directory:
sudo chown -R www-data:www-data storage bootstrap/cache
sudo chmod -R 775 storage bootstrap/cache
If your web server uses a different user, such as nginx or nobody, replace www-data with the appropriate web-server user.
You can check the web-server user based on your server configuration/processes before applying the ownership command.
If the issue persists, you can also ensure that the Bagisto project directories are accessible by the web server:
sudo chmod -R 755 /path/to/bagisto
sudo chmod -R 775 /path/to/bagisto/storage
sudo chmod -R 775 /path/to/bagisto/bootstrap/cache
Please replace /path/to/bagisto with your actual Bagisto project path.
After updating the permissions, clear the application cache:
php artisan optimize:clear
Important: We recommend avoiding chmod -R 777 on the Bagisto project, as it provides unnecessarily broad permissions and is not recommended for a production server.
Thank you.
Aviral
Team Bagisto