• Resolved hannah187

    (@hannah187)


    Hi all,

    I am a very new user of Worpress so go easy with me please however by saying that I am fairly savy when it comes to

    Operating systems.
    My aim is to build my first Website in my laptop and then host it somewhere else. I have decided to use WordPress to do that.
    I am using Lucid Lynx Desktop and had installed latest LAMP server.
    Installed and configured WordPress 3.0.1 and can see my blog under //Localhost/Wordpress in my Laptop.
    I am now trying to change the theme hence downloaded some themes from the net. I am now logged in and under Admin Menu

    I am using Appearance tab to upload a new theme. But when I try to do that this is the error message I am getting:

    The uploaded file could not be moved to /var/www/wordpress/wp-content/uploads/

    I tried various ways to solve this problem and even CHMOD to give everyone Read, Write and Execute access to this directory

    but I am still getting this error.
    Can someone please help me?

    Kind regards

Viewing 15 replies - 1 through 15 (of 30 total)
  • Thread Starter hannah187

    (@hannah187)

    Can someone please help? I am so stuck. Really

    Thread Starter hannah187

    (@hannah187)

    After searching through this forum I have found this thread.
    http://wordpress.org/support/topic/media-upload-problem-the-uploaded-file-could-not-be-moved-to-error/page/2?replies=42

    I have first tried to follow TypecastFilms instruction which is as below:

    TypecastFilms response:

    In simpler terms:

    Create a phpinfo page, if you don’t already have one.
    Scroll down to “apache2handler” and look for “User/Group.”
    Remember the name listed for the user. My entry was apache(#)/#, the name was “apache.”
    Log into a terminal as the root user. Google this step if you need help here.
    Navigate to the folder just above where your WP is installed. Mine is installed to the root directory (httpdocs), so it was at

    var/www/vhosts/mydomain.com
    Type chown -R (your the username from earlier) (your wp directory)/ – for me, chown -R apache httpdocs/. This changes the

    ownership of the directory to apache.
    Navigate to your wp-content folder: httpdocs/wp-content/
    Type chmod -R 766 uploads/. This changes permissions so that apache can read, write, and execute there.

    In my case, WordPress is installed in my own Ubuntu Laptop and I am trying to install a new theme through WordPress (I do

    not have an external host as yet and I am not trying to ftp to an external host).

    I have tried to modify this instruction as applied to through teminal and still no success.

    Please see below the dump from phpinfo page:
    _____
    apache2handler

    Apache Version Apache/2.2.14 (Ubuntu)
    Apache API Version 20051115
    Server Administrator webmaster@localhost
    Hostname:Port 127.0.1.1:80
    User/Group www-data(33)/33
    Max Requests Per Child: 0 – Keep Alive: on – Max Per Connection: 100
    Timeouts Connection: 300 – Keep-Alive: 15
    Virtual Server Yes
    Server Root /etc/apache2
    _____

    I also have tired this mechanism as mentiones below and still no joy. May be there is something I am missing re: granting permission.

    SanchoPancho

    I think you are all missing the point here. Remember that on a unix / linux server you have to set permissions AND ownership. You can set permissions on a folder but if you are not the owner than you can’t copy files in there.

    When you upload files with the media form in WordPress, files are being stored in a temporay location. When the upload is succesfull WordPress tries to move them to your upload folder. Normally that is wp-content/uploads. It will only succeed if your write permissions are ok (and no, 777 is not needed, just make sure that you have write permissions. 666 should be enough.

    When the write permissions are correctly set you should make sure that you own the uploads folder. Your FTP client should show who owns the folder. This should be the loginname that you use to connect to the ftp server.

    I noticed when I had the problem that the owner of the uploads folder was not correct. So I used the quick and dirty solution:

    1. rename your uploads folder to uploadsold
    2. make a new uploads folder and set the permissions to 666
    3. drag the contents of the uploadsold folder to the uploads folder
    4. remove the now empty uploadsold folder (check first)

    Apologies for this long post but I wanted to let you guys know that I am trying to resolve this.

    Please help.

    Using automatic install on your laptop in a development atmosphere could be both frustrating and a security issue. It means that you have to have a functioning ftp server running in Ubuntu, on your laptop, and facing the web.

    Downloading the themes and plugins to your desktop directly and then placing them in /wp-content/themes /wp-content/plugins may be safer and quicker.

    If you installed WordPress via aptitude, this might also be of interest and information:

    http://wordpress.org/support/topic/just-installed-not-loading-css?replies=6#post-1664014

    Thread Starter hannah187

    (@hannah187)

    Downloading the themes and plugins to your desktop directly and then placing them in /wp-content/themes /wp-content/plugins may be safer and quicker.

    hey thanks.. just quickly shall I unzip the theme files and then place it in /wp-content/themes

    or do I place the .zip files in /wp-content/themes and then need to install it through WP admin..

    many thanks again

    @hannah187

    You will want to unzip them first.

    Good luck to you!

    Thread Starter hannah187

    (@hannah187)

    Ok I will unzip first and then put in the directory. Quesion is will that maintain the proper directory structure which WP understands…

    It should. Once you place them in the /wp-content/themes directory, log into wordpress, and you should be able to activate the new theme. Just be careful not to create any nested folders. The theme should be: /theme_name/theme_files, not /theme_name/theme_name/theme_files.

    Thread Starter hannah187

    (@hannah187)

    ok.. I will try when I get back home.. do not have the luxury of having Linux at work.. thanks a lot for you advice and hope it works for me..

    Thread Starter hannah187

    (@hannah187)

    It should. Once you place them in the /wp-content/themes directory, log into wordpress, and you should be able to activate the new theme.

    Ok I have unzipped and copied the the new theme here: /wp-content/themes

    When Iog back in the Admin Panel: Appearance->Themes I cannot see the new theme.

    Any advice plz

    I can’t think of any reason why the theme would not show under the appearance tab. Make sure the directories for the theme are only one deep, /themes/theme_name/theme_files and take note of any error messages at the bottom of the page related to missing style sheets or anything of that nature. How did you install wordpress, by using the Ubuntu package manager? Or manually?

    Thread Starter hannah187

    (@hannah187)

    I had installed WP manually (not through package manager). I mean I downloaded the zip file from WP site and then installed it. Thanks a lot for trying to help me..

    When I go home this I will post the output for ls -l.

    Still looking for the solution..

    Thread Starter hannah187

    (@hannah187)

    As promised..
    Part Output from phpinfo() file
    Location
    http://localhost/wordpress/wp-content/uploads/phpinfo.php

    apache2handler
    Apache Version Apache/2.2.14 (Ubuntu)
    Apache API Version 20051115
    Server Administrator webmaster@localhost
    Hostname:Port 127.0.1.1:80
    User/Group www-data(33)/33

    Output from the terminal
    hannah@hannah-laptop:/var/www/wordpress/wp-content$ ls -l
    total 20
    -rwxrwxrwx 1 www-data www-data 30 2007-05-05 09:48 index.php
    drwxrwxrwx 3 www-data www-data 4096 2010-07-30 09:56 plugins
    drwxrwxrwx 4 www-data www-data 4096 2010-09-02 22:10 themes
    drwxrwxrwx 3 www-data www-data 4096 2010-09-02 21:41 uploads
    drwxrwxrwx 3 www-data www-data 4096 2010-09-01 00:14 uploads_bak
    hannah@hannah-laptop:/var/www/wordpress/wp-content$

    Any suggestions please..

    If it turns out that the theme you installed is correctly located in /wp-content/themes, and you still can’t see it in the dashboard, it’s possible you could have file/folder ownership issues.

    “-rwxrwxrwx 1 www-data www-data”

    All files should be owned by your user account on your web server, and should be writable by your username. Any file that needs write access from WordPress should be group-owned by the user account used by the web server. For example, you may have a user account that lets you FTP files back and forth to your server, but your server itself may run using a separate user, in a separate usergroup. A user such as dhapache or nobody.”

    You can try chown’ing the existing WordPress files and directories to “hanna:www-data” recursively, and see if that does it.

    hannah@hannah-laptop:~$ sudo chown –R hannah:www-data /var/www/wordpress

    …it will probably work, but it doesn’t leave me with any warm fuzzies.

    This is one Ubuntu/WordPress install method that works reliably for me – strictly as a personal installation. This assumes that all the prerequisites are installed and functioning correctly, and you have not attempted to install WordPress using aptitude or the package manager. Although the instructions are generic, I used this method on my own laptop with Ubuntu 10.04.(1),desktop edition. This gives absolutely no consideration at all to “server” security, application hardening, FTP or SSH. This setup is not intended to face the WAN. 🙂

    Open a terminal:

    hannah@hannah-laptop:~$ sudo -i
    [sudo] password for hannah: [password]
    root@hannah-laptop:~# cd /var/www
    root@hannah-laptop:/var/www# mkdir wordpress
    root@hannah-laptop:/var/www# chown hannah:www-data wordpress
    root@hannah-laptop:/var/www# chmod 0750 wordpress
    root@hannah-laptop:/var/www# logout
    hannah@hannah-laptop:~$ ln -s /var/www/wordpress /home/hannah/wordpress
    hannah@hannah-laptop:~$ exit

    You now have a WordPress directory at /var/www/wordpress with owner [username] and group www-data. You also now have a symlink/shortcut to that directory in Home.

    Download the latest WordPress package and extract the files. Edit and rename wp-config-sample.php per the WordPress installation instructions. Copy the entire contents of the extracted WordPress package, open the symlink in your home folder that points to /var/www/wordpress and paste all of the copied content into that directory.

    Point the browser to //localhost/wordpress and begin the install.

    You can now just open the symlink/shortcut you created in Home to add your themes and plugins without any ownership issues (at least I have not encountered any) and no more command line sudo’ing or “sudo nautilus” every time you want access to WordPress files.

    Yikes! That was longer than I anticipated. I hope I got it all correct, and that something actually helps.

    Cj

    I almost forgot: This error..

    The uploaded file could not be moved to /var/www/wordpress/wp-content/uploads/

    …means that for your first content upload, such as images to place in a post or page, you may need to change permissions on /wp-content to 0777 temporarily to allow wordpress to create the uploads folder. After that you should be able to change it back to 0755. I did not consider that relative at first because themes don’t get uploaded to /wp-content/uploads, but belong in /wp-content/themes instead. Themes and plugins are not uploaded using the media uploader.

    Good luck!

    Thread Starter hannah187

    (@hannah187)

    Ok.. I now have chowned this:

    hannah@hannah-laptop:~$ cd /var/www/wordpress/wp-content
    hannah@hannah-laptop:/var/www/wordpress/wp-content$ ls -l
    total 20
    -rwsrwsrwt 1 hannah www-data 30 2007-05-05 09:48 index.php
    drwsrwsrwt 3 hannah www-data 4096 2010-07-30 09:56 plugins
    drwsrwsrwt 4 hannah www-data 4096 2010-09-02 22:10 themes
    drwsrwsrwt 3 hannah www-data 4096 2010-09-04 16:20 uploads
    drwsrwsrwt 3 hannah www-data 4096 2010-09-01 00:14 uploads_bak
    where when I log in to wordpress admin panel, I use my user Id hannah and as you know that the webserver is owned by www-data.

    You can see I have used recursively chmod -R 7777

    Still no luck uploading the themes and I am still at default theme Twenty Ten 1.1

    I also had been reading and found out about php.ini file where settings were:
    safe_mode = Off
    safe_mode_gid = Off

    I have changed the setting to
    safe_mode = Off
    safe_mode_gid = On

    Then restarted the apache server but still no joy.

    You point of fresh install of WP is noted but I am still trying to see if there is another way of solving these..

    Surely it cannot be this hard or am I just having purely bad beginners luck…

    I wonder if it’s possible to chat with you sometime ClaytonJames

    thanks heaps

Viewing 15 replies - 1 through 15 (of 30 total)
  • The topic ‘Cannot upload themes in my laptop? WordPress 3.0.1, Lucid Lynx Desktop’ is closed to new replies.