Aspose Slides via PHP-Java-bridge: Save failed -> permission Denied

I’m trying to run Apose.slides via PHP-java-bridge, but cannot get it to work



This is the code I’m trying to run:

<?php
require 'java/Java.inc';
//require_once("http://localhost:8087/JavaBridge/java/Java.inc"); // <-- THIS I cannot get to work??
// Just title
echo "

Aspose.Slides for Java PHP integration tests

";
// How to call static members
echo "

Aspose.Slides for Java ";

//$fistream=new Java("java.io.FileInputStream","/home/tss/tsomesite/public_html/Aspose.Slides.Java.lic");


$license = java("com.aspose.slides.License");
echo $license->getVersion();
echo "";
// Add rectangle to Ppt presentation
$presentationEx = new java("com.aspose.slides.Presentation");
$slideEx = $presentationEx->getSlides()->get_Item(0);
$slideEx->getShapes()->addAutoShape(5 /*ShapeType*/, 50, 150, 150, 50);
$presentationEx->save("phppresentation.pptx", 2 /*SaveFormat*/);
?>


And this is the error message (permission denied) I get:

Aspose.Slides for Java PHP integration tests

Aspose.Slides for Java 15.1.0.0

Warning: Unchecked exception detected: [[o:Response$UndeclaredThrowableErrorMarker]:"FATAL: Undeclared java.lang.RuntimeException detected. java.lang.Exception: Invoke failed: [[o:Presentation]]->save((o:String)[o:String], (o:int)[o:Integer]). Cause: com.aspose.slides.pa5e0ff62.pbdb106a0.p7cce53cf.x: File not found File: phppresentation.pptx File name: ‘phppresentation.pptx’ —> phppresentation.pptx (Permission denied) com.aspose.slides.pa5e0ff62.pf4dd765c.p2cbca448.pa2137a2a.c.(Unknown Source) com.asp[…]usr/share/pear/java/Java.inc(560): java_Client->getResult() #4 /usr/share/pear/java/Java.inc(1752): java_Client->invokeMethod(3, ‘save’, Array) #5 /usr/share/pear/java/Java.inc(1851): java_JavaProxy->__call(‘save’, Array) #6 /usr/share/pear/java/Java.inc(1999): java_AbstractJava->__call(‘save’, Array) #7 /home/tv2/tv2.kbx.dk/public_html/test.php(24): Java->__call(‘save’, Array) #8 /home/tv2/tv2.kbx.dk/public_html/test.php(24): Java->save(‘phppresentation…’, 2) #9 {main}] in /usr/share/pear/java/Java.inc on line 202 Fatal error: An unchecked exception occured during script execution. Please check the server log files for details. in /usr/share/pear/java/Java.inc on line 776

I have set all files to chmod 777 “just in case”, but i still get the same error. I’ve also added an empty “phppresentation.pptx” to the same folder as the php-file, but that gives identical error.

Could it be that the pptx path is something different? Or any clues?

Thanks.

Hi Chris,

I have observed the issue shared by you and suggest you to please try using the sample article shared in attachment of this thread link. The article covers the setting for Aspose.Slides for Java in your desired information. I hope this will serve the purpose on your end.

Many Thanks,