- Go to composer official website (https://getcomposer.org/doc/00-intro.md)
- Download installer and rename it to ‘composer-setup.php’
- Execute this command line:
php composer-setup.php --install-dir=/usr/local/bin
- Rename ‘composer.phar’ to ‘composer’ under /usr/local/bin
- Execute this command line to test whether it works or not:
- Go to PHPWord github website (https://github.com/PHPOffice/PHPWord) to download
- Unzip PHPWord code to specific directory and install by this command line:
If there is error reported:
– The requested PHP extension ext-xml * is missing from your system. Install or enable PHP’s xml extension.
– phpunit/phpunit 3.7.9 requires ext-dom * -> the requested PHP extension dom is missing from your system.
Check installed php modules:
Install DOM php module:
sudo apt-get install php-dom
Reading package lists… Done
Building dependency tree
Reading state information… Done
Package php-dom is a virtual package provided by:
You should explicitly select one to install.
E: Package ‘php-dom’ has no installation candidate
Select current php version according to phpinfo(); Then execute:
sudo apt-get install php7.0-dom