Laravel 5.4.* - The "" directory does not exist when running artisan - php

I have a fresh installation of Ubuntu Server 14.04 in which I'm currently trying to install my Laravel project on.
I have moved the entire repository into the folder required, but when I run the command
php artisan
within that directory, the terminal returns an error stating
[InvalidArgumentException]
The "" directory does not exist.
Does anyone know what I can possibly do to solve this issue?

I had this same issue and it turned out that I was not cloning the ./config directory because of a poorly defined .gitignore. So make sure the original project location was able to push that directory up and that it exists in the new location.
After the clone I re-ran composer install and it all worked.

I had been facing the same issue and I found that there was an empty folder in Module Directory. I had just deleted that Module Directory and again started with new Module Directory and it had solved the problem.

Same issue, resolved it by running php artisan config:cache

in my case, i run composer install and it through below error
Problem 1
- lcobucci/jwt is locked to version 4.1.4 and an update of this package was not requested.
then I run
composer update
and it worked like a charm.

Related

php artisan serve can't find the autoload.php

SOLUTION: laravel new project-name was actually giving me an error that i overlooked. I had the wrong version of php. It requires phpv7.1.3 or higher. If you don't have it it doesn't work.
Ran into one other problem:
i had a system environment variable that is pointing to an old version of php
Also laravel requires openssl extension and mbstring to turned on. UNCOMMENTED from php.ini
FOR NEWCOMERS: if you have just downloaded php and unzipped the file. It contains a file called
install.txt
that you HAVE to read. It explains everything.
I ran laravel new blog from their getting started page. When I tried to run php artisan serve, I got the following error:
Warning: require(C:\Projects\laravel-projects\blog/vendor/autoload.php): failed to open stream: No such file or directory in C:\Projects\laravel-projects\blog\artisan on line 18
The artisan file is pointing to
require __DIR__.'/vendor/autoload.php';
this directory does not exist. Even if I point it to the correct directory, it still wouldn't work because I don't have read permissions for that folder (so it gets denied).
What's going on, and how can I fix this?
EDIT: changed the url from the mentioned above to:
C:\Users\sarkis\AppData\Roaming\Composer\vendor\autoload.php
This worked perfectly for some reason.
And NOW. A NEW ERROR HAS APPEARED.
Fatal error: Uncaught Error: Class 'Illuminate\Foundation\Application' not found in C:\Projects\laravel-projects\blog\bootstrap\app.php:14
Stack trace:#0 C:\Projects\laravel-projects\blog\artisan(21): require_once() #1 {main} thrown in C:\Projects\laravel-projects\blog\bootstrap\app.php on line 14
found that i don't have the proper version of php required.
First Install Composer: composer install.
Then run a command in CMD prompt: composer dump-autoload.
Try running composer dump-autoload , after that run a composer install
If that doesn't work, try the composer update --no-scripts
I'm new to Laravel, and I got the same confusion with the command:
laravel new blog
There was no vendor folder.
But after I tried:
composer create-project --prefer-dist laravel/laravel blog
I found the vendor folder came up.
Don't know why either.
You could try install via Composer Create-Project:
composer create-project --prefer-dist laravel/laravel blog
When running laravel new project_name. It outputted the text php 7.1.3 or higher needs to be installed. Current version 5.6 does not match requirements. And it aborts without plainly giving you an error. Be sure to download php version 7.1.3 or higher. Also check if you have environment variables for earlier versions of php and delete those.
note: be sure to read install.txt from the php download
Check all your permissions to following folders and give 0777 permissions
storage 0777
vendor 0777
bootstrap/cache 0777
And then run again
php artisan serve

error using composer to install cakePHP 3

