1

i install composer for windows using this link http://getcomposer.org/download/ > http://getcomposer.org/Composer-Setup.exe

my web server is WAMP php 5.4 with openssl enabled.

i created composer.json with this code

{
    "require": {
        "doctrine/orm": "*"
    }
}

and run with this code in .php file

<?php
// bootstrap.php
// Include Composer Autoload (relative to project root).
require_once "vendor/autoload.php";

and i got error Warning: require_once(vendor/autoload.php): failed to open stream

how to get composer's autoload.php?

why composer does not generate it?

how to use doctrine without composer?

2 Answers 2

2

Did you actually look to see if a vendor/autoload.php was created?

Did composer throw any error messages? Unless you got an error then I'm willing to bet that a vendor/autoload files was made. Is there anything in vendor?

I'm guessing that your bootstrap.php is not in your root directory (same directory as composer.json). If so you need to adjust the path in your require statement.

Sign up to request clarification or add additional context in comments.

1 Comment

Bah! I need to open my eye more often so that I can see things.
0

Remove the autoload part from your composer.json, then run composer install

This will generate an updated autoload object, good luck!


"autoload": {
    "classmap": [
        "..."
    ]
 }

2 Comments

Please add some explanation to your answer such that others can learn from it - what makes you think that the OP had such a configuration in his file?
I added some info for you sir, I know this because it happened to me multiple times.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.