Welcome Guest, Not a member yet? Register   Sign In
Dompdf and SAFE MODE. [SOLVED]
#1

[eluser]Daniele K[/eluser]
i'm new with dompdf and CodeIgniter too, but my little cms works fine and do all it should do. Until now.

Since 2 days, i've been trying to put a controller to print a pdf with some quickreferences, ok dompdf work fine but, when i try to put an image into the handmade pdf (a dompdf generated file) it give me these error (all put inside the pdf generated).
Error generated is:
Code:
<h4>A PHP Error was encountered</h4>  
<p>Severity: Warning</p>
<p>Message:  file_put_contents()
[<a href='function.file-put-contents'>function.file-put-contents</a>]:
SAFE MODE Restriction in effect.  
The script whose uid is 10058 is not allowed to access /tmp/dompdf_img_9zZ1oZ owned by uid 48</p>
<p>Filename: include/image_cache.cls.php</p> <p>Line Number: 117</p>

1. All the images generates the same error,
2. I've tried to use user's images (uploaded by CMS)and images uploaded with CODA.

Any idea?
thank you
i'm so for my english.
#2

[eluser]rogierb[/eluser]
You are running your server in safe mode, which is very good. The webserver, or rather the uid of the user the webserver is running on, needs to have access to whatever place dompdf is storing temporary images.

In your case the /tmp directory

The error: your webserver does not have access to write to the ./tmp folder.

Is seen 2 options:
1: make sure the temporary image is generated in some other folder
2: make sure the /tmp is writable by the webserver
(3: the bad and ugly solution, disable safe mode )
#3

[eluser]Daniele K[/eluser]
Thank you for your fast reply Rogierb,
talking about your solutions,
1 & 2: i 've tried to change my chmode for /tmp folder with 777, but nothing has changed. I'll try it again.

3. nope, i'm a safe mode fan Wink
#4

[eluser]Daniele K[/eluser]
[quote author="rogierb" date="1260462492"]
Is seen 2 options:
1: make sure the temporary image is generated in some other folder
2: make sure the /tmp is writable by the webserver
[/quote]

after few changes, nothing has happened.
Try the solution 1 and 2.

I've a question about hte location and the path.
now i've change the temp folder, in www.mysite.com/tmp is this correct?

Code:
define("DOMPDF_TEMP_DIR", base_url()."tmp");

thank you
#5

[eluser]rogierb[/eluser]
No, the temp dir is never a url, it has to be a (full) path.

You could try FCPATH."tmp". That way it should point to your webroot+tmp.
#6

[eluser]Daniele K[/eluser]
Wow.
I offer you my heartfelt thanks.

i have other small problems, but i can handle them.

really thanks




Theme © iAndrew 2016 - Forum software by © MyBB