Creating symlink setting up Laravel 5.6 on a remote server - laravel

I'm setting up a Laravel 5.6 site in a remote shared hosting server.
I'm failing at creating the storage symlink. I'm executing a file with the following line (as Laravel documentation and other tutorials instruct):
symlink('/home/nataliag/laravel/storage/app/public', '/home/nataliag/public_html/storage');
this creates a symlink, but instead of getting my images with mydomain.com/img/..., i have to go mydomain.com/storage/img/....
what link the php artisan storage:link creates? because that works in local, and all my links are created following that structure

Related

How To Upload Laravel with vuejs To Shared Hosting

I upload my laravel project in Host domain i work with laravel and vuejs, any easy way to deploy it?
Just follow the following steps to deploy your Laravel and vue.js application to a shared hosting.
generate your product vue build using npm run prod
upload all the changes and project to a git repository.
clone your git repository to your shared hosting, mainly via integrated terminal in some shared hosting or via ssh key access.
redirect your domain or subdomain directory to /public folder.
run composer install
run cp .env.example .env
setup .env files according to database configuration and emails etc.
run php artisan migrate
run php artisan key:generate
run php artisan storage:link if you want media uploading to your server.

How to setup laravel 7 on shared hosting?

I recently transposed an existing web site from symfony to laravel for which I am a newbie.
At the moment my site is running with Laravel locally using the embedded server.
I created a repo on github and pushed my site on it.
Then I connected to my site via ssh and cloned the github repo on the remote server (shared hosting).
I created a .env file from the .env-example remotly.
I created a subdomain that points to the public folder of the cloned site.
I modified a line in public/index.php to
$app = require_once __DIR__.'/bootstrap/app.php';
I launched a composer update command and then run
php artisan key:generate it returned success but I couldn't find any key in the .env file thus I used the same key I use locally.
When I visit the subdomain I get a page like this one:
Index of / Name Last modified Size Description cgi-bin/
2020-09-13 15:23 -
I very probably missed something

Laravel 5.5 How to access website insted of /public folder

I have setup laravel 5.5 on my localhost and want to
access the project directly instead of /public directory.
My Current link is: http://localhost/my_laravel/public/
I Want to access as: http://localhost/my_laravel/
start a server using
php artisan serve
in cmd/console go to the project directory and run the above cmd.
it will run your app on http://localhost:8000

token mismatch error in laravel backpack

hi there is problem with me I had made complete admin panel using laravel backpack. after uploading on domain its creating the problem when adding deleting or editing operation performs. Error is token mismatching in backpack crud system. please tell the problem with my project
I think you have issue with storage folder permission check this out Laravel Installation Docs
Directory Permissions
After installing Laravel, you may need to configure some permissions.
Directories within the storage and the bootstrap/cache directories
should be writable by your web server or Laravel will not run. If you
are using the Homestead virtual machine, these permissions should
already be set.
Another possible issue is that your variables in .env are not correct
APP_URL=http://localhost //Change this to your url
APP_ENV=local //Change this to production
After you check these things you can do this
Delete all files in app/storage/ files : cache/, sessions/, and views/
Or you can do it by using this commands if you have SSH access to the server
php artisan cache:clear
php artisan view:clear
php artisan route:clear

Lumen not working out of the box

Just installed Lumen framework.
hit the link http://localhost/lumen/public/ in my browser and got this following error, anyone got any idea about it?
Traced it back to the app.php file in bootstrap folder.
if You want to access lumen project without "php artisan serve"
$app->run(); replace with
$request = Illuminate\Http\Request::capture();
$app->run($request);
from this path yourlumenproject/public/index.php
Open your terminal in the root folder run the following command php artisan serve.
Lumen development server started on http://localhost:8000/
if you want to serve your app in local development you can do this :
php -S localhost:8000 -t public/
and it will serve in localhost in port 8000. hope this help.
Note : I'm using Laravel Framework version Lumen (5.2.4) (Laravel Components 5.2.*)
At the moment Lumen only runs in the domain root.
(I've submitted a PR that fixes this but it has yet to be merged)
You have to create a Virtual Host on your local webserver and point the document root of that to the public directory. After that you can access your app with something like: http://lumen.dev.
Guide for Virtual Hosts with nginx
Guide for Virtual Hosts with Apache
A simple alternative to setting this up manually is Laravel Homestead. It is an official Vagrant box made for Laravel, that allows you to easily get your development environment up and running.

Resources