Manage cookies that are used for advertising, such as ad personalization, remarketing, and ad effectiveness analysis.
2.8.4.2.2. Transfer Laravel to hosting
Attention!
The information in this article is for informational purposes only. Transferring a Laravel project to hosting is quite complex and has certain nuances that only the developer can foresee.To transfer a Laravel project first of all you need to upload the files to the server in any of the ways:
- When using Git, you can connect to the hosting via SSH and clone the project:
git clone http://github.com/example/example_site/ - Upload project files to the server.
After uploading the files to the server connect via SSH and perform the following steps:
- Configure database connection.
- Go to the directory with the uploaded project:
cd ~/example.com/www/ - Update dependencies and all packages:
PATH=/usr/local/php70/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin composer install - Execute the command:
/usr/local/php70/bin/php artisan migrate - Project files are usually located in the
publicdirectory, so change the site's root directory in one of the following ways:Change the site root directory so that it points to thepublicdirectory.Add or edit two .htaccess files:- In the site's root directory:
<IfModule mod_rewrite.c> RewriteEngine on RewriteRule ^$ public/ [L] RewriteRule ((?s).*) public/$1 [L] </IfModule> - In the
publicdirectory:<IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^((?s).*)$ index.php?_url=/$1 [QSA,L] </IfModule>
- If necessary, create a symbolic link pointing from
public/storagetostorage/app/public. This can be done in two ways:- Go to the
/storage/app/directory in your project and create a symbolic link pointing to thepublicdirectory. - Insert the created symbolic link into the
public/storagedirectory in the project root directory.
- Connect to the hosting via SSH.
- Create a symbolic link:
ln -s /home/example/example.com/www/public/storage /home/example/example.com/www/storage/app/publicIn the command, instead of
/example/example.com/www/, specify the site root directory where your project is located.
- Check the site operation.
Besides the above described, additional actions may be required to customize the project. In this case, please contact the project developer for more detailed information.
(2)
Comments
Дякуємо за інформацію, додали її до інструкції.
Додатково потрібно в налаштуваннях сайту змінити "Кореневий каталог" вказати "public" повна існтрукція
https://www.ukraine.com.ua/uk/wiki/hosting/sites/my-sites/site-settings/root-dir/#change
Для роботи з "storage" треба створити окремо символьне посилання
Перейдіть у директорію /storage/app в файл-менеджері, натисніть правою кнопкою миші там на папку public і оберіть опцію "Створити сімлінк".
Далі перейдіть в директорію /public і вставте там сімлінк правою кнопкою миші.
Повна інструкція: https://www.ukraine.com.ua/wiki/hosting/files/file-manager/symlink/