laravel application moved to another pc - laravel

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.

Related

Cannot create cache directory for Laravel project

I am trying to create my first Laravel project but i am having a problem with composer and some permissions (at least that's what i understand).
When I open my cmd to create a new Laravel project , using this command (create-project laravel/laravel basicwebsite), I get an error.
The error message is
“Cannot create cache directory C:\Mamp\htdocs/
C:\Users\giorg\AppData\Roaming\Composer/cache/repo/https---repo.packagist.org/,
or directory is not writable. Proceeding without cache”.
enter image description here
I am still new and I don’t know much but it seems that my folders are not writable or something similar.
I am using MAMP and windows 10.
Thanks in advance for your time.
If the folder is owned by root, even if you have admin privileges, you still dont have permission, this happens when you use sudo while installing composer.
It can be solved by
sudo chown -R $USER $HOME/.composer
The problem is with your composer installation, not the folder permissions.
You should probably install globally, but locally to your user, it should only be used by your user account and not by the web server
https://getcomposer.org/doc/00-intro.md#globally
Or
composer.phar create-project laravel/laravel basicwebsite
php composer.phar create-project laravel/laravel basicwebsite

how to fix error laravel 5.2 "failed to open stream: No such file or directory" without composer

I've got this error in my laravel 5.2 project who hosted in debian linux
Warning: require_once(/home/u706561288/public_html/sap/vendor/composer/autoload_real.php): failed to open stream: No such file or directory in
/home/u706561288/public_html/sap/vendor/autoload.php on line 5
Fatal error: require_once(): Failed opening required '/home/u706561288/public_html/sap/vendor/composer/autoload_real.php' (include_path='.:/opt/alt/php70/usr/share/pear') in
/home/u706561288/public_html/sap/vendor/autoload.php on line 5
so many forum like stackoverflow tell me to using php artisan "composer update" but
unfortunately my hosting package not available to composer instalation
please tell me how to fix this problem
I suggest that you test these steps
On the Localhost, run these two commands (composer update and composer dump-autoload)
Re-upload the entire project on the server
Also, if the problem is not resolved, you can delete the ‍Vendor folder and the composer.lock file and run the composer install command and Re-upload the entire project again.
When the hosting service or some PC does not allow to install Composer and appears error like in my case, follow these steps:
Delete all laravel project in hosting service. I recommend to use smartftp for good speed file access and tracked action.
Back to our localhost project and run composer install --no-scripts command and then composer clearcache.
Reupload all laravel project.
Don't forget to configure .env file.
I hope this can help with the same problem in future.
I had the same error while back, what I did to solve it was. I delete all the vendor folder from the root project then install it back by executing composer install
delete the ‍Vendor folder and the composer.lock file and run the composer install command and Re-upload the entire project again
this helped me
If anyone still facing the issue after deleting the vendor directory and did composer install try to update your composer by composer selfupdate then do the same install process.

Vendor folder does not exist and cannot be created

Question:
What kind of permissions should I give to Composer on Windows?
Server information:
Windows 2012 R2
IIS 8.5
Error message:
[RuntimeException]
C:\inetpub\wwwroot/vendor does not exist and could not be created.
Steps that I've tried and thoughts:
I've installed Composer through the .exe file.
I have a composer.json file in C:\inetpub\wwwroot and when I try running composer install or composer update, I get the error message.
I've tried manually creating the vendor folder in the directory, but then it cannot download the package that I have in my composer.json file, giving roughly the same error message, that the package doesn't exist and could not be created.
I've googled the error, and I'm led to believe it's a permissions issue, however, I have installed Composer on another server and installed packages in the C:\inetpub\wwwroot directory without a problem. I've tried comparing security group permissions between the two servers for wwwroot and inetpub, and the permissions were the same. I had someone suggest trying to copy the .json file to My Documents on the server and try running composer install from there, and that worked. Which further indicates it's a permissions issue, but I can't figure out what.
After re-reading another Linux question, I figured out what the problem was. I need to be running Command Prompt as administrator. Now it works.
Please ensure that whether your deployment folder is having composer.lock file or not.' If not please deploy the file there.

Using Laravel "Warning:require(C:\wamp\www\laravel\bootstrap/../vendor/autoload.php): failed to open stream: No such

I am new to laravel, composer, and windows terminal. I am trying to setup laravel on my local host. I currently have wamp installed and I have used it before to create basic websites. However, I am now doing a bigger project that needs a framework so I decided to learn Laravel. I installed composer as indicated in the directions, but when i run the command
"C:\wamp\www>composer create-project laravel/laravel laravel"
i generate an error message that says
"[InvalidArgumentException] Project directory laravel/ is not empty."
When I open a browser and navigate to "localhost/laravel/public" I encounter the error message from the title of this thread:
"Warning:require(C:\wamp\www\laravel\bootstrap/../vendor/autoload.php): failed to open stream: No such
I have also added the appropriate environment variables from the composer instructions.
I am really lost at this point, and I have spent the past 4 hours trying to debug this.
I am running Windows 8 x64.
Edit:
I tried running composer install in C:\wamp\www and received an error message
Composer could not find the config file:
C:\ProgramData]ComposerSetup\bin Ti initialize a project, please
create a composer.json file as described in the
http://getcomposer.org/ "Getting Started" section "
The dependencies for your project are not installed. Just download composer from GetComposer.org and install it on your Windows Machine. Then navigate to your project root, you will see a composer.json file there. That file specifies all the dependencies of the project. Run composer update in that directory. Composer will then update or install all required dependencies and your application won't show the error then.
cd \wamp\www\yourproject
composer update
"C:\wamp\www>composer create-project laravel/laravel laravel"
"[InvalidArgumentException] Project directory laravel/ is not empty."
This means C:\wamp\www\laravel already existed when you attempted to run the command. Remove the folder, or change the create-project command to use a different folder name for your new project.
"Warning:require(C:\wamp\www\laravel\bootstrap/../vendor/autoload.php): failed to open stream: No such
You need to do a composer install from C:\wamp\www\laravel.
I figured it out! I was missing a folder called "vendor" and a file inside bootstrap called "compiled.php" Sorry for the inconvenience, and thank you for trying!
use the following command to get vendor folder in your project
composer install --no-scripts
i had the same problem but i just ran this command
composer install
to install all the dependencies

PHP Composer can't find composer.json file for my project

I have successfully installed Composer in the root directory (that was the default choice) on my Linux/Apache server using their installation guide. It's all been very simple so far, except for one php.ini tweak I've had to make (detect_unicode = Off) but now I'm stuck.
I'm trying to install Ratchet using Composer, with the use of this guide:
http://socketo.me/docs/install
It says I need to "create a file called composer.json in your project folder". So I created that file (with the contents they gave on their page) using the cPanel file manager, in my application's root directory. However, when I run Composer using:
php composer.phar install
PuTTy gives the following error message:
Composer could not find a composer.json file in /root
To initialize a project, please create a composer.json file as described in the http://getcomposer.org/ "Getting Started" section
But this doesn't seem to make sense, why would I place the JSON file in the server's root if the documentation says to place it in the project folder? What am I missing?
I just found on other topic that you can use :
php composer.phar --working-dir=/home/user/folder/ update
It looks like you're executing php composer.phar install in /root path.

Resources