1000 FAQs, 500 tutorials and explanatory videos. Here, there are only solutions!
Installing Laravel on Infomaniak hosting
This guide is about Laravel, an open-source web framework written in PHP that follows the model-view-controller (MVC) principle. You can install it on a Web Hosting or on Managed Cloud Server by following the instructions in this guide.
⚠️ For additional help, contact a partner or submit a request for proposal — also, read the role of the host
Prerequisites
- have a Web Hosting with the latest MySQL/MariaDB
- site under recent PHP with proc_open enabled
- site folder pointing to the /public folder of your Laravel application
- create an SSH access
- create a database
Installation of Laravel 8
Sending the application via git
cd
command to the directorygit clone
your project
If the project is private and you have 2FA, you can use the Github token:
- create a token https://github.com/settings/tokens with the correct permissions (repo)
git clone
your repo with https- enter your username and token as the password
Startup
- create the .env file with the correct information
composer install
php artisan key:generate
php artisan migrate:fresh --seed
php artisan storage:link
Optimization
composer install --optimize-autoloader --no-dev
php artisan config:cache
php artisan route:cache
php artisan view:cache
Deploying Changes
Put the site on hold
php artisan down
Update the site
git pull
composer install
php artisan migrate
- restart FPM (optional)
echo "" | sudo -S service php7.3-fpm reload
- restart the queue (optional)
php artisan queue:restart
- clear cache (optional)
php artisan cache:clear
Raise the site
php artisan up
Go Further
To force https, add the following line to public/.htaccess
:
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
If you can't use Tinker, set the following variable in the .env
file (before clearing the cache):
XDG_CONFIG_HOME=./.psysh
To manually create a user with Tinker:
DB::table('users')->insert(['name'=>'MyUsername','email'=>'thisis@myemail.com','password'=>Hash::make('123456')])
And read the Laravel documentation https://laravel.com/docs/, especially https://laravel.com/docs/8.x/deployment