Drupal8 installation with Lando - php

I am having this error when I try to install drupal8 using Lando.
Warning:
require(/app/vendor/composer/../ircmaxell/password-compat/lib/password.php):
failed to open stream: No such file or directory in
/app/vendor/composer/autoload_real.php on line 66 Fatal error:
require(): Failed opening required
'/app/vendor/composer/../ircmaxell/password-compat/lib/password.php'
(include_path='.:/usr/local/lib/php') in
/app/vendor/composer/autoload_real.php on line 66
I have already tried lando composer install and composer update but the error has persisted.

lando restart then do lando composer install
this worked for me.

It seems vendor directly is not available in your repository. Run lando composer install inside web folder then lando drush cr.

Follow the below steps:
Lando start
Lando composer install
install Lando drush cim -y
Lando drush cr

Related

autoload.php missing from vendor folder with Cakephp 3.0

I have installed fresh package of Cakephp 3.0, I have followed this tutorial, a fresh package has been installed on my system, but when I try to run the server then I get this error:
PHP Warning: require(/var/www/html/bookmarker/vendor/autoload.php): failed to open stream: No such file or directory in /var/www/html/bookmarker/bin/cake.php on line 31
And these are the commands I have used:
curl -s https://getcomposer.org/installer | php
php composer.phar create-project --prefer-dist cakephp/app bookmarker
cd bookmarker/
bin/cake server
When I tried the last command I got that error.
You can recreate your project autoload by this method:
Open your terminal,
cd /var/www/html/bookmarker,
composer dumpautoload
Give it a try.

Laravel does not create folder vendor

After installing Composer it worked well, Laravel created all folders and it started correctly with:
php artisan serve
Now, when I try:
laravel new mypro
It does not create the vendor folder. And when I try:
php artisan serve
It says:
php artisan serve
PHP Warning: require(/mnt/PROJECTS/[3]_PROCOM/[6]_PHP_Learning/Laravel_1/blog4/bootstrap/../vendor/autoload.php): failed to open stream: No such file or directory in /mnt/PROJECTS/[3]_PROCOM/[6]_PHP_Learning/Laravel_1/blog4/bootstrap/autoload.php on line 17
PHP Fatal error: require(): Failed opening required '/mnt/PROJECTS/[3]_PROCOM/[6]_PHP_Learning/Laravel_1/blog4/bootstrap/../vendor/autoload.php' (include_path='.:/usr/share/php') in /mnt/PROJECTS/[3]_PROCOM/[6]_PHP_Learning/Laravel_1/blog4/bootstrap/autoload.php on line 17
After I copy folder vendor it says:
php artisan serve
PHP Fatal error: Class 'Illuminate\Notifications\NotificationServiceProvider' not found in /mnt/PROJECTS/[3]_PROCOM/[6]_PHP_Learning/Laravel_1/blog3/vendor/laravel/framework/src/Illuminate/Foundation/ProviderRepository.php on line 146
[Symfony\Component\Debug\Exception\FatalErrorException]
Class 'Illuminate\Notifications\NotificationServiceProvider' not found
I encountered the same problem. It occurred because the composer was not able to install the dependencies specified in composer.json file. try running
composer install
If this does not solve the problem, make sure the following PHP modules are installed php-mbstring php-dom
To install this extensions run the following in terminal
sudo apt-get install php-mbstring php-dom
once the installation is complete
try running the command again in your project root folder
composer install
So, if the above doesn't work, you can as well try this command
composer update --no-scripts
More solutions on this thread.
Laravel 5 Failed opening required bootstrap/../vendor/autoload.php
Instead of copying vendor folder please run a command
composer install
in your laravel's project directory
After trying multiple solutions from different sources, the only thing that worked for me was upgrading the PHP version.
Try to install it manually sudo apt-get install php5.6-mbstring

cakephp 3 failed to open vendor/autoload.php after cloning a git repository

I have a git repository which is a simple cakephp3 application. (i cant share because that is private).
i forked the repository and cloned it to my local directory, but as i open the url it gives me this error:
Warning: require(C:\xampp\htdocs\cakephp\shopinator\sms\smsv3\vendor\autoload.php): failed to open stream: No such file or directory in C:\xampp\htdocs\cakephp\shopinator\sms\smsv3\config\bootstrap.php on line 23 Fatal error: require(): Failed opening
required 'C:\xampp\htdocs\cakephp\shopinator\sms\smsv3\vendor\autoload.php' (include_path='.;C:\xampp\php\PEAR') in C:\xampp\htdocs\cakephp\shopinator\sms\smsv3\config\bootstrap.php on line 23
I also have composer installed and is recognizable. I'm using git bash.
the same repository is running fine on another machine.
Any help would be appreciated.
Update:
I've tried it this way:
I'm installing cakephp 3 using composer, it still gives me the same error.
composer create-project cakephp/app
I've also tried this but no luck.
Update:
with this command
composer create-project --prefer-dist cakephp/app
the fresh installation worked.
I've solved the problem.
I downloaded the composer.phar file from packagist.org
and executed the following commands in my application root.
php composer.phar install
Now i don't have that autoload.php issues.

