Skip to content

Composer installs not generating autoload.php properly?  #850

Closed
@mbmjertan

Description

@mbmjertan

Hey,

I tried installing PHPWord using composer install --prefer-source and the composer.json that you suggest developers should use in the documentation, but I'm getting this error in my error log when I try running the samples:

[04-Aug-2016 00:39:25 Europe/Zagreb] PHP Fatal error:  Uncaught Exception: Could not find file '/autoload.php'. It is generated by Composer. Use 'install --prefer-source' or 'update --prefer-source' Composer commands to move forward. in /Users/mbm/projekti/SomeProject/vendor/phpoffice/phpword/bootstrap.php:22
Stack trace:
#0 /Users/mbm/projekti/SomeProject/vendor/phpoffice/phpword/samples/Sample_Header.php(2): require_once()
#1 /Users/mbm/projekti/SomeProject/vendor/phpoffice/phpword/samples/index.php(2): include_once('/Users/mbm/proj...')
#2 {main}
  thrown in /Users/mbm/projekti/SomeProject/vendor/phpoffice/phpword/bootstrap.php on line 22

This is my composer.json:

{
    "name": "mbmjertan/SomeProject",
    "authors": [
        {
            "name": "Mario Borna Mjertan",
            "email": "[email protected]"
        }
    ],
     "require": {
       "phpoffice/phpword": "dev-develop"
    }
}

Composer:
Composer version 1.2-dev (06499749ff8875f939f413cf9a3725792d4ee4f9) 2016-07-11 07:16:26

PHP 7.0.0 on Mac OS X 10.11.6 (El Capitan) under Apache

Is there something I'm doing wrong or missing? This is my first time using Composer in a project.

For what it's worth, I tried looking at the source myself and it seems that PHPOffice is trying to include files from $vendorDirPath = realpath(__DIR__ . '/vendor');, a folder that does not exist.


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions