Warning: require(/var/www/vendor/autoload.php): - laravel

I am good with API creation but not so good when it comes to set up the system, I was trying to learn setting laravel with docker and was referring:
https://medium.com/#shakyShane/laravel-docker-part-1-setup-for-development-e3daaefaf3c
I followed all the steps correctly but on running:
docker-compose exec app php artisan key:generate
I am getting error:
Warning: require(/var/www/vendor/autoload.php): failed to open stream: No such file or directory in /var/www/artisan on line 18
Fatal error: require(): Failed opening required '/var/www/vendor/autoload.php' (include_path='.:/usr/local/lib/php') in /var/www/artisan on line 18
Am I wrong to assume that this problem is because the composer hasn't run!!
My Project folder is in Desktop
my docker-compose.yml is written like:
# The Application
`app:`
`build:`
`context: ./`
`dockerfile: app.dockerfile`
`working_dir: /var/www`
`volumes:`
`- ./:/var/www``
` environment:`
`- "DB_PORT=3306"`
`- "DB_HOST=database"`
# The Web Server
`web:`
`build:`
`context: ./`
`dockerfile: web.dockerfile`
`working_dir: /var/www`
`volumes_from:`
`- app`
`ports:`
`- 8080:80`
I checked other solutions on the web but I couldn't quite understand how I need to do.

I think it is not a good idea to follow the steps provided in the website since the
composer image is DEPRECATED
you must use the newest one from here

Related

How to fix " No such file or directory"error when I access to the home page

I downloaded a laravel project from a shared hosting and I want to edit him in my localhost but when I type out the home adress:
localhost:8000/
it shows me those two errors :
Warning: require_once(C:\Users\Rafaa\Downloads\Compressed.idea/public/index.php): failed to open stream: No such file or directory in C:\Users\Rafaa\Downloads\Compressed.idea\server.php on line 21
Fatal error: require_once(): Failed opening required 'C:\Users\Rafaa\Downloads\Compressed.idea/public/index.php' (include_path='C:\xampp\php\PEAR') in C:\Users\Rafaa\Downloads\Compressed.idea\server.php on line 21
When you clone or download a project from somewhere, there may be a case that many dependencies like codes or library files are missing. To solve this
Open the terminal
Go to the directory where the project folder is situated.
RUN composer install
If it still does not work,
RUN composer update
That should do the trick.

how do i use the laravel talk functionality

i want to add a user conversation function in my app, but i am having problems installing the talk functionality. i have downloaded the project from github, but i was unable to use it because of this two errors
Warning: require(C:\xampp\htdocs\tok\bootstrap/../vendor/autoload.php): failed to open stream: No such file or directory in C:\xampp\htdocs\tok\bootstrap\autoload.php on line 17
Fatal error: require(): Failed opening required 'C:\xampp\htdocs\tok\bootstrap/../vendor/autoload.php' (include_path='C:\xampp\php\PEAR') in C:\xampp\htdocs\tok\bootstrap\autoload.php on line 17. is there a way out of???
does anyone know how use the talk functionality by nahid??
You just need to run the following in the project folder:
Composer Install
Here is a question with a similar issue that might help you get to the root cause: (possible duplicate question)
Laravel 5 Failed opening required bootstrap/../vendor/autoload.php

Jekyll Error - "serve" only works once

Started working on an update to my website. It was working fine the other day but now I get an error.
I generally type on CMD (i'm on Windows 10) "bundle exec Jekyll serve --watch" and the server goes. I can edit and save and its all reflected in browser upon refresh.
Now I can do this, but if I make one change to any file it works. Do another change and I get an error. I have to terminate and type again.
Below is the error:
D:\Tristen Grant\Documents\GitHub\portfolio>bundle exec jekyll serve --watch
DL is deprecated, please use Fiddle
Configuration file: D:/Tristen Grant/Documents/GitHub/portfolio/_config.yml
Source: D:/Tristen Grant/Documents/GitHub/portfolio
Destination: D:/Tristen Grant/Documents/GitHub/portfolio/_site
Incremental build: disabled. Enable with --incremental
Generating...
done in 0.595 seconds.
Auto-regeneration: enabled for 'D:/Tristen Grant/Documents/GitHub/portfolio'
Configuration file: D:/Tristen Grant/Documents/GitHub/portfolio/_config.yml
Server address: http://127.0.0.1:3000//
Server running... press ctrl-c to stop.
Regenerating: 1 file(s) changed at 2016-09-06 16:16:28 ...done in 0.521498 seconds.
Regenerating: 1 file(s) changed at 2016-09-06 16:16:30 ...error:
Error: No such file or directory - git rev-parse HEAD
Error: Run jekyll build --trace for more information.
[2016-09-06 16:19:35] ERROR Errno::ENOTSOCK: An operation was attempted on something that is not a socket.
C:/Ruby21-x64/lib/ruby/2.1.0/webrick/server.rb:170:in `select'
Terminate batch job (Y/N)? y
Terminate batch job (Y/N)? y
I'm using Ruby 2.1.5 64 bit version. RubyDevKit, Sass, Bourbon.
Any ideas how to fix this? I don't know much about Jekyll or ruby. Just starting out.
I also get this error in CMD. You should have github's desktop app installed; try running the same commands from the GitShell you get with that app.
For me that works, it saves me the trouble of installing git globally on Windows and setting it up.

