Knowledge base
1000 FAQs, 500 tutorials and explanatory videos. Here, there are only solutions!
Install Laravel on Infomaniak hosting
This guide concerns Laravel, an open-source web framework written in PHP following the model-view-controller (MVC) principle. Also refer to their documentation.
For additional help, contact a partner or launch a free tender — also discover the role of the host.
Prerequisites
- Have a Shared Web Hosting or Cloud Server with the latest MySQL/MariaDB.
- Site running PHP 8.2.
- Create an SSH access.
- Create a database.
Installation of Laravel 11
For this:
- Log in to the server via SSH (need help?).
- Navigate to the site directory by running the command “cd chemin-vers-le-site” (for example
cd sites/laravel.domain.xyz
). - Create a new project by running the command
composer create-project laravel/laravel example-app
. - Modify the
.env
file at the root of the hosting to update the connection parameters for the new database:- DB_CONNECTION=mysql
- DB_HOST=xxxx.myd.infomaniak.com
- DB_PORT=3306
- DB_DATABASE= the name of the MySQL database (xxxx_newbdd)
- DB_USERNAME= the MySQL user with rights to this database
- DB_PASSWORD= its password
- Navigate to the project directory and publish via SSH:
cd example-app
php artisan migrate
- Modify the target directory to point to the "public" subdirectory of the project, here
/sites/laravel.domain.xyz/example-app/public
.
Link to this FAQ: