Welcome Guest, Not a member yet? Register   Sign In
open_basedir restriction Error
#1

[eluser]René Tuin[/eluser]
Hi all,

I have a problem when i am uploading something on my server.
I get the following error's:
Quote:A PHP Error was encountered

Severity: Warning

Message: getimagesize() [function.getimagesize]: open_basedir restriction in effect. File(/var/tmp/phpHCpVzC) is not within the allowed path(s): (/data/www/)

Filename: libraries/Upload.php

Line Number: 569

AND
Quote:A PHP Error was encountered

Severity: Warning

Message: getimagesize(/var/tmp/phpHCpVzC) [function.getimagesize]: failed to open stream: Operation not permitted

Filename: libraries/Upload.php

Line Number: 569

My host say that i must change /var/tmp/ to /data/www/tmp only where can i set the temp file pad in CI.

Greetz
#2

[eluser]mrtopher[/eluser]
I am having this same problem. It's really weird because I wasn't having any difficulty but then all of a sudden I started getting these messages.

I don't get the message when uploading documents (pdf, doc, txt, etc.) only image files. If it's truly an open_basedir issue then I would assume it should error out when uploading any file... correct?

Also, I have programs running an earlier version of CI on the same server doing the same thing without any trouble. I looked back in the CI change logs and don't see any changes to the upload library that would have caused this problem. Did I miss something?

Anyone have any ideas as to why this is happening?
#3

[eluser]TheFuzzy0ne[/eluser]
PHP is running in safe mode. You'd be better of talking to your ISP about this.
#4

[eluser]mrtopher[/eluser]
I wish it were that easy... I'm running a dedicated server with Plesk and according to that I'm not running in safe mode. That's the first thing I checked.
#5

[eluser]cahva[/eluser]
This has nothing to do with safe mode. Its open_basedir restiction as the error says. To correct the problem, set upload_tmp_dir (with .htaccess, vhost or php.ini depending what kind of setup it is) to a directory within your open_basedir path. eg. in .htaccess or vhost use:
Code:
php_value upload_tmp_dir /data/www/tmp
Other solution would be including the /var/tmp to the open_basedir:
Code:
php_admin_value open_basedir /var/tmp:/data/www/tmp
(or you could set the option in php.ini if its dedicated server)
#6

[eluser]TheFuzzy0ne[/eluser]
My bad. I thought that that restriction was to do with safe mode, evidently it's not. Also, I had no idea you could override it via the htaccess, I thought it was a "vhost only" thing. I never managed to get it to work, but I was no doubt doing something wrong.
#7

[eluser]cahva[/eluser]
Hah! My bad Smile I remembered that you could set it in .htaccess but no, you cant as its PHP_INI_SYSTEM only. So php.ini or vhost it is.
#8

[eluser]mrtopher[/eluser]
Thanks for the feedback!

Yeah, I've used vhost.conf files in the past to overwrite the open_basedir in the past on an account by account basis.

I guess the thing that's bugging me the most is why this is only happening with this new application that I've just finished up. I have other programs running on the same server uploading files without any trouble and I didn't have to do anything to the open_basedir to get them to work. They are running an earlier version of CI but that's the only difference between the two.

If these apps are running on the same server I would expect to have the same upload issue with both apps. But I don't... that's why I'm leaning towards an app issue instead of a server issue. I just can't seem to put my finger on what's different.




Theme © iAndrew 2016 - Forum software by © MyBB