1

Topic: Error Code when uploading a Picture

Hello,

I have an error when i upload a picture in profile. It works but i see this error.

Warning: getimagesize(): open_basedir restriction in effect. File(/tmp/phpH0NScc) is not within the allowed path(s): (/www/cdjreiden.lu/html) in /www/cdjreiden.lu/html/website/forum/profile.php on line 357

Warning: getimagesize(/tmp/phpH0NScc): failed to open stream: Operation not permitted in /www/cdjreiden.lu/html/website/forum/profile.php on line 357

How can i fix this error?

Kind regards
Mippo

2 (edited by Gribber 2004-02-12 13:18)

Re: Error Code when uploading a Picture

I´m not sure but i think you maybe can use ini_set to change upload_tmp_dir to something inside your allowed path.

Edit: you can´t use ini_set, must be defined in php.ini or httpd.conf (PHP_INI_SYSTEM)

Edit2: maybe i should read everything in your post before i answer, ignore me :)

3 (edited by Louis 2004-02-12 15:06)

Re: Error Code when uploading a Picture

"If accessing the filename image is impossible, or if it isn't a valid picture, getimagesize()  will return FALSE and generate a warning."
? PHP Documentation

Your hosting provider or system admin may have restrictions on which directories can use "includes."

Run phpinfo.php (see below) and do a find on "open_basedir." If the setting is something other than "no value" then you might have to [change upload_tmp_dir] to the directory shown. Check with your hosting provider.

To create "phpinfo.php"
Create a text file containing only these three lines:

<?php 
phpinfo(); 
?> 

Upload this file to your server and go to it via the browser. The output to the screen will display a lot of helpful information about your PHP installation, as well as your web server and mySQL.

Hope it helps,

Louis.

(Posted with assistance from this DotWidgets Support Article)

Re: Error Code when uploading a Picture

You can also try creating a file called .htaccess with the following contents:

php_value upload_tmp_dir /path/to/your/avatar/dir/

Save the file in your forum root directory.

"Programming is like sex: one mistake and you have to support it for the rest of your life."

5

Re: Error Code when uploading a Picture

I talked with my service provider he had restrictions on which directories can use "includes."

He fixed it and it works

Thank you very much.

Mippo

6

Re: Error Code when uploading a Picture

You're welcome. One down, one to go ;)