0
The generated PDF file looks as if it lacks styles, and images are not loaded, even though the logo has been loaded into the application. The invoice status picture is also not visible.
The application runs on localhost, and works fine by itself.
The Apache server alias is set to:
Alias /simple_invoice_manager "d:/www/simple_invoice_manager/www/"
where the first "www" is root for PHP.
Additionally, there are entries in the htaccess file:
RewriteBase /simple_invoice_manager/
and for hosting:
RewriteRule ^(.)$ index.php?/$1 [L]
and for SSL:
RewriteCond %{HTTPS} off
RewriteRule ^(.)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
Let me add that the rule for SSL doesn't break anything.
My PHP version is: 7.3.12
Please help me fix the problem.
Łukasz
0
Hello,
Please check allow_url_fopen
It should be enabled along with php GD
extension.
SSL could cause such issue too. If you have enable ssl then you should set the base_url
in app/config/config.php
to https://
too.
Thank you
0
Exactly everything you wrote about, I had already turned on (I still have it turned on).
Also base_url looks like this:
$config['base_url'] = 'https://localhost/simple_invoice_manager/';
I have multiple instances of Wordpress and Prestashop on this localhost, and all the required extensions for the applications are definitely enabled and properly configured as the applications are working fine.
I suppose it's related to localhost, but I don't know where to look for a solution. The application itself, apart from generating complete PDF files, worked flawlessly.
The cause of the problem must be elsewhere.
0
Hello,
If you SSL is install properly on localhost then you can check my other suggestion. You can check both with phpinfo
function. You need to be sure about allow_url_fopen
and php-gd
extension.
Thank you
0
We already wrote about it, and as I wrote before, I will repeat myself and say the same, I have it turned on.
0
I waited and waited for the help of real specialists, I waited so much that I finally looked for the cause of the problem myself...
I found the problem on line 124 in the Sim.php file, and it generates this message:
ERROR - 2021-08-19 00:41:27 --> Severity: Warning --> file_get_contents(): SSL operation failed with code 1. OpenSSL Error messages:
error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed D:\www\simple_invoice_manager\www\app\libraries\Sim.php 124
ERROR - 2021-08-19 00:41:27 --> Severity: Warning --> file_get_contents(): Failed to enable crypto D:\www\simple_invoice_manager\www\app\libraries\Sim.php 124
ERROR - 2021-08-19 00:41:27 --> Severity: Warning --> file_get_contents(https://localhost/simple_invoice_manager/themes/default/assets/img/paid.png): failed to open stream: operation failed D:\www\simple_invoice_manager\www\app\libraries\Sim.php 124
If I am not mistaken, the solution currently used in the get_image() function (and using the PHP file_get_contents() function) may not work properly when we have an application running on Windows using SSL.
It just so happens that in my case the application is supposed to run on Windows using SSL, and the functionality of generating invoices in PDF format is the main reason why I purchased your application.
I found a workaround for this, but it would be nice if a standards-compliant and secure solution would appear in the code in the near future.
Bottom line: I found the cause of the problem, now I am asking you to fix the problem.
Łukasz
0
P.S. Sorry if I'm too demanding, but I just didn't expect problems with one of the key functionalities of your application, and one that is so crucial to me. It worked fine on your demo, I thought it would work right away. Time is chasing me, and the problem is as it was.
0
Hello,
Yes, looks like the issue is due to SSL on localhost. I have no idea, but maybe you can try to disable ssl and use http:// instead to check.
Thank you
0
Best regards
Łukasz
0
Hello,
I am not sure but try to set the base_url
to http:// and access it with http:// I think you should be able to test if the issue is due to SSL or not.
I don't know your setup but guess that you have set the base_url to Server IP or some sort of port forwarding. If not you can try to change and see if it make any difference.
file_get_contents
with ssl could the real cause with no alternate as dompdf
is used to generate pdfs, which uses file_get_contents
😦
Thank you
0
Best regards
Łukasz
Showing 1 to 10 of total 14 records
We use Cookies
We use cookies to ensure that we give you the best experience on our website. By continuing to browse the site you are agreeing to our use of cookies.