php - Using Batik with Yii - Fails in the app but works in terminal -



php - Using Batik with Yii - Fails in the app but works in terminal -

i'm trying add together svg .png conversion yii app, using batik rasterizing library. i'm working locally on mac running osx 10.6.7, php 5.3.4 , java 1.6.0_24.

when run php script deals conversion, using...

$output = shell_exec(java -jar batik/batik-rasterizer.jar -m image/png -d pdf_temp/file.png -w 800 pdf_temp/file.svg)

batik fails (unhelpful) error:

about transcode 1 svg file(s) converting file.svg pdf_temp/file.png ... file_1310581599.png error while converting svg

however, using...

java -jar batik/batik-rasterizer.jar -m image/png -d pdf_temp/file.png -w 800 pdf_temp/file.svg

...in terminal works treat , saves .png file in /pdf_temp/ directory along original .svg

so what's different php/apache environment that's causing batik fail when terminal fine?

edit:

after chatting colleagues think fact java needs run root - terminal not within web server.

adding...

2>&1 1> /dev/null

to batik shell_exec() command reveals next error:

exception in thread "main" java.lang.internalerror: can't connect window server - not plenty permissions.

any ideas how can run java root web server environment? or allow perform functions require?

-djava.awt.headless=true

http://www.emcken.dk/weblog/archives/25-svg-rasterizer-with-batik.html

php shell svg png batik

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

c# - Can ProtoBuf-Net deserialize to a flat class? -

javascript - Change element in each JQuery tab to dynamically generated colors -