Laravel - created command not working on shared hosting - php

I have my Laravel project deployed on shared hosting, and I made a command that delete some old images, command is php artisan delete:photos, and on my localhost it is working just fine, but on my shared hosting terminal when I type php artisan delete:photos it is not working.
I don't know why, I tried with php artisan key:generate but it is not working too.
Any solutions for this?

Related

WSL2 Ubuntu 20.04, Docker and Laravel launching local host won't display on browser

I have a strange one here, I have been learning Laravel with Laracasts from scratch 8 for the last couple of weeks, everything in my environment (Ubuntu WSL2, Docker and Laravel 8) was running smooth all week with no issue. I returned to work this morning and following the same boot up I always do, now any browser I use can't open the local host port that I launch from php artisan serve.
The CLI tells me that the development server is active but the browser won't connect. I've tried changing it across different networks, dropped firewalls and cleared caches. I've checked logs and nothing gives an indication of a problem. Usually when I run the command php artisan serve --host=127.0.0.1 --port=8080&
the ampersand keeps it alive and every refresh or connection is returned to the CLI, it's like artisan serve has stalled?
I think I found a solution and if somebody comes across this and can explain why it would be of great help in the future.
https://stackoverflow.com/a/40167414/2128089
composer dump-autoload
php artisan clear-compiled
composer clear-cache
This answer gave me some commands to run, which were the last I ran before a computer shutdown, once I re-ran my usual boot up I got all systems go
As expected:
I don't know if this is why it worked but it's working..

Laravel 5.5 on Heroku - php artisan down doesn't seem to work

I have recently deployed my Laravel 5.5 app on heroku. Everything works fine, except for the maintenance mode. The command php artisan down doesn't seem to work on heroku which works fine on my local machine. Any ideas?
The down command writes a file into the <storagepath>/framework folder named down. Make sure that's writeable.
Make sure your storage folder have sufficient permission so try following steps:
Download Heroku CLI from https://devcenter.heroku.com/articles/heroku-cli
Login to heroku with heroku login command
Try heroku run php artisan down --app appname
You can directly make maintenance on mode on heroku that is visiting https://dashboard.heroku.com/apps/appname/settings
Another solution to this problem is to use heroku maintenance:on and heroku maintenance:off which use Heroku's maintenance mode instead.

laravel not working without php artisan serve command

I am currently working on laravel 5.3. My team mate installed laravel on his machine using composer. In my machine i also have installed composer, and installed a larvel project using laravel installer, which was installed by composer. Now when i got the archive file o fproject installed by my team mate on my machine i run
php artisan cache:clear,
php artisan route:clear,
php artisan key:generate,
php artisan serve
commands and clicked the link provided (i.e localhost:8000 ) in terminal,by this project is running fine but, but when i am entering the url in the browser like
localhost\laravel\public it is not running correctly.
As local dev is always susceptible to configuration issues. I would also suggest your team look into a proper virtualization solution using vagrant/Homestead, More information and documentation available # enter link description here
The advantage is that once the project is configured you never need to worry about these system-specific occurrences and all team members can work on the same underlying system specs.
Note that you can use real domains (e.i project-name.dev.yourdomain.com) by just pointing them to the 10.x.x.x ip range.
Just Give the permissions to these directories
storage
bootstrap/cache
and the work is done.

How to upload and run Laravel project on host?

Hey I'm new Laravel user. Using Windows 7.
I made my project on computer, on wamp. I have migrations (create tables and etc).
I uploaded my project to my host and it's not working. That's becuase i need to use php artisan serve command in the composer. But I can't do it! Becuase it's an host.
How should I run the project when it's on host?
Please help! thakns!

Why are my custom laravel artisan commands not available in production environment

I have just installed a laravel app on the "to-be" production server (1and1 shared linux server).
With the same codebase as on my development server (Ubuntu 14.04 lts) my custom artisan commands are not available (php5.5 artisan list) on the production server.
I have done composer dump-autoload already.
I have also checked the app/start/artisan.php file and that is OK and is executed.
I have checked the app/config/production/app.php for the service providers and they seem to be all right.
I have also spent the better part of the day here on stackoverflow to find a solution, but without much success.
My Laravel version is: 4.1.28
Thanks so much for any help.
If you are getting no errors, you probably don't have the same codebase in production because, if resolve commands in your artisan.php file:
Artisan::resolve('CommandName');
And Laravel doesn't have access to this class, it will raise an exception:
"ReflectionException","message":"Class CommandName does not exist"

Categories