KoolReport's Forum

Official Support Area, Q&As, Discussions, Suggestions and Bug reports.
Forum's Guidelines

Deploy KoolReport to AWS LAMP stack #3335

Closed Robert Gardner opened this topic on on Sep 10 - 5 comments

Robert Gardner commented on Sep 10

I've implemented KoolReport and CloudExport on my local WAMP stack and it works perfectly. Moving it to an AWS LAMP instance has been a failure so far. No matter where I put KoolReport in my LAMP stack , it can't create the assets folders, so no formatting is done. I've given everyone root privileges but it didn't help. It seems that it assumes the assets folder is already created when it it not, even if I don't have the assets path in the settings function of the myreport.php. I run multiple sites via apache virtual hosts from this AWS instance, so my structure is

htdocs

htdocs/sites

htdocs/sites/site1

htdocs/sites/site2

htdocs/sites/site3

If I invoke composer to install KoolReport from htdocs, it will but the vendor folder under htdocs. The reports will fail because it can't access the assets folders. If I use composer to install KoolReport from the site1 folder, thinking all these folders are public and have access, it will also fail because it can't create or access the assets folder.

Any insight would be appreciated on how I can get this to work.

Sebastian Morales commented on Sep 12

You can find our your Apache's PHP user by opening a web page with this line:

<?php
//user.php 
echo exec('whoami');
exit; 

Then assign write permission to htdocs recursively (for sub directories) for that user. Let us know the result.

Robert Gardner commented on Sep 13

It's a Bitnami Lightsail Lamp Stack on AWS. The user is "daemon" from both the exec('whoami') you suggested and from the phpinfo page. I changed the ownership of the koolreport folder to daemon and it still can't create or find the assets folder, whether I declare the assets path in the setting or not.

I set up a new instance on Lightsail and installed koolreport with examples manually in htdocs. The examples work fine. I created a small report with a index.php, salesreport.php and salesreportview.php. It still will not style the report. It executes the query in salesreport.php just fine and gives me a standard table output with a header of "$this->dataStore('sales')" and then lists the query fields. It never seems to get to the view.

The error from Chrome is testrpt.php:564 Uncaught ReferenceError: KoolReport is not defined at testrpt.php:564:1

The line it's referring to is KoolReport.widget.init({"js":["\/koolreport\/core\/src\/clients\/jquery\/jquery.min.js",["\/koolreport\/core\/src\/widgets\/koolphp\/table\/table.js"]],"css":["\/koolreport\/core\/src\/widgets\/koolphp\/table\/table.css"]},function(){

Because I'm getting the query output, it must be finding the koolreports folders in htdocs.

Sebastian Morales commented on Sep 13

I think your output is a data dump of a report when it can not find a report view file to render. Pls rename your view file from salesreportview.php to salesreport.view.php and let us know how it works for you.

By the way, unlike Windows in Linux file name is case sensitive, thus your report class, report view files should be case sensitively the same. For example, salesreport.php and SalesReport.view.php work correctly in Windows but don't in Linux.

KoolReport commented on Sep 13

Plus, the name of class inside report should be the same in case sensitive, if you name the file salereport.php and salereport.view.php, the class name should be salereport

Robert Gardner commented on Sep 13

Thank you Sebastian and all who responded!

I did have the salesreport.view.php but my class name was SalesReport, so yes, the case did not match. I changed the files to SalesReport.php, SalesReport.view.php, and SalesReportPDF.view.php (I'm using CloudExport as well).

I reinstalled koolreport and cloudexport into the htdocs folder using composer.

Once I set the the ownership of the htdocs folder to bitnami:daemon, all the reports started working, using the command "sudo chown -R bitnami:daemon ./htdocs" from the /opt/bitnami/apache folder, just in case someone else runs into this issue.

Thanks again. This can be closed.

Build Your Excellent Data Report

Let KoolReport help you to make great reports. It's free & open-source released under MIT license.

Download KoolReport View demo
help needed
solved

None