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) architectural pattern. Also, read their documentation.
⚠️ For additional help, contact a partner or submit a request for proposal — also read the role of the host.
Prerequisites
- have a Shared Web Hosting or Managed Cloud Server with the latest MySQL/MariaDB
- site running on PHP 8.2
- create an SSH access
- create a database
Laravel 11 Installation
For this:
- SSH into the server
- Navigate to the site's directory by executing the command
cd path-to-site
(e.g.,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 to the new database:
DB_CONNECTION=mysql DB_HOST=xxxx.myd.infomaniak.com DB_PORT=3306 DB_DATABASE= name of the MySQL database (xxxx_newbdd) DB_USERNAME= MySQL user with privileges on this database DB_PASSWORD= their password
- Navigate to the project directory and deploy 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: