Reputation: 2220
I am trying to install phpdocx I am trying to install it via composer I have executed this command
php composer.json install
Then I have typed this url :
http://localhost/PHPWord/samples/Sample_01_SimpleText.php
But I am getting this error :
Fatal error: Uncaught exception 'Exception' with message 'Could not find file '/autoload.php'. It is generated by Composer. Use 'install --prefer-source' or 'update --prefer-source' Composer commands to move forward.' in C:\xampp\htdocs\PHPWord\bootstrap.php:22 Stack trace: #0 C:\xampp\htdocs\PHPWord\samples\Sample_Header.php(2): require_once() #1 C:\xampp\htdocs\PHPWord\samples\Sample_01_SimpleText.php(2): include_once('C:\\xampp\\htdocs...') #2 {main} thrown in C:\xampp\htdocs\PHPWord\bootstrap.php on line 22
How can I solve this error ? Please help me ? I am new in PHP. So please tell how to remove this error ?
Upvotes: 1
Views: 9193
Reputation: 2220
I do not install composer . That is why , I am getting this error . To install composer I have downloaded composer.exe . Then I have run it . After that , I have run the following command in command prompt .
php C:\ProgramData\ComposerSetup\bin\composer.phar install
Then I have run this command :
php composer.json install
Then The problem is solved .
Upvotes: 3