shell - Mac OSX cmd works from command line, fails from php shell_exec() -



shell - Mac OSX cmd works from command line, fails from php shell_exec() -

i on mac os x 10.9.4

i can run command command line produce image or google.com

wkhtmltoimage http://www.google.com /users/me/sites/google.jpg

but when tried execute same command within website using php command

$cmd='wkhtmltoimage http://www.google.com /users/me/sites/google.jpg'; shell_exec($cmd);

i next error:

sh: wkhtmltoimage: command not found

is permission issue? if how can work?

====

update

i set total path @mureinik suggested , made progress error message is

loading page (1/2) [> ] 0% [======> ] 10% [=============> ] 23% [==================> ] 31% [===================> ] 33% [========================> ] 41% [=====================================> ] 62% [=======================================> ] 65% [========================================> ] 67% [=========================================> ] 69% [==========================================> ] 71% [==============================================> ] 78% [==================================================> ] 84% [===================================================> ] 86% [============================================================] 100% rendering (2/2) [> ] 0% [===============> ] 25% error: not write output file error: not save image [============================================================] 100% done exit code 1, due unknown error.

am having permission issue now?

====

update

i changed file permission destination , took care of it.

the issue shell_exec uses different $path you, , can't locate wkhtmltoimage. own shell, can utilize which wkhtmltoimage determine it's installed, , utilize shell_exec total path, e.g.:

$cmd='/opt/wkhtmltoimage http://www.google.com /users/me/sites/google.jpg'; shell_exec($cmd);

php shell command-line wkhtmltopdf

Comments

Popular posts from this blog

formatting - SAS SQL Datepart function returning odd values -

c++ - Apple Mach-O Linker Error(Duplicate Symbols For Architecture armv7) -

php - Yii 2: Unable to find a class into the extension 'yii2-admin' -