php-reports icon indicating copy to clipboard operation
php-reports copied to clipboard

PHP 5.5 and report missing header

Open brokentwig opened this issue 11 years ago • 9 comments

After installing this package on PHP 5.5, all sample reports show the same error:

 An error occurred while preparing your report
 Report missing headers - 

I also am not prompted for any parameters in any of the sample reports, but I think I should be. Since I don't have a working demo, I'm not sure what I should see.

I build a new mysql report with no parameters and just a basic header. Here's my post.sql report:

 -- WP Posts
 -- All Posts for given month and year.

 SELECT * FROM post_by_author WHERE month = 2 AND year = 2014;

My sample report shows the same error. Any ideas?

brokentwig avatar Feb 16 '14 04:02 brokentwig

That error is thrown if the report doesn't contain two consecutive newline characters since that is what is used to separate the headers from the report contents. Maybe you have extra whitespace or something that's messing up that check.

jdorn avatar Feb 16 '14 05:02 jdorn

Well, all of the sample reports do the same thing. They only appear to have 1 new line between the header and code. I added another new line, and confirmed there's no spaces between them on my report, but same error.

brokentwig avatar Feb 16 '14 05:02 brokentwig

One other thing I noticed, Report.php should through the error above including whatever's in the $reports variable. It doesn't appear to include that. I wonder if I'm having a session problem or something. Can you enlighten me how to trace out that variable? Where is it set? I have to assume it's a GET variable since I see the path and report file name in the URL.

FirePHP gives me this when outputting $this within the error block:

  Report('report'=>'', 'macros'=>array(), 'exported_headers'=> … )

brokentwig avatar Feb 17 '14 00:02 brokentwig

Anyone?

brokentwig avatar Feb 20 '14 03:02 brokentwig

On line 32 of index.php can you check what's in $_REQUEST['report']? Also, can you put the url of a report where you're getting the error?

jdorn avatar Mar 03 '14 17:03 jdorn

Hi, I had a similar issue with a mis-configured nginx server.

Query string was actually lost and the following post helped me to solve my issue: https://kfalck.net/2011/06/19/fix-empty-nginx-fastcgi-query-strings

location / {
    try_files $uri $uri/ /index.php?$query_string;                                                               
}

Hope that helps.

tnguyen1 avatar Jun 23 '14 10:06 tnguyen1

That's it, thanks tnguyen1. I hope the author updates his instructions as it is missing from the install page.

brokentwig avatar Jun 29 '14 03:06 brokentwig

Thanks for looking into this. I added ?$querystring to the nginx instructions.

jdorn avatar Jun 30 '14 00:06 jdorn

My problem is that I have not even been able to download all the files.

I run composer from the folder and when I open the index.php tell me that Twig_Loader_Chain couldn't be loaded. Tried again to download the missing files with composer but same errors again, below see an example of what composer say on one of the files he couldn't find.

Installing lespoilus/spyc (dev-master 5a5bacd) Downloading: connection...

[Composer\Downloader\TransportException] The "https://api.github.com/repos/lespoilus/spyc/zipball/5a5bacdef1e514bdbb30701f13d9867140a6a21b" file could not be downloaded (HTTP/1.1 404 Not Found)

visionez avatar Apr 15 '15 20:04 visionez