0

I am setting up Laravel development environment on a new PC and everything is installed correctly, which is XAMPP, NODE JS, and Composer. However, when I try installing Laravel either through the Laravel installer or through the composer, I get an error that says: [ErrorException] file_get_contents(): read of 8192 bytes failed with errno=9 Bad file descriptor. I have tried to search for an answer on StackOverflow and got only one option but it didn't work for me. Could someone be willing to help me detect where the problem is? Thank you in advance. (Laravel version 7).

Simon Angatia
  • 688
  • 1
  • 10
  • 16

2 Answers2

2

i did a quick search and seems its a bug in PHP 7.4, should work well in PHP 7.3. https://bugs.php.net/bug.php?id=79166

Which version you using ?, you can check using phpinfo(); or this Find PHP version on windows command line

Jitesh Dhamaniya
  • 1,326
  • 2
  • 8
  • 17
  • I have done that, the error has gone but then when I try running `php artisan serve` , I get this error again `PHP Warning: require(C:\xampp\htdocs\projects\freelance\rivala0/vendor/autoload.php): failed to open stream: No such fi le or directory in C:\xampp\htdocs\projects\freelance\rivala0\artisan on line 18 ` but even after doing `composer install`, I get the same error! – Simon Angatia Aug 15 '20 at 09:02
  • use composer install, followed by composer dump-autoload – bhucho Aug 15 '20 at 10:54
  • @bhucho answer should work. if not i would suggest remove vendor folder and also remove composer.lock file and composer install again. – Jitesh Dhamaniya Aug 15 '20 at 11:01
  • @JiteshDhamaniya deleting the composer lock file and vendor folder worked great! Thank you so much! – Simon Angatia Aug 15 '20 at 17:55
  • Glad could help :) – Jitesh Dhamaniya Aug 15 '20 at 18:03
0

Use PHP version 7.3.28 or below, it will work 100%.

Showrin Barua
  • 1,737
  • 1
  • 11
  • 22
Dani_121
  • 1
  • 1