How I create a private key for my Laravel application - laravel

I'm trying to get started with the latest Laravel. I had just created my Laravel from the command line via the command composer create-project --prefer-dist laravel/laravel my-app
I have installed Homestead and now trying to create Vagrant box with the command
vagrant up
I'm getting the error, check your Homestead.yaml (or Homestead.jso) file, the path to your private key does not exist
To which I ran the command
ssh-keygen -t rsa -f ~/.ssh/id_rsa
Now I'm getting the error Saving key "~/.ssh/id_rsa" failed: No such file or directory
I'm running Windows 10

Related

Issue with running new laravel project with homestead `ERROR 1698 (28000): Access denied for user 'root'#'localhost'`

I have installed vagrant homestead, generated ssh key using ssh-keygen -t rsa -b 4096 -C "myemail", sshed using vagrant ssh and then installed a new laravel app using composer create-project laravel/laravel example-app.
While trying to access the app locally I am getting the error No input file specified. So I ran vagrant reload --provision, however the provision is not running because I am getting the error ERROR 1698 (28000): Access denied for user 'root'#'localhost'.
I tried generating a new key again using ssh-keygen -t rsa -b 4096 -C "myemail" and then ran re-ran the provision command but am getting the same error ERROR 1698 (28000): Access denied for user 'root'#'localhost'
How should I troubleshoot this so that I can access the laravel app locally using my vagrant machine?

Homestead 9 fresh box creating a new Laravel project composer Could not scan for classes inside /vendor/phpunit/php-code-coverage/src/

I am trying to set up Homestead as a development environment and am not having much luck. I follow the instructions to get Homestead up and running on https://laravel.com/docs/5.8/homestead#installation-and-setup. The box comes up fine and I can shell in with vagrant ssh. In the code directory which is mapped correctly to a directory on my Windows machine I create a new laravel project with laravel new example and I get the following error
[RuntimeException]
Could not scan for classes inside "/home/vagrant/code/example/vendor/phpunit/php-code-coverage/src/" which does not appear to be a file nor a folder
I have tried composer update rm -rf vendor && composer install and get the same error. When I use composer install --prefer-source I don't have the install error, but get
Script #php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 1
and
In LoadConfiguration.php line 68:
Unable to load the "app" configuration file.
I have checked that I have a .env file and I have checked that the app file name and path is in lowercase.
Any suggestions would be welcome.
Update VirtualBox to v6.
See this issue on GitHub: https://github.com/laravel/homestead/issues/1219

Laravel project cannot create using composer in ubuntu 16.04

i want to create laravel project by this command in ubuntu 16.04
composer create-project --prefer-dist laravel/laravel blog "5.2.*"
project does not create and show this error-
[ErrorException]
mkdir(): Permission denied
In Linux machine, user must have to take super user or root permission to write files in disk, if you are not in your user space. So use sudo command at the beginning since you are using ubuntu 16.04.
sudo composer create-project --prefer-dist laravel/laravel blog_5.2.
Don't give any space in project directory name, for that I showed under score _
Note: if you see your project folder is locked sign icon, then change the user by using this command:
sudo chown -R username blog_5.2./
Otherwise you may face problems on some third party commands. See more details
https://getcomposer.org/doc/faqs/how-to-install-untrusted-packages-safely.md

How to install Laravel as Apache user

First off: I'm very familiar with Composer and also Symfony and some other MVC frameworks.
I tried the following installation documentation, but I'm stuck on how to properly install a laravel project as "apache:apache" under "/var/www/html" on a CentOS 6 virtual machine.
I ran the composer global require "laravel/installer" command, and it says to put "~/.composer/vendor/bin" in your PATH. So I presume this command (laravel install) is done as a normal user (not root), and the folder will exist in your home directory when run.
I added to my path by editing my /etc/profile to include this. But when I try to run laravel new laraveltest in the /var/www/html folder (owned by apache), I get:
[abunk#Alvin-CentOS6 html]$ laravel new laraveltest
Crafting application...
PHP Warning: file_put_contents(/var/www/html/laravel_572e877d514bacbb7381860b8307a067.zip): failed to open stream: Permission denied in /tmp/.composer/vendor/laravel/installer/src/NewCommand.php on line 122
PHP Warning: ZipArchive::extractTo(): Permission denied in /tmp/.composer/vendor/laravel/installer/src/NewCommand.php on line 140
PHP Warning: ZipArchive::close(): Invalid or uninitialized Zip object in /tmp/.composer/vendor/laravel/installer/src/NewCommand.php on line 142
Composer could not find a composer.json file in /var/www/html
To initialize a project, please create a composer.json file as described in the https://getcomposer.org/ "Getting Started" section
Application ready! Build something amazing.
So then I copied the folder /home/abunk/.composer to /tmp/.composer; and then I ran su -s /bin/sh apache -c "laravel new laraveltest" from the /var/www/html folder (this should run as apache).
But instead I get this:
[abunk#Alvin-CentOS6 html]$ su -s /bin/sh apache -c "laravel new laraveltest"
Password:
Crafting application...
PHP Warning: proc_open(/dev/tty): failed to open stream: No such device or address in /tmp/.composer/vendor/symfony/process/Process.php on line 290
[Symfony\Component\Process\Exception\RuntimeException]
Unable to launch a new process.
new [--dev] [--] []
So my question is (or maybe this is really a bug): How do install as the apache user? Any recommendations?
I could do this as root user, but I think it's a bad idea to run Composer as root user.

laravel homestead cannot create project

I have download homestead box manually, and add it to vagrant like: "vagrant box add laravel/homestead virtualbox.box".
Then I run command "vagrant init laravel/homestead" to create a new development environment.
Now I can start the virtual machine by "vagrant up".
I login into the new virtual machine by "vagrant ssh".
I run command "composer create-project laravel/laravel new-site" to create new project, but it always give error that authentication required (packagelist.org)
Do you setting up your SSH keys in the Homestead.yaml file?? It's necessary to add this SSH keys.
For that you can also prefer this: https://laravel.com/docs/5.1/homestead#installation-and-setup
May be it's helpfull for you..!!

Resources