Elxis CMS Forum
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Elxis 4.x documentation for users and developers
 
Pages: [1]
  Print  
Author Topic: TCPDF error  (Read 8211 times)
Yoyo-Moyo
Newbie
*
Offline Offline

Posts: 1



WWW
« 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
 Shocked

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) Lips sealed

 
« Last Edit: February 04, 2009, 05:57:58 by Yoyo-Moyo » Logged
datahell
Elxis Team
Hero Member
*****
Offline Offline

Posts: 7596



WWW
« Reply #1 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);
Logged

Farhad Sakhaei
Elxis Community
Hero Member
*****
Offline Offline

Posts: 1188


I know nothing , Should know more & more


WWW
« Reply #2 on: February 04, 2009, 11:03:53 »

/tmp/jpgOJGcnn
/var/www/yoyo-moyo/data

Maybe your tmp folder has not good permissions
Logged

symeon
Jr. Member
**
Offline Offline

Posts: 50


« Reply #3 on: November 03, 2011, 21:15:25 »

Sorry, I use 2009.3 and have the same problem. Should I fix tcpdf.php also?
Logged
datahell
Elxis Team
Hero Member
*****
Offline Offline

Posts: 7596



WWW
« Reply #4 on: November 03, 2011, 21:31:21 »

Here is a related post (written in Greek)
http://forum.elxis.org/index.php?topic=6651

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

Logged

symeon
Jr. Member
**
Offline Offline

Posts: 50


« Reply #5 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"
Logged
datahell
Elxis Team
Hero Member
*****
Offline Offline

Posts: 7596



WWW
« Reply #6 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.
Logged

symeon
Jr. Member
**
Offline Offline

Posts: 50


« Reply #7 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.
Logged
Pages: [1]
  Print  
 
Jump to: