upload problem - wordpress

HMTKSteve

Verified User
Joined
Jan 18, 2009
Messages
78
I hope this is the correct place to put this problem.

I have a site that runs on wordpress. It belongs to the admin account and was moved from another server via tar/scp. While it is possible to FTP files and use the directadmin file manager to upload files it is impossible to use the internal wordpress file uploader inside the post creation section of wordpress.

I have even gone so far as to set the upload directory to 777 and still no files could be uploaded using wordpress.

Anyone have an idea why this might be?

EDIT: If I set a file to 777 (such as a theme file) I can edit/save it via wordpress without an error.
 
Last edited:
If you are using open basedir, the default upload_tmp_dir (normaly '/tmp', see php.ini) causes problems - look in your logs and you will see the error reported - this is confusing because the similar session.save_path does not cause a problem!

You have a choice on how to fix this, you can either modify the basedir path to include /tmp OR use the directive "php_admin_value upload_tmp_di xxxx" to set the value to something within the basedir path.

You also have a choice how to accomplish this: either via .htaccess or in custom apache configuration for the domain. Or if you want to solve the problem server wide, you can use custom domain templates in

/usr/local/directadmin/data/templates
 
If you are not running php under cgi, you script executes as part of apache and has the same access rights as the user account under which apache runs. At the very least, that means the contents of EVERY vhost on the box.

This is not generally a desirable thing, so "safe_mode" (file ownership) or "basedir" (file prefix) restrictions are used. PHP is phasing out safe_mode (it is an extra file system hit per access and pretty hard to live with generally) so usually basedir is used. Even if a single user owns every vhost on the box, this sort of restriction is useful - think of an ocean liner with multiple watertight compartments - a brush with the rocks might only damage a single compartment (i.e. a vhost is breached) and not cost you the whole ship.
 
Back
Top