I'm struggling with Laravel 5.7 issue. When I'm trying to open in my app PDF file from my storage/public it shows 404 error. I've already linked storage to public by php artisan storage:link. The problem occurs on my hosting web server (I guess it's powered by LiteSpeed). On my local server everything works by calling source from assets($path) like here, but on my VPS server I had to make source to file static this way. On my web server I can't use any of these, because it calls 404. The funny thing is I've got images in the same folder also, and it works properly linked by assets($path) but PDF files show 404 error. What's the problem?
Url should be absolute
Skan {{ $pdf->ID }}
or
Skan {{ $pdf->ID }}
Related
I have downloaded a project from some website. When i run php artisan server it runs successfully shows server has started on 127.0.0.1:8000. When hit localhost:8000 in browser it gives http 500 error. So i checked the storage/logs/laravel.log file its blank, the logs are not going there. I don't know why. Apart from this there is not http folder inside app folder which contains controllers. So I go through the routes/web.php to see which controllers are being used so i found 'RegisterController', 'LoginController' written in routes file. So i searched for these controllers in whole project I found 'RegisterController.stub' inside 'vendor/hesto/multi-auth/src/stubs/Controllers'. I don't know how to run this project. I have attached the screenshot of app directory.
I am working locally on a webpage in laravel with wamp, everything is going smoothly except that my routes are not working I have watched youtube videos and exactly followed their instructions
Route::get('/',function(){
return view ('client-side');
});
this is returning a 404 page
also I have tried returning a simple echo with this code
Route::get('/hello', function()
{
echo 'hello man'
});
And this also returns a 404 page, I dont understand why this isnt working, ty in advance
You said you were working locally with WAMP. But you were not specific about how you were trying to access your website. So, I am wondering if you need to add public to the end of your URL. See, Laravel reads from the public directory. If you are using WAMP, then most likely you haven't don't have it reading from public.
So, let me give you an example. If you are using myWebSite as your directory from your WAMP directory, if you haven't set your hosts files, etc., then you would need to access your website like this http://localhost/myWebSite/public. Make sense?
Another way of accessing your website would be to use the built in web server. From a terminal window in the root directory of your project, type php artisan serve in the terminal window. You should then get a message that says "Laravel development server started: http://127.0.0.1:8000" so then you should be able to access your website at http://127.0.0.1:8000
Probably your problem is in calling url.
Image that your project in htdocs.So you should call your page likethis:
localhost/{YourProjectFolderName}/public/{route}
If you want remove public from url you should cut its content and past it in previous path and edit index.php file.
If you want remove {YourProjectFolderName} from your url you should edit config of wampp.
I'm new using Laravel. I'm having problems installing a Laravel project when I try to serve it. The project run well, although it's not loading anything in the public folder. This affects all the scripts or css in the web page.
Browser claims error 404 although files already exists.
I figure it out that the problem is that the public folder it's not included and the router responds with a 404 error for any file located there.
Anyone have idea of what's going on here and how can I solve it?
I have a Laravel 5.2 project working fine locally, after uploading to a live server I have a 'laravel' folder in my root directory and public folder under 'public_html/testsite'
My 'index.php' points to the correct '/bootstrap/autoload.php' and '/bootstrap/app.php'
Upon going to my 'url/testsite/' I get a blank page only (was working fine L5.0) firebug shows : 500 Internal Server Error with HTML : Reload the page to get source for...
index.php is loading by testing with die() before any 'require' methods, but after 'require... autoload.php' the die() is not working, however it is successfully calling autoload.php as a die() works within this file.
I'm not sure if this is a .htaccess issue, or maybe I had to set something up in cPanel last time for this folder (I can't remember). I'd appreciate any help!
Please note this Laravel project sits as a test site in a /testsite/ folder along with my current live site files.
Amongst changing many things at once, I appeared to have solved this by setting up a subdomain within cPanel and setting this to my testsite/ folder.
This was on a server with my current website live under public_html/ and setting up a test laravel app(website) with under public_html/testsite/ to work as an independent site for testing.
The typical "change permissions on storage folder" suggested elsewhere on stackoverflow did not solve my issue so hopefully this helps someone in the same boat.
I am using Laravel 5.1 on WAMP Server 2.5.
And I have this error while working on pagination.
404 Not Found
While I run my site locally using this php artisan serve
php artisan serve --port=212
I run to my site index url http://localhost:212/displays.
The pagination works fine, its pagination link work fine on every page http://localhost:212/displays?page=2.
But when I run it manualy without php artisan serve (http://localhost/bookstore/public/displays), the pagination link goes wrong. The pagination link originally printout http://localhost/bookstore/public/displays/?page=2, but it automatically change into http://localhost/displays?page=2 when the page fully rendered.
Is anyone have same problem like me? Glad if any of you could help.
This is likely because you're meant to set the web root on your server to the public folder (and Laravel assumes that that's the case).
As it is, your web root is set to somewhere two levels above the public folder, so when Laravel tries to redirect to /displays?page=2 it tries to send you to the wrong folder.