Dismiss Join GitHub today. GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together. June 2018 Number 2 Prize: 30 Days Free Access to O'Reilly Safari Learning Platform Artisan is a tool that comes with the Laravel framework that often is used to generate all sorts of project files. Artisan can be extended with plugin packages also written in PHP provide additional functionality to this package.
- Php Artisan Key Generate Could Not Open Input File Artisan Laravel
- Php Artisan Key Generate Could Not Open Input File Artisan Store
- Php Artisan Key Generate Could Not Open Input File Artisan Free
- Php Artisan Key Generate Could Not Open Input File Artisan Windows
Sponsor
May 15, 2017 Info:
- Docker version (
$ docker --version): 17.03.1-ce - System info (Mac, PC, Linux): Windows 7
Issue:
What seems to be going wrong?
Following is my docker-compose.yml
php-worker:
build:
context: ./php-worker
volumes_from:
- applications
depends_on:
- workspace
networks:
- backend
command: php artisan queue:workI have added command. When i run php-worker container i am getting error
'Could not open input file: artisan'
commented
May 15, 2017 Hi @ihd2911
why you try add command to docker-compose.yml?
please check php-worker/supervisord.conf first, has set laravel-worker section like you need command.
commented
May 15, 2017 My Bad, Thanks, I will test it.
closed thisMay 15, 2017 Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to commentI’m trying out the PHP micro Framework Lumen (from Laravel).
One of my first steps was to look into the
.env.examplefile and make a copy of it to have my.envfile. There is a variable APP_KEY just like there is in Laravel. Now I tried out the simple commandphp artisan key:generateto get my new key But I ran into the following error message[InvalidArgumentException]There are no commands defined in the 'key' namespace.Does some one know how I can generate keys for Lumen?
Update with solution
So I found my favorite solution for this problem. On the command line (Linux) I run
php -r 'echo md5(uniqid()).'n';'what gives me something like this7142720170cef01171fd4af26ef17c93.If you are going to use Lumen more often, you may want to create an alias in your
.bashrc, which is located in your home directory/home/USERNAME. To do so, you can open the file withnano ~/.bashrcorvi ~/.bashrcand copy the following alias at the end of the file,alias phpkey='php -r 'echo md5(uniqid()).'n';'. Now you can use the commandphpkeywhich will give you a 32 character long random string 🙂Answers:The Laravel command is fairly simple. It just generates a random 32 character long string. You can do the same in Lumen. Just temporarily add a route like this:
Then go to
/keyin your browser and copy paste the key into your.envfile.
Afterwards remove the route.Obviously you could also use some random string generator online. Like this one
Answers:Firstly, you have to register your key generator command, put this Lumen Key Generator Commands to
app/Console/Commands/KeyGenerateCommand.php. To make this command available inartisan, changeappConsoleKernel.php:After that, configure your application so that
IlluminateConfigRepositoryinstance hasapp.keyvalue. To do this, changebootstrap/app.php:After that, copy your
.env.examplefile to.env:Ignore this step if you already use
.envfile.Enjoy you
key:generatecommand via:Edit
You may use Lumen Generator. It covers so much commands you are missing from Laravel.
Answers:An easy solution is just running PHP code from the terminal (without using
tinker, because that is not available with Lumen):It uses Laravel’s
Str::random()function that makes use of the securerandom_bytes()function.Answers:The APP_KEY generation is a step of development process (I don’t think that creating temporarily routes is a practical way to do it). The function
str_randomcan help us, but this function is part of Laravel/Lunmen framework.
I recommend running tinkerOffice student mac 2011 download.
php artisan tinkerand then run the function
>>> str_random(32)The result is the key you’re looking for.
=> 'y3DLxnEczGWGN4CKUdk1S5GbMumU2dfH'Answers:Php Artisan Key Generate Could Not Open Input File Artisan Laravel

For me the easiest way to generate a Lumen key is typing on console one of these commands:
or
Php Artisan Key Generate Could Not Open Input File Artisan Store
openssl rand -base64 24Php Artisan Key Generate Could Not Open Input File Artisan Free
depending of your environment. In my case, I aways use
date md5on macAnswers:This answer was inspired by @thomas-venturini ‘s update to the question. Here’s a bash script that takes care of creating
.envand updating it with anAPP_KEYusing the aforementioned PHP command and the UNIXsedcommand:Hope someone finds this useful.
Php Artisan Key Generate Could Not Open Input File Artisan Windows
Tags: phpphp
- Docker version (