0

In a new CentOS 7 server I have a problem with TCPDF plugin of Chronoforms5 component on Joomla 3.9.x CMS that on my old server Debian 8 there isn't. The Joomla installation is the same in both servers.

Old server (working well): Debian 8 / Apache 2.4.10 / PHP 7.1.30 / Joomla 3.9.10;

New server (with error): CentOS 7.6.1810 / Apache 2.4.6 / PHP 7.3.7 / Joomla 3.9.10.

When I submit a form that should create a PDF on a folder like 'cache' (so the url will be http://www.example.com/cache/filexxx.pdf and the path /var/www/html/cache/filexxx.pdf), on Debian it create the file and in debug the $form->files['cf_pdf_file']['link'] value is 'cache/filexxx.pdf' and this is the correct behaviour.

The problem with the same form on CentOS is thet when I submit the form I get this error:

Warning: fopen(): remote host file access not supported, file://cache/tcpdf_20190712104304.pdf in /usr/share/php/tcpdf/include/tcpdf_static.php on line 1821

Warning: fopen(file://cache/tcpdf_20190712104304.pdf): failed to open stream: no suitable wrapper could be found in /usr/share/php/tcpdf/include/tcpdf_static.php on line 1821

TCPDF ERROR: Unable to create output file: cache/pdf/tcpdf_20190712124222.pdf

Carlo77PV
  • 106
  • 8
  • 1
    That is a hosting issue. Have you put in a ticket with your host yet? Lookup how to setup a custom php.ini to allow fopen as well. – YellowWebMonkey Jul 12 '19 at 11:00
  • They are both my phisical servers, so I'm my host. – Carlo77PV Jul 12 '19 at 11:57
  • https://www.a2hosting.com/kb/developer-corner/php/using-php.ini-directives/php-allow-url-fopen-directive – YellowWebMonkey Jul 12 '19 at 17:40
  • Potential duplicate: https://stackoverflow.com/questions/28853871/fopen-remote-host-file-access-not-accepted-on-a-local-file (I'm on the fence about flagging because I'm not sure if the goal of the question is resolve the error or determine the cause of the difference between the two installs.) -- The `file://` wrapper requires that the part after it is an absolute file path. Provide an absolute file path instead of the relative one currently being provided, and it should work fine. – EPB Aug 03 '19 at 07:55
  • In fact, I'd like to call attention to this specific answer as it has a pretty good explanation of the reason behind the error you're seeing: https://stackoverflow.com/a/34750253/395384 – EPB Aug 03 '19 at 07:59
  • The duplicate post it's about pure TCPDF code but I'm talking about a Joomla component that in one server working and in another server don't – Carlo77PV Aug 05 '19 at 09:26
  • My problem is to know how to make Chronoforms and Joomla work without change them codes. I want to modify Centos configuration to work as expectly. – Carlo77PV Sep 27 '19 at 07:36

0 Answers0