WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Cannot upload themes in my laptop? WordPress 3.0.1, Lucid Lynx Desktop (31 posts)

  1. hannah187
    Member
    Posted 3 years ago #

    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

  2. hannah187
    Member
    Posted 3 years ago #

    Can someone please help? I am so stuck. Really

  3. hannah187
    Member
    Posted 3 years ago #

    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.

  4. ClaytonJames
    Member
    Posted 3 years ago #

    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

  5. hannah187
    Member
    Posted 3 years ago #

    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

  6. ClaytonJames
    Member
    Posted 3 years ago #

    @hannah187

    You will want to unzip them first.

    Good luck to you!

  7. hannah187
    Member
    Posted 3 years ago #

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

  8. ClaytonJames
    Member
    Posted 3 years ago #

    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.

  9. hannah187
    Member
    Posted 3 years ago #

    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..

  10. hannah187
    Member
    Posted 3 years ago #

    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

  11. ClaytonJames
    Member
    Posted 3 years ago #

    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?

  12. hannah187
    Member
    Posted 3 years ago #

    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..

  13. hannah187
    Member
    Posted 3 years ago #

    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..

  14. ClaytonJames
    Member
    Posted 3 years ago #

    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

  15. ClaytonJames
    Member
    Posted 3 years ago #

    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!

  16. hannah187
    Member
    Posted 3 years ago #

    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

  17. ClaytonJames
    Member
    Posted 3 years ago #

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

    I think you are just having a bit of bad luck on your first try. -And you might be starting to over-think things. You already know that you can see the site, and the default theme works ok, so php is probably not going to be the issue. I just think you have some ownership issues - and now some permissions issues.

    You are not going to be able to actually upload any themes or plugins using the wordpress dashboard, because that requires a functioning ftp server. You will have to download them to your desktop, and manually place them in the /wp-content/themes directory after un-zipping them. The problem there, is... if you need to "sudo" in order to copy theme files to the theme directory because the files are owned by someone other than your user name, then the files you copy are owned root:root, not hannah:hanna or hanna:www-data.

    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

    You went too deep, and the initial idea was to recursively change ownership and group on everything from /wordpress down, including the wordpress directory.

    Try running these commands exactly as they appear:

    sudo -i [and enter your password]

    cd /var/www

    chown –R hannah:www-data wordpress

    cd wordpress

    find -type d -exec chmod 755 {} \;

    find -type f -exec chmod 644 {} \;

    That changes the wordpress directory and everything in it to you as owner, and www-data as group. After "cd wordpress" the last two commands change all directories to 0755 and all files to 0644 permissions. Then open nautilus/file-browser and physically look in /wp-content/themes to see if the theme you placed there previously still exists, is in its own directory, and that the ownership is now at least your user name and group www-data. If that doesn't change anything, I recommend a new try at a fresh install. The water is starting to get pretty muddy. Or perhaps someone else will have a fresh idea!

    :-)

  18. hannah187
    Member
    Posted 3 years ago #

    interesting now..
    ok followed your instruction but no joy yet (the theme file which I placed here is still there though)
    see the terminal output now:
    hannah@hannah-laptop:/var/www/wordpress/wp-content/themes$ ls -l
    total 12
    drwsr-sr-x 5 hannah www-data 4096 2010-09-02 22:09 2449
    -rw-r--r-- 1 hannah www-data 30 2009-04-16 07:57 index.php
    drwsr-sr-x 4 hannah www-data 4096 2010-07-30 09:56 twentyten
    hannah@hannah-laptop:/var/www/wordpress/wp-content/themes$

    however...
    Now I am able to browse / search different themes through Manage Themes.. previously I was getting this this error:
    An Unexpected HTTP Error occurred during the API request.

    However when I found the theme I like install from the Net (not from my desktop which still fails), following is the message I am getting:

    Connection Information
    To perform the requested action, WordPress needs to access to your web server. Please enter your FTP credentials to proceed. If you do not remember your credentials, you should contact your web host.
    Hostname
    FTP Username
    FTP Password
    Connection Type
    Connection Type FTP FTPS (SSL)

    Is this normal.. what is my Hostname? Funny that I am asking you about my hostname..is it localhost..

  19. hannah187
    Member
    Posted 3 years ago #

    Hi Clayton...
    I just beginning to think another avenue.. I was wondering if when I was installing wordpress and creating the Dbs in MySQL if I had inadvertently did some mistake..

    I had followed the instruction ditto as mentioned here
    http://www.ubuntugeek.com/installing-wordpress-3-0-on-ubuntu-10-04-lucid-lynx.

    is there anything amiss

  20. hannah187
    Member
    Posted 3 years ago #

    I think I might have given the wrong link..here is right one..

    http://www.ubuntugeek.com/installing-wordpress-3-0-on-ubuntu-10-04-lucid-lynx.html

  21. hannah187
    Member
    Posted 3 years ago #

    Did some more digging. Played with phpMyadmin to see my privileges and found that hannah was set to USAGE under Global privileges 1 so I have now changed it to ALL PRIVILEGES

    User Host Password Global privileges 1 Grant Action
    debian-sys-maint localhost Yes ALL PRIVILEGES Yes Edit Privileges
    hannah % Yes ALL PRIVILEGES Yes Edit Privileges

    Still no luck uploading themes. I have restarted my apache webserver though .

  22. ClaytonJames
    Member
    Posted 3 years ago #

    Once again... you CANNOT install themes from the net on your laptop unless you have an ftp server running and available to the WAN. You CANNOT install themes from your desktop into the themes directory using the wordpress media uploader. You MUST copy new themes to the /themes directory manually, (that is why I recommend placing a shortcut in your home directory and making sure that the wordpress directory belonged to your user name ) or by ssh over your own network.

    I'm afraid I have exhausted the extent of my knowledge on the topic, other than to say that assuming you have all of the requirements in place and working beforehand (php ,apache, mysql), the very short, very precise and simple installation instructions I provided above, work. I'm sure there are other methods that work equally as well once you understand what you can and cannot do with a local installation of wordpress.

    Don't give up on it, you'll get it eventually.I recommend you do some more reading, and eventually it will click.

    Good luck to you.

  23. hannah187
    Member
    Posted 3 years ago #

    Clayton.. I do appreciate your continuous help..What I am suprised though however that I did not get any input from anyone else..

    Still love you all..

  24. hannah187
    Member
    Posted 3 years ago #

    Ok some success. I have added this line in wp-config.php and am able to upload some theme files..
    define('FS_METHOD', 'direct');
    Some other theme files are still giving me grief..

    More info:
    Also added myself in www-data user group
    $ sudo usermod -aG www-data hannah

  25. hannah187
    Member
    Posted 3 years ago #

    Just trying to revive this thread..
    Clayton says

    Once again... you CANNOT install themes from the net on your laptop unless you have an ftp server running and available to the WAN. You CANNOT install themes from your desktop into the themes directory using the wordpress media uploader

    Ok I now have vsftpd server running and on the front end I am running Filezilla. Filezilla can connect to my vsftpd and I now have uploaded theme files through Filezilla to wordpress upload directory. However when I am trying to install this theme through Appearance tab under Admin I am getting this error again..

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

    Any help ..anyone please

  26. hannah187
    Member
    Posted 3 years ago #

    once I installed vsftpd daemon..I am now able to install free themes through appearance tab. I wonder if wordpress needs an ftp daemon to connect to outside word to download and install themes

  27. ClaytonJames
    Member
    Posted 3 years ago #

    Just trying to revive this thread...
    ...I wonder if wordpress needs an ftp daemon to connect to outside word to download and install themes

    I thought I had already stated it clearly enough.

    Once again... you CANNOT install themes from the net on your laptop unless you have an ftp server running and available to the WAN.

    Almost every step you have gone through was/is completely un-necessary and time-wasting for simply installing wordpress on your laptop for development or personal purposes. You do not need and ftp server running. You do not need an ftp client. You do not need to open your laptop to the outside world.

    Any help ..anyone please

    I've already told you precisely and clearly, the steps you need to follow to install a safe, fully functional, local installation of wordpress on your Ubuntu Laptop. It is a quick, painless process that takes 15 minutes tops, from beginning to end, including installing mysql, apache2, php5 and all the dependencies required to set up wordpress, including WordPress, on a fresh install of Ubuntu. I have explained to you that creating a shortcut in your home directory, eliminates the security issues associated with the need for running an ftp server. You simply download your themes and plugins, and place them in the proper directories using the shortcut in your home folder.

    It's clear from your responses to my previous replies, that you are going to continue doing what you want to do/think you need to do , rather than follow the advice and directions offered in response to your questions.

    If you would like me to do so, I would be happy to write out, step by step, how to setup and install WordPress on Ubuntu Desktop for personal use, from beginning to end.

    That includes NOT running an ftp server, and NOT being able to download or automatically update plugins and themes from the web. That is functionality that should be addressed by competent web-server administrators, and not something you need to do on your laptop to have a local installation for personal use.

    Let me know what you think, and I'll get to it if you would like. It should only take a few minutes to write up a short outline. Then others can add suggestions or differing opinions if they wish.

    Let me know what you think.

    Cj.

  28. hannah187
    Member
    Posted 3 years ago #

    Thanks a lot CJ for your time and patiece. My hats off to you. I am just learning the rope getting my hands dirty. Thanks a lot again.

  29. ClaytonJames
    Member
    Posted 3 years ago #

    I am just learning the rope getting my hands dirty. Thanks a lot again.

    Okay... I can understand and appreciate that. I will assume that your answer to my last offer is no.

    Best of luck to you, and take care. Don't give up!

    Cj.

  30. hannah187
    Member
    Posted 3 years ago #

    CJ..I believe you had been of most help to me..I am very very grateful for that. I may still come back to you as I know your kind offer is on the table..

    I hope you are doing well..

Topic Closed

This topic has been closed to new replies.

About this Topic