PHP artisan command has no effect - php

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.

Related

Can't find .env files during PHPUnit test using PUTTY

I'm using a vagrant box for my php project. I've created two .env files (.env and .env.testing). The website runs smoothly but while testing the functions using PHPUnit, it throws me a File Not found error. I can see the files on my directory but can't view them in terminal using ls. But I can see them all if I use ls -a command. Is the issue with vagrant or putty or am I doing this wrong?

Laravel Error: Erroneous data format for unserializing 'Symfony\Component\Routing\CompiledRoute'

I ran these commands: php artisan route:clear and php artisan cache:clear. Then I got this error on whatever I want to do: running artisan command, running composer command, rendering any view that worked just fine. Can not do anything at all.
I searched for the problem and seems that this has happened because of changing the php version from 7.4 to 7.3. Yes, I have done this about 10 days ago, now I am not able to resolve it and make it work again. I use Nginx and tried anything suggested on the web, but can not solve the problem. I had apache and could not solve it, I removed apache completely and installed nginx. Now any other project works fine with nginx, but only this project which I ran php artisan route:clear and php artisan cache:clear commands, has problem and displays this error on every action I want to do: Erroneous data format for unserializing 'Symfony\Component\Routing\CompiledRoute'.
How can I solve this problem?
I got this same error when I was experimenting with Laravel Envoy. I think I pulled the 7.0 version of Envoy onto of my Laravel 5.8 version app. The way to solve it for me was to clear out the bootstrap/cache directory of the app with the command rm -fr bootstrap/cache/* from the root Laravel directory. Once I did that I was able to use my application normally and all the artisan commands began working.

How add Artisan cli to existing laravel project?

I have issue with Artisan usage on Windows 10 with Xampp.
What have I done:
clone project from git repositiory
run composer install
In directory with project i trying run:
php artisan
but i get errror:
Could not open input file: artisan
But if i run command
php bin/console i get list of command like cache, debug, eloquent... so some tools are there... But none artisan...
How i can add/use artisan into existing project?
Check if artisan file exists in your project root folder. If it does, then you're probably on the wrong folder. If it doesn't exist, you can just download it from the official repo.
To configure an existing project, you'd typically check those things first :
You should goto app/config/database.php check file and verify username and password.
After check in Project Folder vendor folder and composer.json file exist then remove it (that remove old configuration now we going to fresh configuration).
Then after back to command prompt and fire command composer update and that download some dependent file download.
Now Run php artisan serve

Laravel Project not working in XAMPP htdocs folder.What could be the reason of this?

Error States:
The localhost page isn’t working
localhost is currently unable to handle this request.
HTTP ERROR 500
my project is in htdocs>laravel>project1>public>index.php
any more details like installation etc?
how did you install the laravel project by php artisan command or by composer or by zip package? and why you want to run your laravel project with the xammp file structure.. you can simply write the "php artisan serve" in your command line.. also make sure the .env variables set properly.. also try to clear all cache browser and run following query and try again
php artisan cache:clear
you need to know that the default port of laravel project is localhost:8000
When you meet 500 error, it's usually permissions related problem. Set write permissions on a storage directory. For Linux:
sudo chmod -R 775 storage
If it didn't help, look into Laravel error log.

./yiic migrate command is not working yii framework?

I am trying to run the command ./yiic migrate in /protected folder of but it is not showing any response.
I have checked all the configuration file including /config/main.php
and other files. They are correctly configured.
Could any body help me to figure it out why it is happening.
You can also use the yiic.php to execute commands, following is how you can use it:
path/to/php protected/yiic.php migrate
If you use xampp then your php path will /xampp/php/php, so you can use:
../../php/php protected/yiic.php migrate
It's was most helpfull for me:
1.Open your root project directory
2.There should be present framework and {projectName} directories
3.Use next command:
php path/to/project/protected/yiic.php migrate
If you install yii successfully
For linux use:
php yii migrate
For windows use:
yii migrate

Categories