PHPUnit complains about Selenium

Sorry if this is trivial but I did not find any advice how to fix this.
I am on Ubuntu and need PHPUnit for my Yii project.
I have installed PHPUnit twice, by downloading and moving phpunit.phar to '/usr/local/bin' and by running:
composer global require "phpunit/phpunit=3.7.*"
Now I am trying to execute my Yii PHPUnit test:
phpunit unit/DbTest.php
And what I get is:
PHP Warning: require_once(PHPUnit/Extensions/SeleniumTestCase.php):
failed to open stream: No such file or directory in
/opt/lampp/htdocs/yii-project/framework/test/CWebTestCase.php on line 12
PHP Fatal error: require_once(): Failed opening required
'PHPUnit/Extensions/SeleniumTestCase.php'
(include_path='.:/usr/share/php:/usr/share/pear') in
/opt/lampp/htdocs/yii-project/framework/test/CWebTestCase.php on line 12
So it seems that it can't find PHPUnit extension SeleniumTestCase.php. Then PHPUnit installation manual states that Selenium 'is included in the PHAR distribution of PHPUnit.'.
Can you suggest what do I do to make my Yii test work?
You need to install optional additional packages of phpunit for Yii testing to run
The packages you would need are
PHP_Invoker
DbUnit
PHPUnit_Selenium
phpunit-story
You can install them using composer by adding the following to require-dev
"phpunit/php-invoker": "*",
"phpunit/dbunit": ">=1.2",
"phpunit/phpunit-selenium": ">=1.2",
"phpunit/phpunit-story": "*"
use the following commands to install the respective dependencies
composer global require 'phpunit/phpunit-selenium=*'
composer global require 'phpunit/phpunit-story=*'
composer global require 'phpunit/dbunit=*'
composer global require 'phpunit/php-invoker=*'
What I did to fix this:
1) I have downloaded selenium extensions from:
https://github.com/sebastianbergmann/phpunit-selenium/tree/master/PHPUnit/Extensions
and placed the entire PHPUnit directory under
/opt/lampp/htdocs/yii-project/framework/test
At that point PHPUnit stopped complaining about missing SeleniumTestCase.php.
2) Then I got an error about missing file in
PHPUnit/Runner/Version.php
To fix this I commented out these lines in CTestCase.php:
//require_once('PHPUnit/Runner/Version.php');
//require_once('PHPUnit/Util/Filesystem.php'); // workaround for PHPUnit <= 3.6.11
//require_once('PHPUnit/Autoload.php');
Now I am able to run my tests.
Here is what worked for me
sudo pear config-set auto_discover 1
sudo pear channel-discover pear.phpunit.de
sudo pear install --alldeps pear.phpunit.de/PHP_Invoker
sudo pear install --alldeps pear.phpunit.de/DbUnit
sudo pear install --alldeps pear.phpunit.de/PHPUnit_Selenium
sudo pear install --alldeps pear.phpunit.de/phpunit-story
In time of replying this, it is necessary to little bit amend Manquer's response. It is necessary to edit CWebTestCase and include Selenium2TestCase.php instead of SeleniumTestCase.php and extending PHPUnit_Extensions_Selenium2TestCase instead of PHPUnit_Extensions_SeleniumTestCase. Php-invoker is not possible to install on Windows and it is not necessary.

How to install a project using symfony

I am trying to install on my local machine the following project connect which is using symfony2.
I did perform the following commands:
cd myWebDirectory
git clone git://github.com/dsyph3r/connect
git submodule update --init
When I try to call the following page from my localhost I get the following error:
http://localhost/~myName/connect/web/app_dev.php
Server error
If I look to the logs file of apache I read:
PHP Fatal error: require_once():
Failed opening require
'/Users/myName/Sites/connect/app/../vendor/symfony/src/Symfony/Component/Locale/Resources/stubs/functions.php'
How should I install the vendor?
What I did miss?
You forgot to install the vendor ("third party") libraries.
php bin/vendor install
Update: It's a while ago, since I wrote this and it's not valid anymore (for new(er) projects). Since 2.1 it uses Composer
php composer.phar install

Categories