Search code examples
phpphp-amqp

autoload.php issue: failed to open stream: no such file or directory


I am new to PHP and trying to figure out issues with autoload.php. I downloaded php-amqplib package and it's dependencies and trying to test PHP page. I am getting failed to open stream: No such file or directory 'D:\inetpub\wwwroot\test\vendor\videlalvaro\php-amqplib\demo/../vendor/autoload.php' (include_path='.;C:\php\pear'). I am using 5.3.13 and it's installed in 'D:\PHP5313' folder. There is no 'pear' folder. Could you please let me know if I am missing something? Thanks for any suggestions.

autoload.php

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

return ComposerAutoloaderInit5e74aaf68e13rfe5f321c5a586eb96f22::getLoader();

Solution

  • Your path to the required file it not correct (autoload.php).

    __DIR__ is the actual directory where the file is located. I think you have to go back to come to the folder where the autoload.php is located.

    D:\inetpub\wwwroot\test\vendor\videlalvaro\php-amqplib\demo/../vendor/autoload.php' 
    

    I think you have to go back to the vendor folder in your case where normally the autoload file is located. I think its 3 folders higher.