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 adheres to the Model-View-Controller (MVC) principle. You can install it on shared Web hosting or on a Cloud Server by following the instructions in this guide.
Installing Laravel 8
Prerequisites
- Own web hosting with latest MySQL/MariaDB
- Site under recent PHP with proc_open activated
- Site folder that points to the /public folder of your Laravel application
- Create SSH access
- Create a database
Submitting the application via git
- Command
cd
to directory git 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 right rights (repo)
git clone
your rest with https- Enter your username and token as 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
Deploy changes
Pause the site
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 Queue (optional)
php artisan queue:restart
- Clear cache (optional)
php artisan cache:clear
Remount 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 .env
the following variable in the file (before clearing the cache):
XDG_CONFIG_HOME=./.psysh
To create a user manually 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