Knowledge base
1000 FAQs, 500 tutorials and explanatory videos. Here, there are only solutions!
Install Laravel on Infomaniak accommodation
This guide concerns: Laravel, an open-source web framework written in PHP respecting the model-view-controller principle (MVC). Also take note of their documentation.
For additional assistance contact a partner or launch a call for tenders free of charge — discover also the The role of the host.
Prerequisites
- Owning a Shared Web Hosting or Cloud Server with the latest MySQL/MariaDB.
- Site under PHP 8.2.
- Create a SSH access.
- Create a database.
Installation of Laravel 11
To this end:
- Log in to the SSH server (Need help?).
- Place yourself in the site directory by executing the command
cd chemin-vers-le-site
(e.g.cd sites/laravel.domain.xyz
). - Create a new project by running the command
composer create-project laravel/laravel example-app
. Edit File
.env
at the root of the hosting to update the connection settings to the new database:DB_CONNECTION=mysql DB_HOST=xxxx.myd.infomaniak.com DB_PORT=3306 DB_DATABASE= le nom de la base de données MySQL (xxxx_newbdd) DB_USERNAME= l’utilisateur MySQL avec les droits sur cette base DB_PASSWORD= son mot de passe
- Place yourself in the project directory and publish via SSH:
cd example-app
php artisan migrate
- Edit Target Directory to point it in the "public" subdirectory of the project, here
/sites/laravel.domain.xyz/example-app/public
.
Link to this FAQ: