I am unable to get Aspose.Cells for PHP via Java to work in my ubuntu localhost. The documentation is not clear too Setup and Installation Guidelines|Documentation. Can anyone help me please.
I followed the steps given in the doc above. Tried on php 7.3, 7.4, 8.1 (with latest fix for php8)
Error:
2023/10/29 16:47:21 [error] 26547#26547: *2 FastCGI sent in stderr: "PHP message: PHP Fatal error: <!doctype html><html lang="en"><head><title>HTTP Status 400 – Bad Request</title><style type="text/css">body {font-family:Tahoma,Arial,sans-serif;} h1, h2, h3, b {color:white;background-color:#525D76;} h1 {font-size:22px;} h2 {font-size:16px;} h3 {font-size:14px;} p {font-size:12px;} a {color:black;} .line {height:1px;background-color:#525D76;border:none;}</style></head><body><h1>HTTP Status 400 – Bad Request</h1><hr class="line" /><p><b>Type</b> Status Report</p><p><b>Message</b> Invalid URI</p><p><b>Description</b> The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing).</p><hr class="line" /><h3>Apache Tomcat/10.1.15</h3></body></html> in /var/www/html/pdftool/aspose.cells/Java.php8.inc on line 900" while reading response header from upstream, client: 127.0.0.1, server: _, request: "GET /pdftool/aspose.cells/example.php HTTP/2.0", upstream: "fastcgi://unix:/var/run/php/php8.1-fpm.sock:", host: "localhost.com"
The error may not be related to Aspose.Cells for Php, rather it is related to configurations or with your environment. We will evaluate your issue and get back to soon.
Please also make sure you have followed all the instructions and guidelines mentioned in the document.
@rbncha
Thank you for your feedback and detailed information. You can access the link normally http://localhost/JavaBridge/test.php, it can be explained that the Php environment is normal. To access it normally http://localhost.com/JavaBridge/example.php, you still need to take more steps. Please confirm if the following three steps have been completed.
Copy aspose-cells-xx.x.jar, bcpkix-jdk15on-xxx.jar and bcprov-jdk15on-xxx.jar to lib folder such as \java\apache-tomcat-9.0.24\lib folder.
Copy aspose.cells.php and example.php to \java\apache-tomcat-9.0.24\webapps\JavaBridge folder.
Modify the example.php file to ensure that the reference path used in the file is correct.
for example:
require_once(“java/Java.inc”);
require_once(“aspose.cells.php”);
If you still encounter issues, please provide us with the log of tomcat. We will check it soon.
My tomcat is installed in /op/tomcat/. JavaBridge is located at /opt/tomcat/webapps/JavaBridge image.png (33.5 KB)
All three files (aspose-cells-23.10.jar, bcpkix-jdk15on-1.68.jar and bcprov-jdk15on-1.68.jar) are located inside /opt/tomcat/lib/ image.png (43.5 KB)
modified /opt/tomcat/webapps/JavaBridge/example.php to require Java.inc and did php example in shell. Same error.
modified /var/www/html/aspose.cells/example.php to require Java.inc as require_once('http://localhost.com:8080/JavaBridge/Java.inc'); require_once('http://localhost.com:8080/JavaBridge/aspose.cells.php'); and browsed from browser as http://localhost.com/aspose.cells/example.php. Same error.
@rbncha
Can you access the following link normally? http://localhost.com:8080/JavaBridge/example.php
Additionally, your log does not contain any error information.
Please share your environmental information, including but not limited to Java, Aspose.Cells for PHP via Java and PHP version information. This is very helpful for us to reproduce the issue.
@rbncha
By deploying two projects for testing, we can discover some errors. When a project references another project’s PHP file, an error will be reported. Please also copy the aspose.cells.php file to the new project. After copying the aspose.cells.php file and changing the references in example.php, we can access it normally. Please refer to the attachment (26.1 KB).
Modify the example.php file under the new project to ensure that the reference path used in the file is correct.
for example: