SEObox: Web Hosting Murah Unlimited Homeschooling Indonesia

WordPress + suExec = can not upload ?

If you find that you can not upload pictures anymore to WordPress, and the only things that have changed is your webhoster — then your webhoster may have suExec setup on their server.

suExec is a module for Apache webserver that makes it more secure.
Basically, it will execute scripts with its owner’s permission - not Apache’s.

In this case however it can cause problems when uploading, I have posted the details on WordPress forum :

With suExec you’ll still have problems uploading, usually you’ll get the follwoing error message :

The uploaded file could not be moved to /home/myusername/myblog.com/wp-content/uploads/2008/06.

Reason being because WP created that 2008/06 dir as apache’s user (www-data / httpd / etc), but suExec require that dir to be owned by myusername - otherwise the upload will fail.

Changing the directory’s ownership to myusername fix the problem - but on the next month (when WP created the new directory for that month) you’ll encounter this problem again.

A workaround is to setup a cronjob that will fix the permission / ownership of the uploads directory (on WPMU : blogs.dir) automatically on the beginning of every month.

Ideally, this shouldn’t happen, but I haven’t got an idea at all.

Hope it helps someone out there.

4 Responses to “WordPress + suExec = can not upload ?

  • 1
    rendy
    June 5th, 2008 08:53

    jelas pasti akan error mas, kalau pake suexec, folder itu harus dibuat sebagai milik user biasa, bukan httpd,

    solusi singkat, di chown -R user.user namafolder
    pake cronjob script bisa juga, tapi ngga akan berhasil 100%

    kalau dari saya, coba buat user baru, yang levelnya rendah, terus jalanin si situs dari dalam direktori mereka, misal /home/username/public_html dan perbaiki httpd.conf agar jalan dengan suexec, chmod si folder yang mau di writablenya itu ke 777, terus pasang suhosin, it works, tp ga tau kalo di tempatnya mas, lum pernah masuk

  • 2
    Mike
    June 5th, 2008 14:33

    Thanks for sharing. This save me some times.

  • 3
    HP Server
    June 5th, 2008 16:21

    I’ve never have picture uploading problem since I upgrade to 2.5…

    Cheers :)

  • 4
    Free ebooks
    June 5th, 2008 20:44

    it’s not about the suexec, try to change owner and chmod the folder

Leave a Reply

Subscribe without commenting