Laravel + React project not working without php artisan serve command - php

I am working on Laravel React project on localhost when I run a command
PHP artisan serve
It is working fine on http://127.0.0.1:8000/
But when I am trying to run it without php artisan serve command and trying to access with
http://localhost/project_name
It is not working. I follow all necessary changes like
Move .htaccess to root folder
server.php to index.php
Not any error just blank page

Related

Laravel 7.28 not work without php artisan serve command in localhost

Laravel 7.28 not work without php artisan serve command in localhost
I install new Laravel in localhost (/var/www/html/NewLaravel)
When I run http://localhost/NewLaravel/public/ not workling
but when I run with php artisan serve its working on http://127.0.0.1:8000/
Apache2 is working proper and allow access of override for .htaccess
is that new Laravel will only work with php artisan serve ?? or something is missing from my side ?
Step-1:
run apache and sql from xampp server
step-2:
in browser type localhost/NewLaravel and press enter
Step-3:
in list please select public folder it will run

Images are not accessible after moving Laravel project

I used laravel storage class to upload images in the storage folder. it successfully upload images and I can successfully access them by Storage::url('path'); or Storage::download('path');
however, when I copy the project to another location and try to run my copied project using php artisan serve, I can not access the images! this is while the original project is still fine and images are accessible.
it is noteworthy that I already used php artisan storage:link in the original folder. When I run php artisan storage:link in the copied folder it says it already exists. It is interesting that Storage::url('path') creates the url correctly and images are also copied correctly in the new location.
How can I fix this problem?
will this be a problem if I deploy the project in a web host?
Firstly Remove Storage Link from public folder by running
rm public/storage
And then try to run below command
php artisan storage:link
try to run clear cache and config. may be because of cache settings so try this
php artisan cache:clear
php artisan route:cache
php artisan view:clear
php artisan config:cache

laravel php artisan serve not serving the current directory

Whenever I try to run
php artisan serve
on my newly created laravel project directory, it always serve the other project from another directory.
I am using homestead virtual box's latest version with vagrant.
If I try to delete/rename the project that is being served, then run php artisan serve on my new project, the browser will show
No input file specified.

How to run Laravel project without php artisan serve in laravel 5.3

I have updated the PHP version to 5.6.3 and create a project using laravel 5.3.0 . Now i want to run my project without php artisan serve. When i hit localhost , the index page is opened. But when i click one my project name it shows following error.
****The localhost page isn’t working****
Note that i have tried following method to get rid of this issue.
1. copy .htaccess file from public directory to project folder
2. rename the server.php to index.php
But it is not working. Any ideas in this regard?
If you using LAMP and you want to run Laravel project without Artisan, you have to navigate from browser to /laravel/public directory. Follow laravel documentation https://laravel.com/docs/4.2/quick
But if you getting errors like 500 and your page don't work, possibly you have to change permissions of your Laravel project directory.
Try sudo chmod -R 770 /path/to/your/laravel/project
or sudo chmod -R 775 /path/to/your/laravel/project
for more refer with this https://help.ubuntu.com/community/FilePermissions

PHP artisan command has no effect

I created a project in Laravel 5, on localhost. It works perfectly. I uploaded it on Godaddy using FileZilla and tried to run php artisan command. It didn't work. Just to be sure if there's a problem with composer or Laravel, I created a new Laravel project with same name and tried php artisan command it worked. Then I tried copying just app and database folder into newly created project and tried php artisan command, it stopped working just like before.
Can anyone tell me what is the problem here.
I tried running composer install command in project directory as per one suggestion on stackoveflow, didn't work for me
There probably is something in the app/ or database/ directory that's causing some fatal error and your php configuration is set to not display any errors.
Execute php --ini to find out which ini file is used and then configure it to show errors. After saving the ini file, run php artisan again and fix the error.

Categories