Class 'ZendStdlibStringUtils' not found using phpWord and cakephp3
I am using cakephp3 with a PhpWord application where I just read in a template and fill in the values from a db. I have the phpoffice dir in /vendor. THis exact same code works in linux apart from the directory slashes!!! In win10 it doesnt work as I get a
Class 'ZendStdlibStringUtils' not found //this file exists in vendor/zendframework/zend-stdlib
error is from line $phpWord->setValue("studentname",$studentname);
I have no idea why this code fails in win10 but works on linux server
//in controller
use PHPWord;
...
$template_filename = $assessmentname;
$template_destname = "$assessmentname-" . $lesson->id . "-" . $student->id;
$source = getcwd()."\doc\templates\{$template_filename}.docx";
$template_destfile = $base_dir."{$template_destname}.docx";
$phpWord = new PhpOfficePhpWordTemplateProcessor($source);
$phpWord->setValue("studentname",$studentname); //error is on this line
debug( $source);
debug( $phpWord);
//output with debugs prove the phpobject is being picked up
srcControllerTutorsController.php (line 4176)
'C:wamp64wwwcrmwebrootdoctemplatesSecondary Maths and English Assessment.docx'
srcControllerTutorsController.php (line 4177)
object(PhpOfficePhpWordTemplateProcessor) {
[protected] zipClass => object(PhpOfficePhpWordSharedZipArchive) {
numFiles => (int) 18
filename => 'C:WindowsTempPhp767D.tmp'
[private] tempDir => null
[private] zip => object(ZipArchive) {
status => (int) 9
statusSys => (int) 0
numFiles => (int) 18
filename => 'C:WindowsTempPhp767D.tmp'
comment => ''
}
[private] usePclzip => false
}
[protected] tempDocumentFilename => 'C:WindowsTempPhp767D.tmp'
[protected] tempDocumentMainPart => '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
...
I cant embed images but here is the stack trace
Error in: ROOTvendorphpofficePhpWordsrcPhpWordTemplateProcessor.php, line 195
( ! ) Xdebug: user triggered in C:wamp64wwwcrmsrcTemplateErrorerror500.ctp on line 33
Call Stack
# Time Memory Function Location
1 0.8621 11983648 CakeErrorBaseErrorHandler->wrapAndHandleException( ) ...BaseErrorHandler.php:0
2 0.8647 11990088 CakeErrorBaseErrorHandler->handleException( ) ...BaseErrorHandler.php:163
3 0.8647 11990088 CakeErrorErrorHandler->_displayException( ) ...BaseErrorHandler.php:179
4 0.8719 12087752 CakeErrorExceptionRenderer->render( ) ...ErrorHandler.php:144
5 0.8762 12293032 CakeErrorExceptionRenderer->_outputMessage( ) ...ExceptionRenderer.php:192
6 0.8928 12541352 CakeErrorExceptionRenderer->_outputMessage( ) ...ExceptionRenderer.php:327
7 0.8928 12541352 CakeControllerController->render( ) ...ExceptionRenderer.php:320
8 0.8953 12544904 CakeViewView->render( ) ...Controller.php:611
9 0.8976 12545840 CakeViewView->_render( ) ...View.php:587
10 0.8980 12546672 CakeViewView->_evaluate( ) ...View.php:952
11 0.8994 12577000 include( 'C:wamp64wwwcrmsrcTemplateErrorerror500.ctp' ) ...View.php:992
12 0.9033 12594912 xdebug_print_function_stack ( ) ...error500.ctp:33
php cakephp phpword
add a comment |
I am using cakephp3 with a PhpWord application where I just read in a template and fill in the values from a db. I have the phpoffice dir in /vendor. THis exact same code works in linux apart from the directory slashes!!! In win10 it doesnt work as I get a
Class 'ZendStdlibStringUtils' not found //this file exists in vendor/zendframework/zend-stdlib
error is from line $phpWord->setValue("studentname",$studentname);
I have no idea why this code fails in win10 but works on linux server
//in controller
use PHPWord;
...
$template_filename = $assessmentname;
$template_destname = "$assessmentname-" . $lesson->id . "-" . $student->id;
$source = getcwd()."\doc\templates\{$template_filename}.docx";
$template_destfile = $base_dir."{$template_destname}.docx";
$phpWord = new PhpOfficePhpWordTemplateProcessor($source);
$phpWord->setValue("studentname",$studentname); //error is on this line
debug( $source);
debug( $phpWord);
//output with debugs prove the phpobject is being picked up
srcControllerTutorsController.php (line 4176)
'C:wamp64wwwcrmwebrootdoctemplatesSecondary Maths and English Assessment.docx'
srcControllerTutorsController.php (line 4177)
object(PhpOfficePhpWordTemplateProcessor) {
[protected] zipClass => object(PhpOfficePhpWordSharedZipArchive) {
numFiles => (int) 18
filename => 'C:WindowsTempPhp767D.tmp'
[private] tempDir => null
[private] zip => object(ZipArchive) {
status => (int) 9
statusSys => (int) 0
numFiles => (int) 18
filename => 'C:WindowsTempPhp767D.tmp'
comment => ''
}
[private] usePclzip => false
}
[protected] tempDocumentFilename => 'C:WindowsTempPhp767D.tmp'
[protected] tempDocumentMainPart => '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
...
I cant embed images but here is the stack trace
Error in: ROOTvendorphpofficePhpWordsrcPhpWordTemplateProcessor.php, line 195
( ! ) Xdebug: user triggered in C:wamp64wwwcrmsrcTemplateErrorerror500.ctp on line 33
Call Stack
# Time Memory Function Location
1 0.8621 11983648 CakeErrorBaseErrorHandler->wrapAndHandleException( ) ...BaseErrorHandler.php:0
2 0.8647 11990088 CakeErrorBaseErrorHandler->handleException( ) ...BaseErrorHandler.php:163
3 0.8647 11990088 CakeErrorErrorHandler->_displayException( ) ...BaseErrorHandler.php:179
4 0.8719 12087752 CakeErrorExceptionRenderer->render( ) ...ErrorHandler.php:144
5 0.8762 12293032 CakeErrorExceptionRenderer->_outputMessage( ) ...ExceptionRenderer.php:192
6 0.8928 12541352 CakeErrorExceptionRenderer->_outputMessage( ) ...ExceptionRenderer.php:327
7 0.8928 12541352 CakeControllerController->render( ) ...ExceptionRenderer.php:320
8 0.8953 12544904 CakeViewView->render( ) ...Controller.php:611
9 0.8976 12545840 CakeViewView->_render( ) ...View.php:587
10 0.8980 12546672 CakeViewView->_evaluate( ) ...View.php:952
11 0.8994 12577000 include( 'C:wamp64wwwcrmsrcTemplateErrorerror500.ctp' ) ...View.php:992
12 0.9033 12594912 xdebug_print_function_stack ( ) ...error500.ctp:33
php cakephp phpword
Looks like youruse
should bePhpWord
notPHPWord
, though I'd think this case difference would be more likely to work on Windows and fail on Linux.
– Greg Schmidt
Nov 21 '18 at 0:52
use PhpWord, has made no difference. How would I reinstall phpword again as I have 2 folders phpoffice and phpword in vendor. Is there a confliction?
– atown99
Nov 21 '18 at 1:06
Need more information. The value of$studentname
, php version on the linux host and on the windows host, stack trace of the error would be nice too.
– Timur Asaliev
Nov 21 '18 at 13:50
php version >7 on win10 wamp64 and student name is 'andrew rree'.
– atown99
Nov 27 '18 at 1:50
i included a trace on OP
– atown99
Nov 27 '18 at 1:55
add a comment |
I am using cakephp3 with a PhpWord application where I just read in a template and fill in the values from a db. I have the phpoffice dir in /vendor. THis exact same code works in linux apart from the directory slashes!!! In win10 it doesnt work as I get a
Class 'ZendStdlibStringUtils' not found //this file exists in vendor/zendframework/zend-stdlib
error is from line $phpWord->setValue("studentname",$studentname);
I have no idea why this code fails in win10 but works on linux server
//in controller
use PHPWord;
...
$template_filename = $assessmentname;
$template_destname = "$assessmentname-" . $lesson->id . "-" . $student->id;
$source = getcwd()."\doc\templates\{$template_filename}.docx";
$template_destfile = $base_dir."{$template_destname}.docx";
$phpWord = new PhpOfficePhpWordTemplateProcessor($source);
$phpWord->setValue("studentname",$studentname); //error is on this line
debug( $source);
debug( $phpWord);
//output with debugs prove the phpobject is being picked up
srcControllerTutorsController.php (line 4176)
'C:wamp64wwwcrmwebrootdoctemplatesSecondary Maths and English Assessment.docx'
srcControllerTutorsController.php (line 4177)
object(PhpOfficePhpWordTemplateProcessor) {
[protected] zipClass => object(PhpOfficePhpWordSharedZipArchive) {
numFiles => (int) 18
filename => 'C:WindowsTempPhp767D.tmp'
[private] tempDir => null
[private] zip => object(ZipArchive) {
status => (int) 9
statusSys => (int) 0
numFiles => (int) 18
filename => 'C:WindowsTempPhp767D.tmp'
comment => ''
}
[private] usePclzip => false
}
[protected] tempDocumentFilename => 'C:WindowsTempPhp767D.tmp'
[protected] tempDocumentMainPart => '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
...
I cant embed images but here is the stack trace
Error in: ROOTvendorphpofficePhpWordsrcPhpWordTemplateProcessor.php, line 195
( ! ) Xdebug: user triggered in C:wamp64wwwcrmsrcTemplateErrorerror500.ctp on line 33
Call Stack
# Time Memory Function Location
1 0.8621 11983648 CakeErrorBaseErrorHandler->wrapAndHandleException( ) ...BaseErrorHandler.php:0
2 0.8647 11990088 CakeErrorBaseErrorHandler->handleException( ) ...BaseErrorHandler.php:163
3 0.8647 11990088 CakeErrorErrorHandler->_displayException( ) ...BaseErrorHandler.php:179
4 0.8719 12087752 CakeErrorExceptionRenderer->render( ) ...ErrorHandler.php:144
5 0.8762 12293032 CakeErrorExceptionRenderer->_outputMessage( ) ...ExceptionRenderer.php:192
6 0.8928 12541352 CakeErrorExceptionRenderer->_outputMessage( ) ...ExceptionRenderer.php:327
7 0.8928 12541352 CakeControllerController->render( ) ...ExceptionRenderer.php:320
8 0.8953 12544904 CakeViewView->render( ) ...Controller.php:611
9 0.8976 12545840 CakeViewView->_render( ) ...View.php:587
10 0.8980 12546672 CakeViewView->_evaluate( ) ...View.php:952
11 0.8994 12577000 include( 'C:wamp64wwwcrmsrcTemplateErrorerror500.ctp' ) ...View.php:992
12 0.9033 12594912 xdebug_print_function_stack ( ) ...error500.ctp:33
php cakephp phpword
I am using cakephp3 with a PhpWord application where I just read in a template and fill in the values from a db. I have the phpoffice dir in /vendor. THis exact same code works in linux apart from the directory slashes!!! In win10 it doesnt work as I get a
Class 'ZendStdlibStringUtils' not found //this file exists in vendor/zendframework/zend-stdlib
error is from line $phpWord->setValue("studentname",$studentname);
I have no idea why this code fails in win10 but works on linux server
//in controller
use PHPWord;
...
$template_filename = $assessmentname;
$template_destname = "$assessmentname-" . $lesson->id . "-" . $student->id;
$source = getcwd()."\doc\templates\{$template_filename}.docx";
$template_destfile = $base_dir."{$template_destname}.docx";
$phpWord = new PhpOfficePhpWordTemplateProcessor($source);
$phpWord->setValue("studentname",$studentname); //error is on this line
debug( $source);
debug( $phpWord);
//output with debugs prove the phpobject is being picked up
srcControllerTutorsController.php (line 4176)
'C:wamp64wwwcrmwebrootdoctemplatesSecondary Maths and English Assessment.docx'
srcControllerTutorsController.php (line 4177)
object(PhpOfficePhpWordTemplateProcessor) {
[protected] zipClass => object(PhpOfficePhpWordSharedZipArchive) {
numFiles => (int) 18
filename => 'C:WindowsTempPhp767D.tmp'
[private] tempDir => null
[private] zip => object(ZipArchive) {
status => (int) 9
statusSys => (int) 0
numFiles => (int) 18
filename => 'C:WindowsTempPhp767D.tmp'
comment => ''
}
[private] usePclzip => false
}
[protected] tempDocumentFilename => 'C:WindowsTempPhp767D.tmp'
[protected] tempDocumentMainPart => '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
...
I cant embed images but here is the stack trace
Error in: ROOTvendorphpofficePhpWordsrcPhpWordTemplateProcessor.php, line 195
( ! ) Xdebug: user triggered in C:wamp64wwwcrmsrcTemplateErrorerror500.ctp on line 33
Call Stack
# Time Memory Function Location
1 0.8621 11983648 CakeErrorBaseErrorHandler->wrapAndHandleException( ) ...BaseErrorHandler.php:0
2 0.8647 11990088 CakeErrorBaseErrorHandler->handleException( ) ...BaseErrorHandler.php:163
3 0.8647 11990088 CakeErrorErrorHandler->_displayException( ) ...BaseErrorHandler.php:179
4 0.8719 12087752 CakeErrorExceptionRenderer->render( ) ...ErrorHandler.php:144
5 0.8762 12293032 CakeErrorExceptionRenderer->_outputMessage( ) ...ExceptionRenderer.php:192
6 0.8928 12541352 CakeErrorExceptionRenderer->_outputMessage( ) ...ExceptionRenderer.php:327
7 0.8928 12541352 CakeControllerController->render( ) ...ExceptionRenderer.php:320
8 0.8953 12544904 CakeViewView->render( ) ...Controller.php:611
9 0.8976 12545840 CakeViewView->_render( ) ...View.php:587
10 0.8980 12546672 CakeViewView->_evaluate( ) ...View.php:952
11 0.8994 12577000 include( 'C:wamp64wwwcrmsrcTemplateErrorerror500.ctp' ) ...View.php:992
12 0.9033 12594912 xdebug_print_function_stack ( ) ...error500.ctp:33
php cakephp phpword
php cakephp phpword
edited Nov 27 '18 at 1:54
asked Nov 21 '18 at 0:09
atown99
12
12
Looks like youruse
should bePhpWord
notPHPWord
, though I'd think this case difference would be more likely to work on Windows and fail on Linux.
– Greg Schmidt
Nov 21 '18 at 0:52
use PhpWord, has made no difference. How would I reinstall phpword again as I have 2 folders phpoffice and phpword in vendor. Is there a confliction?
– atown99
Nov 21 '18 at 1:06
Need more information. The value of$studentname
, php version on the linux host and on the windows host, stack trace of the error would be nice too.
– Timur Asaliev
Nov 21 '18 at 13:50
php version >7 on win10 wamp64 and student name is 'andrew rree'.
– atown99
Nov 27 '18 at 1:50
i included a trace on OP
– atown99
Nov 27 '18 at 1:55
add a comment |
Looks like youruse
should bePhpWord
notPHPWord
, though I'd think this case difference would be more likely to work on Windows and fail on Linux.
– Greg Schmidt
Nov 21 '18 at 0:52
use PhpWord, has made no difference. How would I reinstall phpword again as I have 2 folders phpoffice and phpword in vendor. Is there a confliction?
– atown99
Nov 21 '18 at 1:06
Need more information. The value of$studentname
, php version on the linux host and on the windows host, stack trace of the error would be nice too.
– Timur Asaliev
Nov 21 '18 at 13:50
php version >7 on win10 wamp64 and student name is 'andrew rree'.
– atown99
Nov 27 '18 at 1:50
i included a trace on OP
– atown99
Nov 27 '18 at 1:55
Looks like your
use
should be PhpWord
not PHPWord
, though I'd think this case difference would be more likely to work on Windows and fail on Linux.– Greg Schmidt
Nov 21 '18 at 0:52
Looks like your
use
should be PhpWord
not PHPWord
, though I'd think this case difference would be more likely to work on Windows and fail on Linux.– Greg Schmidt
Nov 21 '18 at 0:52
use PhpWord, has made no difference. How would I reinstall phpword again as I have 2 folders phpoffice and phpword in vendor. Is there a confliction?
– atown99
Nov 21 '18 at 1:06
use PhpWord, has made no difference. How would I reinstall phpword again as I have 2 folders phpoffice and phpword in vendor. Is there a confliction?
– atown99
Nov 21 '18 at 1:06
Need more information. The value of
$studentname
, php version on the linux host and on the windows host, stack trace of the error would be nice too.– Timur Asaliev
Nov 21 '18 at 13:50
Need more information. The value of
$studentname
, php version on the linux host and on the windows host, stack trace of the error would be nice too.– Timur Asaliev
Nov 21 '18 at 13:50
php version >7 on win10 wamp64 and student name is 'andrew rree'.
– atown99
Nov 27 '18 at 1:50
php version >7 on win10 wamp64 and student name is 'andrew rree'.
– atown99
Nov 27 '18 at 1:50
i included a trace on OP
– atown99
Nov 27 '18 at 1:55
i included a trace on OP
– atown99
Nov 27 '18 at 1:55
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53403495%2fclass-zend-stdlib-stringutils-not-found-using-phpword-and-cakephp3%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53403495%2fclass-zend-stdlib-stringutils-not-found-using-phpword-and-cakephp3%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Looks like your
use
should bePhpWord
notPHPWord
, though I'd think this case difference would be more likely to work on Windows and fail on Linux.– Greg Schmidt
Nov 21 '18 at 0:52
use PhpWord, has made no difference. How would I reinstall phpword again as I have 2 folders phpoffice and phpword in vendor. Is there a confliction?
– atown99
Nov 21 '18 at 1:06
Need more information. The value of
$studentname
, php version on the linux host and on the windows host, stack trace of the error would be nice too.– Timur Asaliev
Nov 21 '18 at 13:50
php version >7 on win10 wamp64 and student name is 'andrew rree'.
– atown99
Nov 27 '18 at 1:50
i included a trace on OP
– atown99
Nov 27 '18 at 1:55