I have a file stored in storage directory in Laravel 7. The sub directory is storage/app/public/personnel-docs/nameofile.ext.
I have done php artisan storage:link and therefore, on my local which is a windows 10 machine I can access it by the following url
http://127.0.0.1:8000/storage/personnel-docs/nameofthefile.ext
But where it is hosted on a LIVE linux server, when I try the same url as follo
http://theliveurl/storage/personnel-docs/nameofthefile.ext
It returns a 404 Not found response.
I have also run php artisan storage:link on the server and the problem persists.
I have checked and confirmed that the file is present on the folder but it just does not return/display as expected.
I will appreciate any effort to resolve this.
Thank you
I have installed laravel by composer create-project laravel/laravel –-prefer-dist
after this run php artisan serve command to laravel project directory and get this result.
Laravel development server started: http://127.0.0.1:8000
But when i go to http://127.0.0.1:8000 in browser laravel project not running and give error
This site can’t be reached
127.0.0.1 refused to connect.
but http://localhost/laravel/public/ it is working. Can anyone tell me that what is proper way to run this laravel project.
Try to run in different port
php artisan serve --port=9000
and then try http://127.0.0.1:9000 will work.
As might be on port 8000 something already running on your system will not make it work.
And you can also run your laravel project without artisan serve command
If anyone wants to make the application public, the more easy and fastest way is:
Rename the "server.php" file in root directory, in "index.php"
Move your .htaccess from public folder to root directory
Make your directory accessible to Apache2 (set all file permissions
to 777).
At starting level, you can use url like this http://127.0.0.1:8000 with port-number. but in further level you must working with simple url like http://localhost/laravel/public/.
One more thing - you should remove "public" keyword from url, so you access direct your root-project. Review this link - Laravel 5 - Remove public from URL
I had that problem too! And couldn't solve it. So I installed openserver from https://ospanel.io/ and put my site on the folder domains (Windows 10), then I just start Open Server and click "My Sites" and choose my site - it opened in my browser which set by default on Open Server program and click the folder on my browser cooled "public" and there you go -> your site is working.
I now that isn't solve the problem with cmd and start thought cmd and server like http://127.0.0.1:8000, but you can take access to your local site through http://'your site'/public/'your pages'
Good luck!
Changing the port will help.
php artisan serve --port=9000
worked for me
Try this
php -S 127.0.0.2:8000 -t public/
It will start your local development to http://127.0.0.2:8000 which will work great.
OR
You can try instead
php -S 127.0.0.1:8000 -t public/ It will work in any browser as compare to command php artisan serve which open url http://127.0.0.1:8000.
Successfully landed to Laravel page by the following steps.
Note: This is after the successful installation and configuration.
Was in /var/www/html/
Created the project using the following command after Laravel installation successfully
$laravel new firstapp
here firstapp is my project
cd to firstapp (folder created with project creation with $laravel new firstapp)
serve using the following command
$ php artisan serve
The project ready to serve with the following statement as below
Laravel development server started: http://127.0.0.1:8000
You can access the laravel page using the following URL
http:///firstapp/public/
Sometimes this occur when you have installed an anti virus software. Anti-virus deleting your "server.php" file. For that you can create an exception in anti-virus for "server.php" file or creating a "server.php". You can find relevant code for the file searching. Basically server refuse to connect occurs when the "server.php" deleted or removed from the file path.
I have developed a laravel project in laravel 5.4 on xampp localhost.
as on localhost I ued php artisan storage:link to link storage/app/public/images with public/storage to access images. So its working 100% correctly on local host but when I uploaded it on hosting server I lost access to those images. I dont know how can I fix it. please some one help me to make it working.
First delete the shortcut created from localhost (if you have uploaded it to server).
Create a blank php file (like link.php), paste the code below to it:
<?php
symlink('/home/**domain**/storage/app/public', '/home/**domain**/public_html/tests/storage');
In the above code, don't forget to replace domain with the name of the root folder of your domain.
Then upload the file to your public folder (like public_html).
Then on your browser search for your_domain_name/link.php
Hope it will work
So I want to get the laravel site up and running so I can check how it looks. I've used php artisan serve but it points me to the localhost. I've tried the other options like --host and --port but it still doesn't work.
Right now all I see is the directory root if I go into the folder. I know that the public is the one with the index.php but when I tried to go into it, the server responds with a page isn't working.
My application folder is c:/wamp/www/newapp.
When I use php artisan serve from the newapp folder the server starts at port 8000.
Of course I switch off the WAMP server when I do this however I get a blank page! I tried making a test.html in the newapp/public folder and it works if I type localhost:8000/test.html, but it does not go to the landing page!
For your information: when I use WAMP server and type localhost/newapp/public it goes to the landing page, but playing with the routes.php does not work when using WAMP.
My question is, how do I get to the landing page using php artisan serve?
My Laravel version is 4.2.0.
Here are a couple of possible fixes:
run composer install
Try to run php -S localhost:8000 -t public/ in the root of your project (not sure if this works on Windows though)
If this doesn't work you can try to use homestead