2

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.

halfer
  • 19,824
  • 17
  • 99
  • 186
Amrinder Singh
  • 5,300
  • 12
  • 46
  • 88

1 Answers1

6

You can recreate your project autoload by this method:

  1. Open your terminal,
  2. cd /var/www/html/bookmarker,
  3. composer dumpautoload

Give it a try.

Rendy Eko Prastiyo
  • 1,068
  • 7
  • 16
  • Hii, i have tried this, got a new error: "Class Cake\Composer\Installer\PluginInstaller is not autoloadable" any idea? – Amrinder Singh May 22 '17 at 07:21
  • great, this worked for me, it created autoload.php and other files in vendor folder now, thanks for helping, but could you please tell me what exactly issue was? why the files were not created during initial setup? – Amrinder Singh May 22 '17 at 07:28
  • If you execute `create-project`, the initial packages (and their dependencies) are downloaded in `vendor/` dir. After downloaded, composer will create autoloader for the vendor classes. In your case, it seems like you remove the content of `vendor/`. Executing `update` will redownload the packages and regenerate the autoload. – Rendy Eko Prastiyo May 22 '17 at 07:33