What i have tried:
1) Install php7.2
2) Install Composer
3) run command composer global require "laravel/installer"
But when i run laravel new blog the output error is the following:
The provided cwd does not exist.
The provided cwd does not exist means that the Current Working Directory does not exist which means that laravel new command was unable to create the directory 'blog' because you do not have the permission to do so.
What you can do is to change the permissions for that directory, so the command is able to create the working directory
Related
Not able to create new laravel project.
C:\Users\Devil>composer global require "laravel/installer"
Changed current directory to C:/Users/Devil/AppData/Roaming/Composer
[ErrorException]
file_put_contents(): Filename cannot be empty
global <command-name> [<args>]...
C:\Users\Devil>laravel new blog
'laravel' is not recognized as an internal or external command,
operable program or batch file.
Please Help Me on this
1 - Install composer. In case it is not yet installed here is the easiest way to install composer on windows
2 - Go to your folder where you save your projects through the command line and run this command: composer create-project --prefer-dist laravel/laravel project-name . This will create a new folder project-name
3 - Access the project-name folder through the command line and run php artisan serve
4 - Open your browser and access http://localhost:8000
I try to install Composer (downloaded from https://getcomposer.org/download/) on Windows 10, but I get the following error message: The installation directory "C:\Users\BAB2~1\AppData\Local\Temp\is-5EP2P.tmp" is not writable.
Composer Installation Error
I have given full access to this directory, but it doesn't help. Could you please suggest any ways to solve this problem.
download https://getcomposer.org/composer.phar
drop composer.phar file into your PHP folder
make sure this PHP folder is on-path (so that you can call php everywhere)
if not, add the PHP folder to your environment PATH variable
run php composer.phar for testing. you should get Composer's help output
create a little batch file composer.bat to invoke composer easier:
C:\PHP> echo #php "%~dp0composer.phar" %*>composer.bat
This enables you to run composer in any PHP project folder.
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.
I successfully installed Composer and Laravel in my shared hosting.
Then when I want to create a new Laravel project
laravel new myproject
It gives me
Crafting application...
Could not open input file: composer.phar
Application ready! Build something amazing.
Based on internet research, I edited my .bash_profile and added
alias composer="php ~/composer.phar"
then I run
source .bash_profile
Now I can type composer in the command prompt successfully.
But I still receive the same error when I run laravel new myproject
I don't have access to move the composer.phar to /usr/local/bin
I have just transferred my laravel application to another pc and I have installed composer. I am running composer install at the root of the project but it shows the following error:
{"error":{"type":"ErrorException","message":"file_put_contents(\/meta\/services.
json): failed to open stream: No such file or directory","file":"C:\\national-fl
eet\\vendor\\laravel\\framework\\src\\Illuminate\\Filesystem\\Filesystem.php","l
ine":71}}
I tried CACLS -R 755 app/storage (as admin)
and then composer update but the same error. bootstrap/compiled.php doesn't exists in my project. What should I do?
I got this error, because some folders in /app/storage were missing
To fix the error, I manually created the following folders:
app/storage/
app/storage/cache/
app/storage/logs/
app/storage/meta/
app/storage/sessions/
app/storage/views/
then delete the contents of my vendor folder and run composer update again
Try to remove the services.json in /meta (or rename it to something else) and try composer install again (or composer update). It is possible that the file hasn't got the correct rights for Laravel to write to.