HI,
I’ve been trying to make the examples work in the documentation regarding PHP and JavaBridge with no success. Even your documentation links are not working, so you may want to double check those. There are lots of dead end links/resources out there regarding php+aspose slides.
So, i’ve followed the instructions stated here: https://docs.aspose.com/display/slidesjava/Download+and+Configure+Aspose.Slides+in+PHP. It failed cloning the reposiroty, so you might want to fix that.
Then i’ve managed to move the Aspose_Slides_Java_for_PHP into the avaBridge folder manually, then copied aspose slides jar, and the 3rd_party folder (with it’s content) to JavaBridge/WEB-INF/lib folder. I’ve set the permissions on all files/folders (which your documentation doesn’t even mention), and when I navigated to url:8080/JavaBridge/Aspose_Slides_Java_for_PHP/tests/ it gave me an error message saying undfined $cancelProxyCreationTag in Java.inc. So I edited the Java.inc file, added the property to the relevant class and tried it again.
This time it complained about HelloWorld.pptx not existing ( This is the code i downloaded from the official repository). So i create an empty pptx file, name it, upload it, and try again. Wolaaa it works, ok good. Now, I comment all the example codes (keeping the impors at the top) and enable only:
print “Running Aspose\Slides\WorkingWithSlidesInPresentation\CloneSlides::run()” . PHP_EOL;
CloneSlides::run(DIR . ‘/data/WorkingWithSlidesInPresentation/CloneSlides/’);
It fails:
javax.servlet.ServletException: java.lang.RuntimeException: PHP Fatal error: protocol error: ,Invalid document end at col 14. Check the back end log for OutOfMemoryErrors. in /var/lib/tomcat8/webapps/JavaBridge/java/Java.inc on line 870
PHP Stack trace:
PHP 1. {main}() /var/lib/tomcat8/webapps/JavaBridge/Aspose_Slides_Java_for_PHP/tests/index.php:0
PHP 2. Aspose\Slides\WorkingWithSlidesInPresentation\CloneSlides::run() /var/lib/tomcat8/webapps/JavaBridge/Aspose_Slides_Java_for_PHP/tests/index.php:155
PHP 3. Aspose\Slides\WorkingWithSlidesInPresentation\CloneSlides::clone_to_end_of_presentation() /var/lib/tomcat8/webapps/JavaBridge/Aspose_Slides_Java_for_PHP/src/aspose/slides/WorkingWithSlidesInPresentation/CloneSlides.php:14
PHP 4. com\aspose\slides\Presentation->__construct() /var/lib/tomcat8/webapps/JavaBridge/Aspose_Slides_Java_for_PHP/src/aspose/slides/WorkingWithSlidesInPresentation/CloneSlides.php:28
PHP 5. Java->Java() /var/lib/tomcat8/webapps/JavaBridge/java/Java.inc(64) : eval()'d code:1
PHP 6. java_Client->createObject() /var/lib/tomcat8/webapps/JavaBridge/java/Java.inc:1930
PHP 7. java_Protocol->createObjectEnd() /var/lib/tomcat8/webapps/JavaBridge/java/Java.inc:535
PHP 8. java_Protocol->finish() /var/lib/tomcat8/webapps/JavaBridge/java/Java.inc:1315
PHP 9. java_Protocol->handle() /var/lib/tomcat8/webapps/JavaBridge/java/Java.inc:1287
PHP 10. java_Client->handleRequests() /var/lib/tomcat8/webapps/JavaBridge/java/Java.inc:1280
PHP 11. java_Parser->parse() /var/lib/tomcat8/webapps/JavaBridge/java/Java.inc:348
PHP 12. java_NativeParser->parse() /var/lib/tomcat8/webapps/JavaBridge/java/Java.inc:723
PHP 13. java_SocketHandler->shutdownBrokenConnection() /var/lib/tomcat8/webapps/JavaBridge/java/Java.inc:702
PHP 14. java_SocketHandler->dieWithBrokenConnection() /var/lib/tomcat8/webapps/JavaBridge/java/Java.inc:874
PHP 15. trigger_error() /var/lib/tomcat8/webapps/JavaBridge/java/Java.inc:870
php.java.servlet.fastcgi.FastCGIServlet.handle(FastCGIServlet.java:499)
php.java.servlet.fastcgi.FastCGIServlet.doGet(FastCGIServlet.java:521)
javax.servlet.http.HttpServlet.service(HttpServlet.java:622)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
php.java.servlet.PhpCGIFilter.doFilter(PhpCGIFilter.java:126)
So, in summary, it only works for very few of the examples, and there isn’t a proper example of how to set things up in the documentation.
My test environment is a vagrant machine running Ubuntu Server x64 16.04, php 7.0, tomcat8.
So any advices? I need to make this work, primarly merging powerpoint files and slides. I have like a few days before i can acutally tell the management that it works and then they can buy a licence.
Sorry for the long message.