KoolReport's Forum

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

CloudExport Exception related to file_get_contents #686

Closed gkurl opened this topic on on Feb 18, 2019 - 7 comments

gkurl commented on Feb 18, 2019

Hi KoolReport team,

Trying out the CloudExport package to export PDF - I am receiving the following error message from Exporter.php file:

Warning: file_get_contents(http://gags.maxdev.co.uk:4000/koolreport/src/clients/core/KoolReport.js): failed to open stream: HTTP request failed! 

And

Warning: file_get_contents(http://gags.maxdev.co.uk:4000/koolreport/src/clients/jquery/jquery.min.js): failed to open stream: HTTP request failed! 

Please let me know how to resolve.

Thank you.

KoolReport commented on Feb 18, 2019

Hi,

Could you please check if the link

http://gags.maxdev.co.uk:4000/koolreport/src/clients/core/KoolReport.js

is correct link? Can it be accessed by pasting to browser.

gkurl commented on Feb 18, 2019

I can but - I'm using a PHP dev server from console using PHP -S command to in order to debug the script that is running the Koolreport things. So I am specifying the PHP file itself when running the PHP -S command by running

php -S gags.maxdev.co.uk:4000 scheduled_report_cron.php

The JS file does not load but does not show any 404 or "resource not found" errors. But as I can't view in browser I think it means it probably isn't picking it up?

When I setup a dev server using just

php -S gags.maxdev.co.uk:4000 

And access the link, the JS file loads as the dev server is listening to the root directory and not listening to the individual PHP file itself.

So I am unable to debug/test the script without specifying the file to listen to but the JS is definitely there and loading if file is not specified.

Any suggestions?

KoolReport commented on Feb 18, 2019

If you use a simple XAMPP (not in dev environment like this), does it work? I am not sure what seems go wrong, it seems to me that you can render correctly so those resources should be available. But not sure why file_get_contents() could not be able to get it.

KoolReport commented on Feb 19, 2019

May be you should host the whole things:

php -S gags.maxdev.co.uk:4000 

otherwise KoolReport reosurce could not be available.

gkurl commented on Feb 19, 2019

Yes I will try - question regarding this, do you know where I can make changes so that the location of the Koolreport JS files change so I can test this? I am trying to use assets params to point location of files using the file:// prefix but Koolreport automatically adds this to the start of all src URL's

I need to get rid of the URL's circled in red upon report generation.

I have tried using assets array in settings but that URL from server address always gets appended.

Please let me know :)

Thanks

KoolReport commented on Feb 19, 2019

Do not use the local file with file://, please try to host the whole project. If your report can render ok on web then you can export.

gkurl commented on Feb 19, 2019

Ok thank you - I FINALLY got it to work :) Using the local phantomjs believe it or not! Appreciate your help. I have another small issue however that I am sure you can resolve very quickly and will make another post. Thank you

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

CloudExport