I am trying to install PHPWord library of PHP using composer but i cant install.
I have tried to follow https://github.com/PHPOffice/PHPWord.
PHPWord is installed via Composer. You just need to add dependency on PHPWord into your package. If you are a developer or if you want to help us with testing then fetch the latest branch for developers. Notice: all contributions must be done against the developer branch.
Run this command in the root of your project to add the dependency to composer.json and install the librarie:
composer require phpoffice/phpword
Run this command in the root of your project $ composer require phpoffice/phpword
You will find vendor folder and 2 files composer.json and composer.lock in the root folder of your project.
Create a new file, index.php, in the root folder of the project(or some other filename). Copy paste the basic usage sample code provided in https://github.com/PHPOffice/PHPWord
Change the line require_once 'bootstrap.php'; to require_once 'vendor/autoload.php';
Run the new file created and then you can see the docx file created in the root folder of your project.
You just need to add dependency on PHPWord into your package. just below code in your composer.json file
{
"require": {
"phpoffice/phpword": "v0.13.*"
}
}
and then execute the below code from console
$ composer.phar install
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With