-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Composer installs not generating autoload.php properly? #850
Comments
did u find the answer?? |
@avinashdchase unfortunately, no. I did a terrible hackjob to make it somewhat work, but that fell short and I ran out of things to try. |
Basically the bootstrap file is not getting the right path, at least for the samples page.
Once we get to the current directory, we need to travel back up two folders. |
@CodeJason's suggestion worked for me. |
@CodeJason's code worked for me as well. Is there a reason this hasn't been pushed? |
Thanks @CodeJason, your suggestion helped me too |
Had to use this
Reminds me again why I dislike composer. I had never been able to install at least one package with composer successfully from scratch. All needed rework. |
Or you can simply change $vendorDirPath = realpath($_SERVER["DOCUMENT_ROOT"] . '/vendor');
if (file_exists($vendorDirPath . '/autoload.php')) {
require $vendorDirPath . '/autoload.php';
} else {
throw new Exception(
sprintf(
'Could not find file \'%s\'. It is generated by Composer. Use \'install --prefer-source\' or \'update --prefer-source\' Composer commands to move forward.',
$vendorDirPath . '/autoload.php'
)
);
} |
If you are starting the server from the samples folder (php -S localhost:800) try this:
Seems complex for just a self contained sample page. |
you should run |
@1manfactory 很棒,弄了半天,还是你的这一句解决了我的问题!棒棒哒! |
The docs need to better cover composer issues. Came back to this project to run some tests and could not get it to build. Finally ran: composer update And it got all the dependencies correctly and generated the autoload files so they work ! |
Hi i can not update phpword package . phpword package 0.16.0 and composer version is 1.8.1 |
Laptop setup ok it working but where install it windows server 2012 r2 then composer installed ok. package cant update |
@vatavale your solution is perfect and work in any case |
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:This is my composer.json:
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.
The text was updated successfully, but these errors were encountered: