Install Composer

  1. Go to composer official website (
  2. Download installer and rename it to ‘composer-setup.php’
  3. Execute this command line: php composer-setup.php --install-dir=/usr/local/bin
  4. Rename ‘composer.phar’ to ‘composer’ under /usr/local/bin
  5. Execute this command line to test whether it works or not: composer --help

Install PHPWord

  1. Go to PHPWord github website ( to download
  2. Unzip PHPWord code to specific directory and install by this command line: composer install

If there is error reported:

Problem 1
  – The requested PHP extension ext-xml * is missing from your system. Install or enable PHP’s xml extension.
Problem 2
  – phpunit/phpunit 3.7.9 requires ext-dom * -> the requested PHP extension dom is missing from your system.


Check installed php modules: php -m

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


Posted in PHP.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s