i am lost...
i am trying to do it the right way and am following the Quick Start Guide for installing cakePHP 3 on my ubuntu machine.
Got composer installed. Directory is /var/www/cakephp
and am trying to issue:
php composer.phar create-project --prefer-dist cakephp/app mayapp
or
composer create-project --prefer-dist cakephp/app may app
then i am simply getting:
[InvalidArgumentException]
Could not find package cakephp/app with stability stable.
i do not have a clue what i am doing wrong. Any suggestions?
cakephp/app exists on https://packagist.org, and the command looks ok to me.
Which PHP version are you using? That package is only available with PHP 5.4.16 or later, so you must update if you want to use CakePHP.
However, it is a good idea to only use the same PHP version of your public hosting, using a newer version will lead to problems when deploying your code. If your webspace or public server does not have the latest PHP 5.6 running, ask for an update.
I got same issue. But, as previous answer, myapp does not exists on packagist.org, so, you must use laravel/laravel instead, and, after created, rename the new laravel folder to your desired name and move to htdocs (for xampp) or www (for wamp), then, and I do not know why, go to : localhost/laravel/public/
and replace laravel with the name you gave to your project folder instead the laravel one.
You will see Laravel 5 fonts will appear on screen.
That's means Laravel is running.
Hey Please try these steps.
Download XAMPP Server.
Install XAMPP server.
Go to ..\xampp\php\php.ini and open.
Add this line (extension=php_intl.dll) or if exist uncomment.
Download Composer setup from https://github.com/composer/windows-setup/releases/
Install composer and give php.exe file in path
Open cmd and check now php version using command php -v. if its showing php version its means its working.
Now open cmd and cd on xampp\htdocs folder & run command composer create-project --prefer-dist cakephp/app app_name
Finished folder created in htdocs.
Hope this is helpful for you.

Problems installing laravel with composer [duplicate]

This question already has answers here:
How to place the ~/.composer/vendor/bin directory in your PATH?
(22 answers)
Closed 6 years ago.
Problem: I'm wanting to explore laravel 5, and failing miserably at installing it. I'm using this guide: http://laravel.com/docs/5.0 and need someone to help me understand the instructions.
Background and What I've Tried
I'm running Mac OSX 10.10.2 (Yosemite) and MAMP.
So far, I've downloaded Composer to my home folder using terminal. There is just a composer.phar file sitting there.
When I run:
composer global require "laravel/installer=~1.1"
I get the message:
Changed current directory to /Users/MYUSERNAME/.composer
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Nothing to install or update
Generating autoload files
I assume that is ok because when I run the following in terminal, I get the composer logo and a list of options
~ MYUSERNAME$ composer
I'm not 100% sure what the following means, from the Laravel Docs:
"Make sure to place the ~/.composer/vendor/bin directory in your PATH so the
laravel executable can be located by your system."
Because I can't figure it out, the following steps throw errors, such as:
-bash: laravel: command not found
I've been going through a few forums, and it's suggested that I need to update my PHP.ini file - this seems more related to Composer install, and not specifically Laravel. Because composer is working, this seems to be a dead end.
Ideally, I want to install Laravel 5 to the directory
HomeFolder/sites/test
because Composer.phar is in my home folder, I think the command should be:
php composer laravel new sites/test
or just
composer laravel new sites/test
As mentioned, it just (correctly) throws errors.
Question:
If anyone can help solve my total user error, by explaining what "Make sure to place the ~/.composer/vendor/bin directory in your PATH so the laravel executable can be located by your system." means to a n00b, that'd be really appreciated.
Many thanks!
Laravel is a PHP framework (makes writing PHP applications easy)
Composer is a PHP package and dependency manager. (makes installing and updating third party code libraries easy)
When you run
$ composer global require "laravel/installer=~1.1"
You're using composer to install the laravel/installer=~1.1 package into composer's "global" project folder (usually ~/.composer). This is what installed the command line program named laravel.
The command line program named laravel is a shell script for installing the PHP framework (Also named Laravel).
Your "Unix Path" is a list of folders where a command line script will search for an executable. Usually is has folders like /usr/bin, /usr/local/bin, etc. This is why when you run ls, you're actually running /usr/bin/ls -- the shell knows to check each folder in the path for a location. You can view your current path by typing
$ echo $PATH
So, the problem is composer installed the laravel command line program to a folder that's not in your unix path. You need to add this folder to your unix path. You can do this by running the following (assuming you're using bash, which is OS X's default shell)
$ PATH=$PATH:~/.composer/vendor/bin
If you run that, you should be able to run the laravel command line program and continue your installation.
Most people add this to their .bash_profile or .bashrc files. The Unix Stack Exchange has a lot of good information if you're interested in learning how to do this.
You can add the directory to the PATH variable by editing /etc/paths.
Here's a tutorial on how to do that.
Just add a line with:
~/.composer/vendor/bin
Then the laravel new command should work fine
If everything fails you can still use the composer create-project command to make a new laravel instance:
composer create-project laravel/laravel sites/test --prefer-dist
I added C:\Users\Leon\AppData\Roaming\Composer\vendor\bin instead of ~/.composer/vendor/bin to the Path variable.
Here is instructions on changing the path variable on Windows 10:
http://windowsitpro.com/systems-management/how-can-i-add-new-folder-my-system-path

