Autoload Error: No such file or directory

I have included autoload.php in the header of my site

include 'vendor/autoload.php'; 

From this i am receiving the following errors on my site:

Warning: require_once(DIR/composer/autoload_real.php) [function.require-once]: failed to open stream: No such file or directory in /homepages/6/d416629391/htdocs/leftovercheese/vendor/autoload.php on line 5

Fatal error: require_once() [function.require]: Failed opening required 'DIR/composer/autoload_real.php' (include_path='.:/usr/lib/php5') in /homepages/6/d416629391/htdocs/leftovercheese/vendor/autoload.php on line 5

My code is:

// autoload.php generated by Composer

require_once __DIR__ . '/composer' . '/autoload_real.php';

return ComposerAutoloaderInit8be239f5caef32db03f87bb271ed6012::getLoader();

PHP Version: 5.2.17

Any ideas?

Answers


You have to load vender/autoload.php, which will autoload that file for you:

require_once __DIR__ . '/vendor/autoload.php';

This is assuming that your file is located at the same directory level as the vendor directory.

Otherwise, adjust.


Need Your Help

MVC4 Checkbox back to controller

asp.net asp.net-mvc-4

I'm not a seasoned front-end developer, so I'm struggling with this simple issue...

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.