简体   繁体   中英

How do I install PHPword in xampp

SO I am new to phpword and is it possible to use it in xampp? or how install in so i can use it in vscode or sublime.

it said that i need to use composer to use it but I couldn't make it work

It is possible. Myself using Xampp in Windows to development one of my open source project which using PhpWord and PhpSpreadsheet library.

From latest PhpWord documentation, it says the installation need to be done via Composer. First of all, you need the Composer.

Install composer & PhpWord in Linux,
The installation in Linux is pretty straight forward as written in the Composer documentation , else you can just type in Google Search: How to install composer in your-linux-OS (CentOS, Ubuntu, etc). I believe there are tons of example which will teach you how to install composer in your Linux OS.

Once you got composer installed, just move to your project directory, init composer and start install PhpWord composer require phpoffice/phpword . Finally start Xampp and you can now use PhpWord.

Install composer & PhpWord in Windows,
In Windows, it is quite easy as well. Download the installer and install it as written in the documentation .
Here a more detail reference of installing both Xampp and Composer in Windows with image guideline that I used.

Once you got composer installed, you can actually use composer directly in the command prompt. You can use command prompt to move to your project directory, init composer and start install PhpWord. If you're using VS Code editor, I found an interesting youtbe video which using the terminal function in vscode and install PhpWord using composer directly in vscode. And finally, start Xampp and voila~ there you go to start using PhpWord.

Hope it helps!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM