View Full Version : Can't Change Attachment Storage Type
matt3830
Thu 17th Aug '06, 12:48pm
I've been trying to switch my attachments to the file storage system. I have chmod the directory to 0777 and disabled php safe mode.
The full path to my forum is:
/var/www/vhosts/example.com/httpdocs/forums/
The full path to my attachments directory is:
/var/www/vhosts/example.com/attachments/
I get this error message when changing the storage type:
We attempted to write a test file to /var/www/vhosts/example.com/attachments, but we were unsuccessful. Please verify that the web server has write/delete permissions for this path.
When I ran upload diagnostics, I got this result:
file_uploads: On
open_basedir: /var/www/vhosts/example.com/httpdocs:/tmp
safe_mode: Off
upload_tmp_dir: None
upload_max_filesize: 30.00 MB
No errors occurred while opening the uploaded file for reading.
The URL to Public phpinfo is:
http://www.example.com/forums/forumdisplay.php?f=2&do=phpinfo
I've tried lot's of different combinations for the path to the attachments directy. Nothing seems to work. I believe it must be the way my server is configured, but I can't figure out what to check. Is there something in php.ini (besides safe mode), that I should look for? Any ideas?
Colin F
Thu 17th Aug '06, 1:05pm
The open basedir settings restrict the script to this path:
/var/www/vhosts/example.com/httpdocs
You're trying to write to a folder which is below that path (not in the /httpdocs directory).
matt3830
Thu 17th Aug '06, 1:11pm
Will vbulletin permissions still work if I change the path to:
/var/www/vhosts/example.com/httpdocs/forums/attachments/
Steve Machol
Thu 17th Aug '06, 2:29pm
I don't know if this will work with open_basedir restrictions. My understanding is that this is like safe mode and you cannot use the file storage option if you have these restrictions.
If I'm wrong, I hope someone corrects me.
matt3830
Thu 17th Aug '06, 2:44pm
Doesn't look like I have any settings enabled in my php.ini file for open_basedir. Any ideas of what it should equal?
; open_basedir, if set, limits all file operations to the defined directory
; and below. This directive makes most sense if used in a per-directory
; or per-virtualhost web server configuration file. This directive is
; *NOT* affected by whether Safe Mode is turned On or Off.
;open_basedir =
Steve Machol
Thu 17th Aug '06, 2:49pm
You may be looking at the wrong php.ini file. As per the diagnostics:
When I ran upload diagnostics, I got this result:
file_uploads: On
open_basedir: /var/www/vhosts/example.com/httpdocs:/tmp
matt3830
Thu 17th Aug '06, 2:57pm
I think it's the right php.ini file (I used this file to change the maximum upload size). Maybe I'm reaching the limits of my server knowledge, I didn't realize there were multiple php.ini files?
Steve Machol
Thu 17th Aug '06, 3:01pm
Enable phpinfo in the Admin CP, then provide the URL to your forums. This may help us troubleshoot this problem.
Admin CP -> vBulletin Options -> Server Settings and Optimization Options -> Public phpinfo() Display Enabled
Freddie Bingham
Thu 17th Aug '06, 3:04pm
Did you try using /var/www/vhosts/example.com/httpdocs/forums/attachments/ ?
matt3830
Thu 17th Aug '06, 3:11pm
Enable phpinfo in the Admin CP, then provide the URL to your forums. This may help us troubleshoot this problem.
Admin CP -> vBulletin Options -> Server Settings and Optimization Options -> Public phpinfo() Display Enabled
I submitted a support ticket yesterday (I posted it to this forum to see if anyone else had any ideas).
http://www.vbulletin.com/issue.php?ticketid=449949
Did you try using /var/www/vhosts/example.com/httpdocs/forums/attachments/ ?
I tried this and got this error message:
We attempted to write a test file to /var/www/vhosts/example.com/httpdocs/forums/attachments, but we were unsuccessful. Please verify that the web server has write/delete permissions for this path.
Freddie Bingham
Thu 17th Aug '06, 3:13pm
Did you chmod the directory properly?
Steve Machol
Thu 17th Aug '06, 3:16pm
According to your phpinfo, the correct file is here:
/etc/php.ini
It all has a section to scan for additional files in this directory:
/etc/php.d
And open_basedir restrictions are definitely turned on.
matt3830
Thu 17th Aug '06, 3:22pm
OK, I've had some success using this directory:
/var/www/vhosts/example.com/attachments/
But, I don't think vbulletin will be able to use it's permission settings if I use this directory (anyone will be able to download the attachments).
Freddie Bingham
Thu 17th Aug '06, 3:24pm
If you place the attachment directory within your www folder then you can protect it using .htaccess
matt3830
Thu 17th Aug '06, 3:30pm
The problem was with the owner ship of the directories I was creating for the attachments. So now they seem to be working. Which is the better location for the place to store the attachments?
/var/www/vhosts/example.com/attachments/
or
/var/www/vhosts/example.com/forums/attachments/
Do I need to use the .htaccess file in either location?
matt3830
Fri 18th Aug '06, 1:54am
Do I need to use the .htaccess file if the attachments directory is under the forums directory?
/var/www/vhosts/example.com/httpdocs/forums/attachments/
Freddie Bingham
Fri 18th Aug '06, 2:43am
Yes.
You should use the /var/www/vhosts/example.com/attachments/ whereas you will not need .htaccess.
matt3830
Fri 18th Aug '06, 3:02am
The only path I've been able to get to work is:
/var/www/vhosts/example.com/httpdocs/forums/attachments/
Can I download the .htacces file somewhere?
vBulletin® v3.8.0 Beta 3, Copyright ©2000-2008, Jelsoft Enterprises Ltd.