Installation
Overview
This article explains how to install and configure Aspose.Slides for PHP via Java. It covers the required environment setup, downloading the library through Packagist, configuring Apache Tomcat with PHP/Java Bridge, and running an example to verify the installation.
Configure Environment
- Install PHP 7, add the PHP path to the system
PATHvariable and setallow_url_includetoOnin thephp.inifile. - Install JRE 8. Set the
JAVA_HOMEenvironment variable to the path of the installed JRE. - Install Apache Tomcat 8.0.
Download Aspose.Slides for PHP via Java
packagist is the easiest way to download Aspose.Slides for PHP via Java.
To install Aspose.Slides using Packagist, run this command:
composer require aspose/slides
Configure Apache Tomcat
- Download PHP/Java Bridge (
php-java-bridge_x.x.x_documentation.zip) from http://php-java-bridge.sourceforge.net/pjb/download.php and extractJavaBridge.warfile to tomcatwebappsfolder. - Start Apache Tomcat service.
- Download “Aspose.Slides for PHP via Java” and extract it to
aspose.slidesfolder. Copyjar/aspose-slides-x.x-php.jarfile towebapps\JavaBridge\WEB-INF\libfolder. If you are using PHP 8, replace the originalJava.incfrom PHP-Java Bridge with theJava.incfromJava.inc.php8.zip. - Restart Apache Tomcat service.
- Run
example.phpinaspose.slidesfolder to run the example with this command:php example.php
FAQ
How can I verify that Aspose.Slides is integrated correctly?
Build your project, instantiate a blank Presentation and save it under a new name. If the file is created without throwing exceptions, the library has been integrated successfully.
How can I limit memory consumption when processing large presentations?
Raise JVM memory limits only as high as needed, and close each Presentation instance in a finally block to release the cache promptly. This prevents out‑of‑memory errors and keeps overall memory usage predictable during batch operations.
Can I exclude unwanted export formats to shrink the final JAR size?
Current Aspose.Slides releases are shipped as a single monolithic library, so you cannot disable specific exporters such as PDF or SVG at build time.