Elxis CMS Forum

Support => Technical support => Topic started by: Yoyo-Moyo on February 04, 2009, 05:18:00

Title: TCPDF error
Post by: Yoyo-Moyo on February 04, 2009, 05:18:00
Hallo everybody…
I did`t find topics with similar problem and starting new one…
I have a problem with pdf creation in 2008.1 version (Nemesis).
When I trying to make a pdf  from an article , I have a error message:

PHP Error [Warning]
URI: index2.php?option=com_content&do_pdf=1&id=64
Path: /includes/pdf.php
Line: 218
file_exists() [function.file-exists]: open_basedir restriction in effect. File(../../../images/logo.png) is not within the allowed path(s): (/var/www/yoyo-moyo/data:.)
PHP Error [Warning]
URI: index2.php?option=com_content&do_pdf=1&id=64
Path: /includes/tcpdf/tcpdf.php
Line: 3267
imagejpeg() [function.imagejpeg]: open_basedir restriction in effect. File(/tmp/jpgOJGcnn) is not within the allowed path(s): (/var/www/yoyo-moyo/data:.)
PHP Error [Warning]
URI: index2.php?option=com_content&do_pdf=1&id=64
Path: /includes/tcpdf/tcpdf.php
Line: 3267
imagejpeg() [function.imagejpeg]: Invalid filename
PHP Error [Warning]
URI: index2.php?option=com_content&do_pdf=1&id=64
Path: /includes/tcpdf/tcpdf.php
Line: 3282
getimagesize() [function.getimagesize]: open_basedir restriction in effect. File(/tmp/jpgOJGcnn) is not within the allowed path(s): (/var/www/yoyo-moyo/data:.)
PHP Error [Warning]
URI: index2.php?option=com_content&do_pdf=1&id=64
Path: /includes/tcpdf/tcpdf.php
Line: 3282
getimagesize(/tmp/jpgOJGcnn) [function.getimagesize]: failed to open stream: Operation not permitted
TCPDF error: Missing or incorrect image file: /tmp/jpgOJGcnn
 :o

I working on server with virtual hosting manager , based on ISPmanager-Pro control panel....

Please help me to resolve this problem……
Thanks in advance (and sorry for pure English, I am from Latvija) :-X

 
Title: Re: TCPDF error
Post by: datahell on February 04, 2009, 08:54:47
The problem is caused by open_basedir restriction but you should nt had this problem. Are you sure you have the latest Elxis version? Because in the latest version there are no relative paths from the images. The logo in the latest version is not this: "../../../images/logo.png" it is this: "/absolute/path/to/elxis/images/logo.png" which will work fine.

To make sure you have the latest version replace existing includes/tcpdf/ files with the ones from Elxis 2008.1 rev2245. If the problem continues open
includes/tcpdf/tcpdf.php file, go to line 1820 and change this:

$this->Image(K_PATH_IMAGES.$this->header_logo, $this->GetX(), $this->header_margin, $this->header_logo_width);

to this:

$this->Image('/absolute/path/to/elxis/images/logo.png', $this->GetX(), $this->header_margin, $this->header_logo_width);
Title: Re: TCPDF error
Post by: Farhad Sakhaei on February 04, 2009, 11:03:53
/tmp/jpgOJGcnn
/var/www/yoyo-moyo/data

Maybe your tmp folder has not good permissions
Title: Re: TCPDF error
Post by: symeon on November 03, 2011, 21:15:25
Sorry, I use 2009.3 and have the same problem. Should I fix tcpdf.php also?
Title: Re: TCPDF error
Post by: datahell on November 03, 2011, 21:31:21
Here is a related post (written in Greek)
https://forum.elxis.org/index.php?topic=6651 (https://forum.elxis.org/index.php?topic=6651)

Sort solution:
Open includes/pdf.php, go to line 218.
Change this:
Code: [Select]
if (file_exists('../../../images/logo.png')) {
$header_logo = '../../../images/logo.png'
to this:
Code: [Select]
if (file_exists('../images/logo.png')) {
$header_logo = '../images/logo.png';

Title: Re: TCPDF error
Post by: symeon on November 04, 2011, 18:31:56
Perhaps, my problem is a little different ??

I changed it but I am still taking the message: "TCPDF error: Missing or incorrect image file: /tmp/jpgeP9WJl"
Title: Re: TCPDF error
Post by: datahell on November 04, 2011, 19:13:23
It seems that the temporary directory in your php.ini has been set to the server default: /tmp
Is this folder accessible by your web server?
Can you upload images?
Make sure the the /tmp folder is writeable, if not then you should change it to something accessible/writeable. Consider your web hosting provider for more in this case.
Title: Re: TCPDF error
Post by: symeon on November 12, 2011, 19:28:23
Well, I do not know what accesible means. But I can upload images, I can browse in the server by CoreFTP and make any changes, I can browse in mysql database and do anything. Perhaps, are all these enough to do anything in order to fix my problem by your instructions? Thanks.