Forgive the seeming lameness here. I’m working with a shared hosting with onnly access to cpanel and host are not willing to install composer nor PHPWord on my behalf. Is it possible to install PHPWord by just downloading the ZIP from github? Thanks
Forgive the seeming lameness here. I’m working with a shared hosting with onnly access to cpanel and host are not willing to install composer nor PHPWord on my behalf. Is it possible to install PHPWord by just downloading the ZIP from github? Thanks
4
Answers
You can use Composer locally and then upload the files to the server.
I asked about this here: Using Composer locally then uploading files through FTP
Basically, if you can’t run Composer on the server, use it locally, then copy the necessary files to the server.
The reason you should use it is because it will download the dependencies for you, without you having to manually configure a load of stuff. That’s very much the point of Composer 🙂
Download The PHpWord Zip FIle From Here: https://github.com/PHPOffice/PHPWord/archive/develop.zip
Yes, I do it all the time. For PHPWord, I would download the zip file from GitHub and move the contents of the src folder to a directory called “libPhpOfficePhpWord”. You’ll then need a PHP class loader. I always use this for autoloading, provided the Classes are properly namespaced, which appears to be the case.
Set your $GLOBALS[‘class_path’] to the location of the ‘lib‘ directory and be sure to use ‘use‘ as needed before attempting to instantiate PHPWord.
Hope this helps!
Here you can download PHPWord without composer:
https://php-download.com/package/phpoffice/phpword
On this site are all libraries from the composer network but you can download all of them without a composer installation.