Aspose.Cells Java for PHP

Introduction to Aspose.Cells Java for PHP

PHP/Java Bridge

The PHP/Java Bridge is an implementation of a streaming, XML‑based network protocol, which can be used to connect a native script engine, for example PHP, Scheme or Python, with a Java virtual machine. It is up to 50 times faster than local RPC via SOAP, requires less resources on the web‑server side. It is faster and more reliable than direct communication via the Java Native Interface, and it requires no additional components to invoke Java procedures from PHP or PHP procedures from Java.

Read more at sourceforge.net

Aspose.Cells for Java

Aspose.Cells for Java is an award‑winning Excel Spreadsheet component that allows Java developers to embed the ability to read, write and manipulate Excel® spreadsheets (XLS, XLSX, XLSM, XLSB, XLTX, SpreadsheetML, CSV, ODS), HTML, MHTML, PDF and image file formats into their own Java applications without needing to rely on Microsoft Excel®.

Aspose.Cells for Java is a mature, scalable and feature‑rich component that offers many functions that are way beyond the simple data‑exporting capabilities of other vendors. With Aspose.Cells for Java, developers can export data, format spreadsheets to the most granular level, import images, create charts, apply and calculate complex formulas, stream Excel® data, save in various formats and much more – all this without the need for Microsoft Excel® or Microsoft Office Automation.

Aspose.Cells Java for PHP

Project Aspose.Cells for PHP shows how different tasks can be performed using Aspose.Cells Java APIs in PHP. This project is aimed at providing useful examples for PHP developers who want to utilise Aspose.Cells for Java in their PHP projects using the PHP/Java Bridge.

This section includes the following topics:

System Requirements and Supported Platforms

System Requirements

The following are the system requirements to use Aspose.Cells Java for PHP:

  • Tomcat Server 8.0 or above installed.
  • PHP/JavaBridge is configured.
  • FastCGI is installed.
  • Aspose.Cells component is downloaded.

Supported Platforms

The following are the supported platforms:

  • PHP 5.3 or above
  • Java 1.8 or above

Downloads and Configuration

Download Required Libraries

Download the required libraries mentioned below. These are required for executing Aspose.Cells Java for PHP examples.

Download Examples from Social Coding Sites

The following releases of running examples are available to download on the social coding sites listed below:


GitHub

How to configure the source code on Linux Platform

Please follow these simple steps in order to open and extend the source code while using:

1. Install Tomcat Server

To install Tomcat Server, issue the following command on the Linux console. This will successfully install Tomcat Server.

sudo apt-get install tomcat8

2. Download and Configure PHP/JavaBridge

To download the PHP/JavaBridge binaries, issue the following command on the Linux console.

wget https://sourceforge.net/projects/php-java-bridge/files/Binary%20package/php-java-bridge_7.2.1/php-java-bridge_7.2.1_documentation.zip/download

Unzip the PHP/JavaBridge binaries by issuing the following command on the Linux console.

unzip -d php-java-bridge_6.2.1_documentation.zip

This will extract JavaBridge.war file. Copy it to the Tomcat 8 webapps folder by issuing the following command on the Linux console.

sudo cp JavaBridge.war /var/lib/tomcat8/webapps/JavaBridge.war

Tomcat 8 will automatically create a new folder JavaBridge in webapps. Once the folder is created, make sure Tomcat 8 is running and then check localhost:8080/JavaBridge in a browser; it should open the default page of JavaBridge.

If any error message appears, install FastCGI by issuing the following command on the Linux console.

sudo apt-get install php55-cgi

After installing php5.5 CGI, restart the Tomcat 8 server and check localhost:8080/JavaBridge again in the browser.

If a JAVA_HOME error is displayed, open /etc/default/tomcat8 and uncomment the line that sets JAVA_HOME. Check localhost:8080/JavaBridge again; it should show the PHP/JavaBridge examples page.

3. Configure Aspose.Cells Java for PHP Examples

Clone the PHP examples by issuing the following commands inside the webapps/JavaBridge folder.

git init
git clone https://github.com/aspose-cells/Aspose.Cells-for-Java/tree/master/Plugins/Aspose_Cells_Java_for_PHP

How to configure the source code on Windows Platform

Please follow the simple steps below to configure PHP/Java Bridge on Windows Platform.

  1. Install PHP 5 and configure it as you normally do.
  2. Install JRE 6 (Java Runtime Environment) if you don’t already have it. You can check this in C:\Program Files…. You can download it here. I am using JRE 6 as it is compatible with PHP Java Bridge (PJB).
  3. Install Apache Tomcat 8.0. You can download it here.
  4. Download JavaBridge.war and copy this file to the Tomcat webapps directory (e.g., C:\Program Files\Apache Software Foundation\Tomcat 8.0\webapps).
  5. Restart the Tomcat service.
  6. Go to localhost:8080/JavaBridge/test.php to check if PHP works. You can find other examples there.
  7. Copy your Aspose.Cells Java JAR file to C:\Program Files\Apache Software Foundation\Tomcat 8.0\webapps\JavaBridge\WEB-INF\lib.
  8. Clone the Aspose.Cells Java for PHP examples inside C:\Program Files\Apache Software Foundation\Tomcat 8.0\webapps\.
  9. Copy the folder C:\Program Files\Apache Software Foundation\Tomcat 8.0\webapps\JavaBridge\java to your Aspose.Cells Java for PHP examples folder.
  10. Restart the Apache Tomcat service and start using the examples.

Support, Extend and Contribute

Support

From the very first days of Aspose, we knew that just giving our customers good products would not be enough. We also needed to deliver good service. We are developers ourselves and understand how frustrating it is when a technical issue or a quirk in the software stops you from doing what you need to do. We’re here to solve problems, not create them.

This is why we offer free support. Anyone who uses our product, whether they have bought it or are using an evaluation, deserves our full attention and respect.

You can log any issues or suggestions related to Aspose.Cells Java for PHP using any of the following platforms:

Extend and Contribute

Aspose.Cells Java for PHP is open source and its source code is available on the major social coding websites listed below. Developers are encouraged to download the source code and contribute by suggesting or adding new features or improving existing ones, so that others could also benefit from it.

Source Code

You can get the latest source code from one of the following locations: