Topic: PDF window not working

I must preface this post with a comment about FA. I am extremely impressed with the end result of this product. I think the developers have done an awesome job with this application and deserve a huge thank you.
With that said, I am experiencing a problem with my new install 2.3.24 in a shared hosting environment. my particulars are as follows:

Apache Version     2.2.29
PHP Version             5.2.17
MySQL Version     5.5.42-37.1-log
Architecture             x86_64
Operating System     linux
Perl Version             5.10.1
Kernel Version             3.12.35.1418868052
cPanel Pro             1.0 (RC1) 

I had no problem with the installation. Everything went smooth and exactly as designed. I installed several different themes and I have switched back and forth between them. My issue is as follows:

1. When I attempt to view a PDF report, the screen changes to just the header portion and everything else is blank. I get a symbol that flashes in the top right hand corner of the window, or a progress bar along the top, depending on the theme, and then nothing.

2. I thought that maybe I had an add on in Firefox (v. 40.0.3) that was preventing me from seeing the PDF. I started Firefox in safe mode with all extensions and add ons disabled. Still nothing.

3. I adjusted the settings in the preferences section and turn off pop up windows. This has no impact on the condition.

4. I have gone into config.php and set $pdf_debug= 1;    so that I could see what was happening, no problems or errors were reported.

5. I have tried all these things in IE, FF, Chrome, all with the same result. So I feel as though this is in the frontaccounting code and not cached in my browser.

6. The Excel destination works without problem.

7. This function was working at one point and i had a PDF screen in line within the browser in 2.3.24, but I unloaded version 2.3.24 because I had an issue that when I added a second test company, all the passwords for the administration login failed to work for the default company. I installed 2.4 from sourceforge but becasue this is BETA, which solves the problem of the passwords, I decided I would switch back to a stable version to go live with.

Please help me if you can. I really love this software and the direction it is going. If I can work out a few bugs it will be perfect for me.

Thnx, Gary

Re: PDF window not working

I need to make an amendment to Item 1, It is not just a blank page, it does open a new window, however the new window has the same header but is blank. This happens whether or not I have the preferences set to pop up window or not. i thought it important to clarify

Re: PDF window not working

Expect you are now in the stable version. Install the stable snapshot and see if your problems clear away.

Re: PDF window not working

Thank you apmuthu, I did have the latest snapshot, but I downloaded fresh from your link just to make sure, unfortunately it is not that simply. The problem still persists. I also tried to get different results by using the new MS Edge browser, same results.
I am really perplexed because it had been working flawlessly at one point prior to the reinstall. I erased the database and all the files from the server and started over (6 times so far). I started to wonder if there is a cache on the server that is keeping some of the file attributes or something.

Re: PDF window not working

PM me the details

Re: PDF window not working

I guess its a  problem with your pdf plugin.  On your Adobe reader has a plugin which will install on all the browser's to see the pdf with in the browser itself.  So try install upgraded version of Adobe reader and if it asks you to install a plugin on browser just allow it.
I feel like you have the problem with  your Adobe reader.

Check it and ping me back.

Subscription service based on FA
HRM CRM POS batch Themes

Re: PDF window not working

Can try SumatraPDF
FA still works with some very old Adobe Acrobat reader plugins.

Re: PDF window not working

First off I want to say thank you for all your help. I do not believe it is a matter of my browser, I have tried 4 separate browsers on 3 different computers from 3 different unique IP addresses all with the same results.

Re: PDF window not working

I suspect a permissions problem. Does the web server user own the directory you installed FA into?

Re: PDF window not working

Yes the web server user owns the directory. I temporarily set the file permissions to 755 for all except config.php and config_db.php which are set to 444.

Re: PDF window not working

OK. I figured that the script either fails to read some library/font etc. or it can't write the pdf data to disk. File permissions would have explained those.

What else could cause it to fail? Faulty code or faulty data. Unless you've messed with the code, I would look at the data. Does it get read as it should? Is it in the expected format (encoding)? Did you by any chance import the data from a previous install? Like, say, the 2.4 beta? The one which is supposed to be strictly UTF?

Re: PDF window not working

Still I don't think it's script or code error.

Can you send us a screenshot after showing the progress bar when you click on the submit button.

And also make sure before taking screenshot  your chrome developer tools must be enabled.

And for the developer tools press f12
Than take a screenshot  and attach here.

Subscription service based on FA
HRM CRM POS batch Themes

13 (edited by gwildgoose 09/04/2015 11:50:26 am)

Re: PDF window not working

This is a new install, so each time I reinstalled the DB were completely erased, and although I tried the Beta version of 2.4 I did not import any files because there were no files to import.
I have attempted to attach a screen shot but I do not see an option for that in these forums.
I really appreciate all the help you guys are offering.

Re: PDF window not working

This has to do with "SHTML Wrapper - 500 Server Error" on the bluehost box you are on. They decided to change security permissions to prevent the execution of any file with permissions > 644 and folders > 744.

See this bluehost forum post.

Working on it.

15 (edited by apmuthu 09/04/2015 07:05:14 pm)

Re: PDF window not working

It now works after the following commit by Joe on 2014-11-07 was reverted for PHP v5.2.17 prevalent in your BlueHost server:
Fixed deprecated preg_replace in php >= 5.3.0 with the /e flag in utf8 reports.

Although the if (version_compare(PHP_VERSION, '5.3.0') >= 0) works as expected, the code in the file refers to the function preg_replace_callback() which does not exist in PHP v5.2.17 and the interpreter fails - hence the reversion in this instance.

It is best that the PHP v5.3 bit of code is kept in another file and included inside it's place in the "if" construct here.

This issue has been wikied.

Had to upload the missing fonts (dejavu and FreeSans) into the reporting/fonts folder as they are not part of the FA download.

Re: PDF window not working

APMUTHU - what can I say? Thank you doesn't seem to capture my gratitude.  And although I say amputhu, I mean all of you who have helped me with this. This is truly and awesome community.

Re: PDF window not working

@gwidlgoose: Actually solving this issue helped us understand how to implement deprecated functions replacements better. Your trust in placing your server in our hands is valued. Change credentials forthwith.

@joe: Need to implement the "include_once" of a separate file for the PHP 5.3+ code in reporting/includes/html_entity_decode_php4.php

Re: PDF window not working

@apmuthu.

This is strange. The expression version_compare(PHP_VERSION, "5.3.0") should return -1 if the PHP_VERSION is 5.2.17.

Therefore is should only enter the preg_replace_callback function if the PHP_VERSION was 5.3.0 or higher.

I have no idea why. But we could make it safe by adding the function_exists on the line too, f.i.

if (version_compare(PHP_VERSION, "5.3.0") >= 0 && function_exists("preg_replace_callback"))

For your information the preg_replace with the /e option is deprecated from PHP version 5.3.0.

/Joe

19 (edited by apmuthu 09/05/2015 06:59:43 am)

Re: PDF window not working

The expression version_compare(PHP_VERSION, "5.3.0") does indeed return -1 or false, but the interpreter / parser fails if the script has the preg_replace_callback function which does not exist in PHP 5.2.17. Hence the include_once workaround suggested.

Wonder how MySQL 5.5 and PHP 5.2.17 got together in bluehost server!

Here is a list of server details for simulation:

# uname -a
Linux box1243.bluehost.com 3.12.35.1418868052 #1 SMP Wed Dec 17 20:04:02 CST 2014 x86_64 x86_64 x86_64 GNU/Linux

# php -m | grep -i "mbstring"
mbstring

# yum update
CRITICAL:yum.cli:Config Error: Error accessing file for config file:///etc/yum.conf

# php -v
PHP 5.2.17 (cgi-fcgi) (built: Oct  2 2013 09:23:52)
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2010 Zend Technologies
    with Zend Optimizer v3.3.9, Copyright (c) 1998-2009, by Zend Technologies

# mysql --version
mysql  Ver 14.14 Distrib 5.5.42-37.1, for Linux (x86_64) using readline 5.1

It appears that most hosting providers like justhost.com and hostmonster.com too use the same kernel initramfs-3.12.35.1418868052.img and the files can be seen here.