Laravel error in /bootstrap/start.php: \Illuminate\Foundation\Application not found

So, I installed Laravel on a dev server (php5.5.3, standard installation, mcrypt installed), and I get the following error message:
Fatal error: Class 'Illuminate\Foundation\Application' not found in /[path_to_laravel_app]/bootstrap/start.php on line 14
Quite odd, and I haven't seen a solution to this file, although I've seen plenty of similar errors. Any advice welcome. Thanks!
/bootstrap/start.php is created after composer install by running Laravel's php artisan optimize. I've had a lot of issues on this during upgrades of Laravel, but removing /bootstrap/start.php, composer.lock, and the vendor directory and re-running composer install should fix this issue.
Run this command:
composer update --no-scripts
In my case I have added another required package(Guzzle) in the compser.json file separately(in the last line but it should be after the laravel package line) and updated the compsoser and came across this issue.
I have checked and my vendor/laravel folder has gone. That was preventing me to run any artisian command.
So "--no-scripts" worked for me as it prevents any scripts to be included before executing artisan.
You can use another method in case you are having issues.
Install another raw laravel and copy all the files from the vendor
file to your old repostory.
Change permission of storage and bootstrap folder to 775 or 777.
Delete everything in the session and view folder of storage/framework
Correct the composer.json. This might happen after you have added a new package configuration by dublicating the require tag.
Do not create yet another
require: {
..
}
use the previous defined one.
Then follow the accepted answer to re-install the packages.
Just Run the command
composer install --no-scripts
Or,
composer update --no-scripts
Double check your composer.json file. If you have error on "require": section this error will occur.
Just restore a previous version of composer.json file and run composer update.

Unable to update Laravel 4 with Composer (Update: bug?)

Today, I pulled down the laravel/laravel repository from Github. I then ran php composer.phar install (as I normally would on my system, with a command window in the project directory). However, when I ran php composer.phar update, I received this error:
Everything installed just fine, and Laravel works as it should.
Any ideas what could be causing this issue?
Edit 1
artisan exists in the root of the project, but it throws an exception when I attempt to run php artisan optimize:
Side Note 1
If I try the alternative method (quicker) of installing Laravel (php composer.phar create-project laravel/laravel), I get the following:
Edit 2
Upon installation, I also get the same error, where it claims it cannot find artisan. Therefore, the installation does not fully complete. I believe that it is stopping when it wants to compile classes (or something to that effect), and then write bootstrap/compiled.php. That file doesn't exist.
Here's the snap from the install:
Edit 3
It seems that Composer is looking for artisan in the drive root (C:\). Why is it doing this? Even if I specify -d on the update, it throws the error. (I picked this up from a hunch - simply copied artisan to the root of the drive and it found it - albeit, it obviously did not run...)
Solution Found:
Composer makes calls to php artisan <command> (as per the instruction in composer.json > scripts), but it does not see what directory it is running from (perhaps because it is an external command?).
So, I solved my initial problem by using an absolute path to artisan in composer.json.
Everything is working now. I just wish I knew how to get Composer to know that it is running from C:\LocalServer\lab\laravel, and not just C:\.
As i can see, your artisan file is missing. Can you post the exact steps on how you install it ?
Also, please follow http://laravel.com/docs/installation and http://niallobrien.me/2013/03/installing-and-updating-laravel-4/
I had this problem today too. My laravel folder inside the vendor was deleted after composer update. I ran composer install again and problem resolved.

Categories