Enable PHPUnit with Laravel / Homestead on PhpStorm 2016.1 to

I am working on vagrant / homestead, and have a box configured.
I could enable Xdebug in PhpStorm!
Now, I want to enable PHPUnit, but I can't do it...
I followed several tutorials:
https://blog.mayflower.de/5274-Run-your-tests-with-PHPStorm-on-your-vagrant-box.html
https://confluence.jetbrains.com/display/PhpStorm/Running+PHPUnit+tests+over+SSH+on+a+remote+server+with+PhpStorm
Here are my settings:
Here is the message I receive when running PhpUnit with Code Coverage
vagrant:///Users/julien/Homestead/usr/bin/php -dxdebug.coverage_enable=1 /home/vagrant/.phpstorm_helpers/phpunit.php --coverage-clover /home/vagrant/.phpstorm_helpers/coverage/Laravel_PhpUnit.coverage -- configuration /home/vagrant/Code/vendor/autoload.php /Users/julien/Documents/Proyectos/laravel/tests/functional
Testing started at 11:12 AM ...
bash: line 0: cd: /Users/julien/Documents/Proyectos/laravel/tests/functional: No such file or directory
PHP Fatal error: Uncaught UnexpectedValueException: Cannot create phar '/home/vagrant/Code/vendor/bin', file extension (or combination) not recognised or the directory does not exist in /home/vagrant/.phpstorm_helpers/phpunit.php:181
Stack trace:
Fatal error: Uncaught UnexpectedValueException: Cannot create phar '/home/vagrant/Code/vendor/bin', file extension (or combination) not recognised or the directory does not exist in /home/vagrant/.phpstorm_helpers/phpunit.php on line 181#0 /home/vagrant/.phpstorm_helpers/phpunit.php(181): Phar- >__construct('/home/vagrant/C...')
#1 /home/vagrant/.phpstorm_helpers/phpunit.php(250): IDE_PHPUnit_Loader::init()
#2 {main}
UnexpectedValueException: Cannot create phar '/home/vagrant/Code/vendor/bin', file extension (or combination) not recognised or the directory does not exist in /home/vagrant/.phpstorm_helpers/phpunit.php on line 181
thrown in /home/vagrant/.phpstorm_helpers/phpunit.php on line 181
Call Stack:
0.0006 442920 1. {main}() /home/vagrant/.phpstorm_helpers/phpunit.php:0
0.0006 442920 2. IDE_PHPUnit_Loader::init() /home/vagrant/.phpstorm_helpers/phpunit.php:250
0.0006 451168 3. Phar->__construct() /home/vagrant/.phpstorm_helpers/phpunit.php:181
Process finished with exit code 255
Setting up vagrant with PhpStorm and PHPUnit can be a little bit daunting as it is really not that straight forward... From your console output I'd say that your interpreter setting is not correct since it executes PHP on your local machine.
The way that always worked for me was setting up vagrant as SFTP Deployment Configuration and use that configuration as PHP interpreter. As you are already using Homesteasd, these tutorials might shed some more light onto the setup:
Setting up PhpStorm with Vagrant on a Laravel Homestead box
Setting up Laravel with PHPUnit on Vagrant in PhpStorm
Here are the essential parts:

Can't install "Composer Dependency Manager for PHP"

root#rushan-PC:~# curl -sS https://getcomposer.org/installer | php
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20090626/gd.so' - /usr/lib/php5/20090626/gd.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20090626/mcrypt.so' - /usr/lib/php5/20090626/mcrypt.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20090626/mysql.so' - /usr/lib/php5/20090626/mysql.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20090626/mysqli.so' - /usr/lib/php5/20090626/mysqli.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: Module 'PDO' already loaded in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20090626/pdo_mysql.so' - /usr/lib/php5/20090626/pdo_mysql.so: cannot open shared object file: No such file or directory in Unknown on line 0
#!/usr/bin/env php
Some settings on your machine make Composer unable to work properly.
Make sure that you fix the issues listed below and run this script again:
The suhosin.executor.include.whitelist setting is incorrect.
Add the following to the end of your `php.ini` or suhosin.ini (Example path [for Debian]: /etc/php5/cli/conf.d/suhosin.ini):
suhosin.executor.include.whitelist = phar
The php.ini used by your command-line PHP is: /etc/php5/cli/php.ini
If you can not modify the ini file, you can also run `php -d option=value` to modify ini values on the fly. You can use -d multiple times.
Terminal gives me this error. Before that, I installed php packages, there was some error
"Unable to correct problems, you have delayed (held) broken packages." But I can install it with aptitude, instead of apt-get. Perhaps, this dynamic libraries errors because of Held packages? Or something...Please, I need some help there:(. Sorry, I'm just a beginner in Linux and programming. And sorry for my English, cuz I'm from Uzbekistan :(
According to information in your error, you should edit your php.ini file (/etc/php5/cli/php.ini) and add the following line at the end
suhosin.executor.include.whitelist = phar
You should edit your php.ini file (/etc/php5/cli/php.ini) and add the following line before the END: keywords.
suhosin.executor.include.whitelist = phar

Resources