When I ran php artisan serve then copy this URL http://127.0.0.1:8000/. Its works. I want to access my project via url http://localhost/myproject/public/.
It returns blank page. And when I inspect the element it returns 500. Internal server error. Appreciate your help regarding this. Thank you.
Laravel version: 5.4
Php Version: 7.1.12
I can access the folders but when accessing the public folder itself. Returns blank page.
When run the php artisan serve. Its working
I found the answer to my question. It's the PHP version. Php7.0 does not support it
You can try doing:
composer install
Or In the root of your project try to run
php -S localhost:8000 -t public/
Check this answer of my prev. question. You should set symbolic link as the docs said.
Related
I'm actually working on the server migration of a Symfony project. I'm new to Symfony so i'm discovering how a Symfony project works at the same time.
The projet use Symfony 4.
I'm stuck at the point where the deployment on the production server works but once on the website side, images and .css files cannot be loaded.
I get the following error in the console : console error
When I look at the path where images are loaded I get http://domainname/builg/images/imagename.jpg
I have check and the images are well located in the folder public/build/images in the server.
I've tried accessing the images directly by doing a GET request on the search bar but I can't have access whether it is by asking http://domainname/build or http://domainname/public/images
As the project is actually perfectly running on another server and locally on my computer I don't think the issue come from twig or the webpack encore.
I can't see what I've done wrong.
Maybe have I missed something in the configuration phase ? Should I update some path ?
Thanks in advance,
I assume you are using Symfony 6 or 5. Please follow these steps:
php bin/console cache:clear --env=prod
npm run build
OR
yarn run build
assets are auto symlink in latest symfony 5 or 6 version. If not then please run this command:
php bin/console assets:install --symlink
And try to access http://domainname/build/images/imagename.jpg . Make sure this url is correct with image name and path.
I download a fresh laravel project from someone for testing.
After setting up and running using php artisan serve, the locahost (http://localhost:8000/) keep loading slowly then It shows message 404 not found.
I have tried to solve using command line php artisan serve --port=1010 and run http://localhost:1010/ on broswer but It didn't work.
And I also used php -S localhost:8000 -t public or php -S 127.0.0.1:8000 -t public after run localhost:8000 on broswer but it still didn't work.
any idea?
Check once there is storage/framework/cache/data and storage/framework/sessions directory created or not, if those doesn't exist then create manually.
I have successfully configured and make everything work perfectly. But i have an issue, i want to change the time to live but in my project "jwt.php" does not appear in the config folder.
If anyone knows the solution kindly guide me; help will be appreciated.
Many Thanks!
This is probably because you haven't published vendor files.
You should run:
php artisan config:publish tymon/jwt-auth
assuming you use https://github.com/tymondesigns/jwt-auth package to publish configuration file so you will have jwt.php created and then you can update config according to your needs
To publish vendor files, for Laravel 5.5, run
php artisan vendor:publish --tag=config
I have been working on a laravel5 project on a computer , but now I want to continue on an other, but don't know how :(
I'm using wampserver and the project is in the "www" folder, this is the error I'm getting when trying to open the project: " Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request"
Your error message is very vague, so it is hard to pinpoint the cause. I assume you just copy pasted all of the project files
Try these steps:
Make sure you copy all of the project files including the hidden ones(.env).
Prepare your destination computer as in http://laravel.com/docs/
Check you have all the necessary PHP extensions available in php.ini as in above link requirements. Also, watch your PHP version!
Install composer https://getcomposer.org/doc/00-intro.md
When copied, go to your destination folder and run composer install.
Run php artisan key:generate from the command line.
Run php artisan cache:clear from command line
http://php.net/manual/en/install.windows.commandline.php
Make sure your webserver is serving pages from project/public folder.
If laravel is failing, check the log file to see the cause
your_project/storage/logs/laravel.log
Copy the project folder and navigate terminal/cmd
just run following commands.
Create database and place the same name at .env file in laravel project folder
1. composer install
2. php artisan key:generate
3. php artisan cache:clear
4. php artisan migrate
UPDATE: If you're getting
Whoops, looks like something went wrong
in app/config/app.php, set debugging as true with:
'debug' => env('APP_DEBUG', true)'
If you're getting the error
No supported encrypter found. The cipher and/or key length are invalid
for some people it worked to do cp .env.example .env before (2).
You would also have to create new storage link, because Laravel uses absolute path inside it.
php artisan storage:link
https://stackoverflow.com/a/32722141/3982831 Please follow this to resolve your problems. All people forget about permissions on folders.
After you have done as Ademord answer, you might need to use refresh to your WAMP, XAMP or any other development stack you are using. I had the same issue plus changes were not reflecting in the front end. For example new routes in the web.php were not updating.
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.