pdf error and Attachment errors

In this board you can talk about general questions about phpMyFAQ

Moderator: Thorsten

Post Reply
gadjodilo
Posts: 30
Joined: Fri May 21, 2004 1:12 pm

pdf error and Attachment errors

Post by gadjodilo »

Hello when I try to upload an attachment I get the following error:


Warning: mkdir(): SAFE MODE Restriction in effect. The script whose uid is 32006 is not allowed to access /home/energiei/public_html/faq/attachments owned by uid 99 in /home/energiei/public_html/faq/admin/attachment.php on line 167
Helaas is er een probleem opgetreden bij het toevoegen van de attachment.

And for the pdf the following:
when I try to open an answer in acrobat reader as pdf I get the following error messages:

Warning: fopen(): SAFE MODE Restriction in effect. The script whose uid is 32006 is not allowed to access /home/energiei/public_html/faq/pdf owned by uid 99 in /home/energiei/public_html/faq/inc/fpdf.php on line 1044

Warning: fopen(pdf/1.pdf): failed to open stream: No such file or directory in /home/energiei/public_html/faq/inc/fpdf.php on line 1044
FPDF error: Unable to create output file: pdf/1.pdf.


Do you perhaps know a way how I can get this to work?

Thankz in advance
Thorsten
Posts: 15741
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten »

Hi,

your PHP isn't configured very good. :(

You can try to change the chmod of the directories pdf/ and attachment/ t 0777.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
gadjodilo
Posts: 30
Joined: Fri May 21, 2004 1:12 pm

Post by gadjodilo »

Hello,
You where right! :D
It has something to do withe the configuration!
I asked my host and they turned safe mode off for me.....

Thank you!!

It's working fine now :D very cool!

Bye
gadjodilo
Posts: 30
Joined: Fri May 21, 2004 1:12 pm

Post by gadjodilo »

Thorsten
Posts: 15741
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten »

phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
gadjodilo
Posts: 30
Joined: Fri May 21, 2004 1:12 pm

Post by gadjodilo »

hahaha
yes...... very stupid of me :wink:
AndrewB
Posts: 171
Joined: Fri Aug 22, 2003 11:15 pm
Contact:

Post by AndrewB »

Thorsten,

forgive me for being stupid if this is a dumb question.

The following script says it can be used for uploading files via PHP when safe mode is on. If I allow write to one folder and then this uses move_uploaded_file, then can this work?

From phpbuilder.com http://www.phpbuilder.com/manual/featur ... upload.php

Code: Select all

<?php
$uploaddir = '/hsphere/local/home/user_name/your.com/images/';
$uploadfile = $uploaddir . $_FILES['userfile']['name'];

print "<div class=\"small\">";
if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) {
print "File is valid, and was successfully uploaded. ";
print "Here's some more debugging info:\n";
print_r($_FILES);
$name = $_FILES['userfile']['name'];
print "\n<hr><br />This is the image you uploaded:<br /><br /><img src=\"http://www.your.com/images/$name\" alt=\"$the_file_name\" /><br /><br />";
print "\nThis is the address for the image you uploaded:<br /><br />http://www.your.com/images/$name<br /><hr><br />";
} else {
print "Possible file upload attack! Here's some debugging info:\n";
print_r($_FILES);
}
print "</div>";
?> 

<form enctype="multipart/form-data" action="<?php $PHP_SELF = $_SERVER['PHP_SELF']; echo $PHP_SELF; ?>" method="post">
<input type="hidden" name="MAX_FILE_SIZE" value="102400" />
Send this file: <input name="userfile" type="file" />
<input type="submit" value="Upload" />
</form></div>
<div class=\"center\">
Thorsten
Posts: 15741
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten »

Hi Andrew,

I have to check this. Thanks for the code esample.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
Post Reply