Aspose.Total for PHP via Java is platform independent API and can be used on any platform (Windows, Linux, MacOS etc.) where PHP 7 or greater versions is installed
I am running PHP 8.1, which meets this criteria. When I install the JavaBridge from the indicated location, it does not run with PHP 8.1 because the java.inc file (which is PHP code) does not correctly declare return types for several Java implementations of PHP functions.
I realize this is a third party library, but it seems that Aspose has said this would work with PHP 8.1 - so I am wondering, does Aspose have an updated version of the java.inc file that will allow the javabridge to function on PHP 8 and allow us to run Aspose.Total on PHP? Thank you.
Could you please share descriptions of the errors you are experiencing for each Aspose product you used? Also indicate the instruction and step at which the error occurs. It will be great if you share a scenario leading to the errors.
As I mentioned above, I realize the error isn’t technically with Aspose. But I don’t believe Aspose will work with PHP 8.x+ unless JavaBridge works with PHP v8.x+. This issue prevents that.
According to the Aspose for PHP via Java installation guide, we first have to install JavaBridge in order to communicate with any Aspose for Java product from PHP code. If you install JavaBridge with PHP 8.1, the first call to initialize javabridge includes the java.inc file that comes packaged with JavaBridge:
However, that file, which is PHP code that gets executed, is not designed to work with PHP 8, and the javabridge project is not actively managed to provide an updated version.
The java.inc file extends some PHP built-in classes and implements some PHP built-in interfaces, but does not correctly declare the base return types of those classes and interfaces. This became a requirement in PHP 8. So, as soon as you include and execute the java.inc file as shown above, an error is apparent:
Fatal error: During inheritance of Iterator: Uncaught ErrorException: Return type of java_objectIterator::current() should either be compatible with Iterator::current(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice.
There are a number of methods in that file that need to be updated in order for JavaBridge to work with PHP8+.
Again, I acknowledge that this is not an Aspose project per se, but if Aspose does want to remain compatible with PHP “7 or greater” as per the instructions, it might be nice if Aspose could provide a source java.inc file that will work with the newer versions of PHP. Otherwise each customer has to modify individual pieces of the source java.inc file which is out of scope of the instructions provided.
Regarding Aspose.Cells for PHP via Java, we need to investigate your issue in details. We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.
Issue ID(s): CELLSPHPJAVA-48
You can obtain Paid Support services if you need support on a priority basis, along with the direct access to our Paid Support management team.
Hi John, thank you; yes, indeed manually modifying the file does work.
However, that tag is a temporary patch with PHP 8.1 and will not work with PHP 9; thus PHP warns that it should have a more permanent fix. But it does work for the time being.
More importantly, I wanted to emphasize that it might be a good idea for Aspose to officially indicate in its installation documentation for “Aspose.Total for PHP via Java” how users should modify the file, or to provide a modified file for those who purchase Aspose with the intention that it works “out of the box” with PHP and javabridge. Having it at least in the instructions would assure Aspose users that Aspose will continue to support PHP 8+ even if the javabridge project itself is not actively maintained. Thank you.
The issues you found earlier (filed as SLIDESPHP-68) have been fixed in Aspose.Slides for PHP via Java 23.3 (ZIP).
You can check all fixes on the Release Notes page.
You can also find the latest version of our library on the Product Download page.
Since you are not the owner of this thread, so you might not download attachments (attached) in this thread. You may create a new thread in respective category and ask for the attachment. Generally, we can only provide details and guide users on how to modify the relevant file for the purpose but we might not provide updated file to the users due to copyright issues. You may refer to details provided in this thread for reference.