# Aspose.Slides for PHP via Java

Use these instructions for this platform only. Read the project's existing instructions and dependency files first. Keep its current package version unless the task requires a change. Confirm API names against this platform's documentation; bindings are not interchangeable.

## Setup

Install `aspose/slides` with Composer and configure the documented PHP/Java Bridge, PHP version, and Tomcat 9. On Linux, supply the JVM font libraries and fonts; the verified Ubuntu setup included fontconfig, DejaVu fonts, and `libharfbuzz0b`. Include the bridge and the package's `lib/aspose.slides.php` wrapper; Composer autoloading alone is insufficient. Use the `aspose\slides` namespace. Output and license paths must be accessible to the Java process. Dispose each presentation in a `finally` block.

## Install for a local test

With the bridge and Tomcat prerequisites from the installation guide configured, run this in a new Composer project:

```sh
composer require aspose/slides:26.9 --no-interaction --no-progress
```

This pinned version reproduces the example below. Preserve an existing project's dependency choices unless the user asks to change them. Finish the guide's JAR deployment and PHP 8 bridge-client replacement before running the example. Composer alone does not configure Tomcat.

## Minimal example

Save this as `starter.php` in the Composer project. Tomcat and PHP must see the same project directory. Use a scratch project so an existing `hello.pptx` is not replaced.

```php
<?php
require_once("http://localhost:8080/JavaBridge/java/Java.inc");
require_once(__DIR__ . "/vendor/aspose/slides/lib/aspose.slides.php");

use aspose\slides\Presentation;
use aspose\slides\SaveFormat;
use aspose\slides\ShapeType;

$presentation = new Presentation();
try {
    $shape = $presentation->getSlides()->get_Item(0)->getShapes()->addAutoShape(
        ShapeType::Rectangle, 50, 50, 500, 80
    );
    $shape->getTextFrame()->setText("Hello, Aspose.Slides!");
    $presentation->save(__DIR__ . "/hello.pptx", SaveFormat::Pptx);
} finally {
    $presentation->dispose();
}
```

With Tomcat running locally, execute:

```sh
php -d allow_url_include=On starter.php
```

Verified on 2026-11-18: Ubuntu 24.04 x64, PHP 8.3.6, OpenJDK 21.0.13, Tomcat 9.0.122, PHP/Java Bridge 7.2.1, and aspose/slides 26.9. The program ran and the saved file contained one slide with the expected text. This evaluation-mode check does not prove licensed output or other operating systems.

## License

Evaluation mode is suitable for a local smoke test and can add watermarks or other limits. If the user supplies a valid license, follow the [licensing guide](https://docs.aspose.com/slides/php-java/licensing/) before creating presentations. Read the license from a private local location accessible to the process. Never put license contents, keys, or personal paths in instructions, source control, or logs.

## Verify the change

Before expanding a change, create a small presentation, save it to a new file, and open the result. Check the requested content, slide count, and formatting. Build and run the exact code against the installed package; report any missing runtime or dependency instead of claiming it was tested.

Keep input files local unless the user permits sharing them. Write output to a new file and preserve the original. Report what ran, the versions used, and any checks that remain.

## Sources

- [Documentation](https://docs.aspose.com/slides/php-java/)
- [API reference](https://reference.aspose.com/slides/php-java/)
- [Installation](https://docs.aspose.com/slides/php-java/installation/)
- [Licensing](https://docs.aspose.com/slides/php-java/licensing/)
