Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with OpenID
Advertise on LowEndTalk.com

In this Discussion

[HELP] Wordpress, unable to install, remove or upload any images...

[HELP] Wordpress, unable to install, remove or upload any images...

thammy321thammy321 Member
edited May 7 in Help

Hi, yesterday i've moved my Wordpress site from Shared Hosting to VPS, but after i logged in, i was unable to install, remove or upload any images. I always get:

Update Failed: Could not create directory.

**The uploaded file could not be moved to wp-content/uploads/2018/05.

Installation failed: Could not create directory.

I have tried multiple tutorials how to fix this.**

Some links i've tried:

https://www.tipsandtricks-hq.com/how-to-fix-the-unable-to-create-directory-error-in-wordpress-5264

https://www.quora.com/Whenever-I-try-to-update-the-WordPress-or-plugins-it-shows-Update-Failed-Could-not-Create-Directory-any-working-solution

https://www.admfactory.com/installation-failed-could-not-create-directory-in-wordpress/

Please somebody help me, i'd legit pay to get this fixed.

Thanks a lot

Tagged:

Comments

  • vovlervovler Member

    Seems like an issue related to wrong permissions

    Thanked by 1kkrajk
  • thammy321thammy321 Member

    @vovler said: Seems like an issue related to wrong permissions

    I think so, but i've tried to change permissions to everything. 755, 777 but nothing actually works :(

  • YmpkerYmpker Member

    @thammy321 said:

    @vovler said: Seems like an issue related to wrong permissions

    I think so, but i've tried to change permissions to everything. 755, 777 but nothing actually works :(

    Have you tried settinf these permissions recursively?

    Thanked by 1Lee
  • noamannoaman Member

    @thammy321 said: Hi, yesterday i've moved my Wordpress site from Shared Hosting to VPS, but after i logged in, i was unable to install, remove or upload any images. I always get:

    Update Failed: Could not create directory.

    **The uploaded file could not be moved to wp-content/uploads/2018/05.

    Installation failed: Could not create directory.

    I have tried multiple tutorials how to fix this.**

    Some links i've tried:

    https://www.tipsandtricks-hq.com/how-to-fix-the-unable-to-create-directory-error-in-wordpress-5264

    https://www.quora.com/Whenever-I-try-to-update-the-WordPress-or-plugins-it-shows-Update-Failed-Could-not-Create-Directory-any-working-solution

    https://www.admfactory.com/installation-failed-could-not-create-directory-in-wordpress/

    Please somebody help me, i'd legit pay to get this fixed.

    Thanks a lot

    It should be an easy fix

    if apache then you need to use chown command to giver proper permissions to www-data user

    Cloudflare won't let me post the exact command here

  • thammy321thammy321 Member

    noaman said: It should be an easy fix

    if apache then you need to use chown command to giver proper permissions to www-data user

    Cloudflare won't let me post the exact command here

    my WP is in different directory. /home/admin/web/DOMAIN/public_html/wp/

  • vovlervovler Member

    @thammy321 said:

    noaman said: It should be an easy fix

    if apache then you need to use chown command to giver proper permissions to www-data user

    Cloudflare won't let me post the exact command here

    my WP is in different directory. /home/admin/web/DOMAIN/public_html/wp/

    Ok, you got youself a VPS and what exactly are you running? Apache? Nginx? OpenLiteSpeed?

    If you don't know much about VPS's go with something that installs everything in one go: EasyEngine or CentminMod or CyberPanel

  • thammy321thammy321 Member

    vovler said: Ok, you got youself a VPS and what exactly are you running? Apache? Nginx? OpenLiteSpeed?

    If you don't know much about VPS's go with something that installs everything in one go: EasyEngine or CentminMod or CyberPanel

    I've bought VPS from HostSolutions, the $5 for 3months LED deal. My friend has setup everything for me, i believe it's running apache. On CentOS 6.9.

    Basically i have Wordpress installed in /wp/ directory.

    public_html > my HTML site here > /wp/ Wordpress site here

    domain.com is plain HTML, domain.com/wp/ is Wordpress.

  • FalzoFalzo Member

    @thammy321 said:

    my WP is in different directory. /home/admin/web/DOMAIN/public_html/wp/

    from the looks of it, that's VestaCP and the domain/content is put directly under the admin user which on top is able to sudo and access all vesta shell scripts.
    the content most likely was then uploaded/synced as another user, probably just using root with plain password via port 22 ...

    next up: my VPS got suspended for sending out DDOS while my Wordpress wasn't even running yet - let's blame the provider.

    sorry to say, but seems like there simply is not any knowledge on how to manage an unmanaged VPS. so this whole thing isn't the brightest idea to say at least.

    TL;DR; stay with shared hosting as long as you haven't learned how to do basic linux administration.

    UltraVPS.eu KVM in US/UK/NL/DE: 15% off first 6 month and cheap 750G / 2TB storage offers
    Netcup KVM: 2GB 40TB BW - 16,14€ 6m or 2 dedCore 6GB 320GB - 78,88€ 12m /w 5€ off: 36nc15279180197 | 36nc15292244387

    Thanked by 1vovler
  • vovlervovler Member

    @Falzo said: TL;DR; stay with shared hosting as long as you haven't learned how to do basic linux administration.

    +1

    Thanked by 1kkrajk
  • thammy321thammy321 Member

    Falzo said: TL;DR; stay with shared hosting as long as you haven't learned how to do basic linux administration.

    I was with shared hosting for a long time, but now i'm gettig over 1M traffic monthly (plain HTML). My shared hosting cannot handle this.

    Thanked by 1kkrajk
  • deankdeank Member
    edited May 7

    Then you should get managed VPS. You are paying the lowest of low for a hosting account while you are getting healthy traffic.

    Reminds me of those who scream that they are losing millions when their 1 dollar VPS is down.

    The customer is usually wrong, 66.6% of time.

    Thanked by 1kkrajk
  • thammy321thammy321 Member

    deank said: Then you should get managed VPS. You are paying the lowest of low for a hosting account while you are getting healthy traffic.

    Reminds me of those who scream that they are losing millions when their 1 dollar VPS is down.

    So, it's not possible to fix my issue?

  • deankdeank Member

    Possible to fix the issue. Then what? You are gonna run into more issues.

    You can't keep expecting some random dudes on the internet to keep fixing your issues. It's not a marriage.

    The customer is usually wrong, 66.6% of time.

  • thammy321thammy321 Member

    deank said: Possible to fix the issue. Then what? You are gonna run into more issues.

    You can't keep expecting some random dudes on the internet to keep fixing your issues. It's not a marriage.

    I understand. I'm stuck now basically. I'll just use shared hosting for now. The Hostsolutions VPS was just to try things out, how many people can Wordpress VPS handle. Since Shared hosting for wordpress can only handle 1,5k traffic at once.

  • deankdeank Member

    Like I said you can get managed VPS. Do expect to pay substantially more.

    Or mess around with the VPS you have in hand and learn.

    The customer is usually wrong, 66.6% of time.

    Thanked by 1Falzo
  • elliotcelliotc Member

    Learn openvz. KVM is a much better learning environment.

    Looking for cheap vps to monitor the uptime of idle vps.

  • jsgjsg Member
    edited May 7

    @thammy321

    You must provide more information to make it easier to help you.

    Based on what l can guess you must find out as which user your web server runs. Usually web servers run as www or www-data or similar.

    Next you must make that user the owner of /path/to/your/public_html like so 'chown -R www /your/path/public_html' where 'www' stands for the user I talked about. Finally you should also restart the server. Typically like so 'service apache restart'.

    P.S. I had to delete part of my advice because +$%#!! Cloudflare took a normal innocent linux command as an attack.

    Thanked by 1thammy321
  • thammy321thammy321 Member
    edited May 7

    jsg said: Next you must make that user the owner of /path/to/your/public_html like so 'chown -R www /your/path/public_html' where 'www' stands for the user I talked about. Finally you should also restart the server. Typically like so 'service apache restart'.

    "chown: invalid user: `www'"

    Looks like its different user

    p.s. this was my command: chown -R www /home/admin/web/domain.com/public_html/wp/

  • thammy321thammy321 Member
    edited May 7

    UPDATE!

    ISSUE FIXED.

    chown -R admin /home/admin/web/domain.com/public_html/wp/

    worked. Thanks to everyone for help

  • deankdeank Member

    The end has been averted, for now.

    The customer is usually wrong, 66.6% of time.

  • JunklessJunkless Member

    should be www-data, not just www

  • jsgjsg Member

    Side note: I had written down a simple command that would show you the probable user but that's the part I had to delete due to Cloudflares "security" concerns.

    Thanked by 1thammy321
  • FalzoFalzo Member
    edited May 7

    @thammy321 said: UPDATE!

    ISSUE FIXED.

    chown -R admin /home/admin/web/domain.com/public_html/wp/

    worked. Thanks to everyone for help

    so now your wordpress script files belong to user admin and group root, don't bother any further, because it worked

    you should now go and check the performance of your doings by running a simple bench script like @FlamesRunnner suggest in his signature (simply copy and paste this command into your shell ):

    wget https://andrew-hong.me/dl/bench.sh && bash bench.sh

    UltraVPS.eu KVM in US/UK/NL/DE: 15% off first 6 month and cheap 750G / 2TB storage offers
    Netcup KVM: 2GB 40TB BW - 16,14€ 6m or 2 dedCore 6GB 320GB - 78,88€ 12m /w 5€ off: 36nc15279180197 | 36nc15292244387

  • ahmiqahmiq Member

    I had similar problem a while ago where i could not upload new images to the wordpress.

    the problem was with wrong permissions of the tmp folder.

  • vovlervovler Member

    @thammy321 said: UPDATE!

    ISSUE FIXED.

    chown -R admin /home/admin/web/domain.com/public_html/wp/

    worked. Thanks to everyone for help

    That is not the best solution... admin rights on all wordpress files....

  • jvnadrjvnadr Member

    vovler said: That is not the best solution... admin rights on all wordpress files....

    If he has installed Vesta, admin is not the root user but the default user of the panel itself. So, it is pretty safe to chmod the files as admin, because the only thing admin has access to, is the administration of the panel.

    • If a program actually fits in memory and has enough disk space, it is guaranteed to crash.
    • If such a program has not crashed yet, it is waiting for a critical moment before it crashes.

    Thanked by 1Junkless
  • @Falzo

    Ahem, please use the updated link in my sig because the other system is currently down :)

    Thanked by 1Falzo
  • thammy321thammy321 Member

    jvnadr said: If he has installed Vesta, admin is not the root user but the default user of the panel itself. So, it is pretty safe to chmod the files as admin, because the only thing admin has access to, is the administration of the panel.

    i have Vesta. yes.

  • thammy321thammy321 Member

    FlamesRunner said: Ahem, please use the updated link in my sig because the other system is currently down :)

  • @thammy321

    Gotta run it too :)

    bash bench.sh

    Thanked by 1Aidan
  • vovlervovler Member

    @FlamesRunner said:

    Gotta run it too :)

    bash bench.sh

    Oh my...

  • FalzoFalzo Member

    @vovler said:

    @FlamesRunner said:

    Gotta run it too :)

    bash bench.sh

    Oh my...

    tick tick tick :-)

    LOL.

    UltraVPS.eu KVM in US/UK/NL/DE: 15% off first 6 month and cheap 750G / 2TB storage offers
    Netcup KVM: 2GB 40TB BW - 16,14€ 6m or 2 dedCore 6GB 320GB - 78,88€ 12m /w 5€ off: 36nc15279180197 | 36nc15292244387

    Thanked by 1FlamesRunner
  • jsgjsg Member

    @thammy321

    @vovler is right and you shouldn't carelessly chown to a presumably more powerful user but to the one needed.

    Another way to find the right user that passes ##*%$&! Cloudflare assuming your web server serves on port 80 is this: 'lsof -i :80' which will show the user your web server is running as in the 3rd column. Once found plug that user name into the above 'chown -R' command and you are on the safe side.

  • jetchiragjetchirag Member

    Afaik, by default vesta's php fpm needs user to have file access and not the web server. So, admin user should be fine but considering it's admin, it's likely to have access to other higher leg level stuff as well.

    It'd had been good to use another user but for you, I'd recommend managed vps. If something like recent vesta exploits kicks in, you are done.

  • @jetchirag said: Afaik, by default vesta's php fpm needs user to have file access and not the web server. So, admin user should be fine but considering it's admin, it's likely to have access to other higher leg level stuff as well.

    It'd had been good to use another user but for you, I'd recommend managed vps. If something like recent vesta exploits kicks in, you are done.

    Be happy he isn't using Shitora or zGarbage.

  • aditya5670aditya5670 Member
    edited July 10

    -spammy domain-

  • AuroraZAuroraZ Member

    @FlamesRunner said: Necro

    The Dark Arts.

    Dont'TalkAboutLetClub @WSS is an underwear thief!

    upto32.com Retro at it's best

    Thanked by 1FlamesRunner
  • Holy sht. How do I avoid these kinds of headaches? As a typical wordpress user, will my site ever blow up like this just from posting and having a paywall? I mean, wow.

  • I use runcloud to automate all of my wordpress sites, including friends and family. I would recommend trying to use them with your VPS as its a simple and easy to use service. I used dropbox to do my backups and restore after provisioning the website using runcloud on my VPS.

    If you have any questions with runcloud, feel free to DM me and I will help where I can. Aff link in signature, but you can go directly to runcloud.io if you wish.

    Automate server mgmt w/ Runcloud - aff link will give +15 days if you go pro

  • mohamedmohamed Member
    edited July 10

    The proper way to fix your WordPress, please follow these instructions carefully:

    1- take a database backup from your old WordPress.

    2- take backup of your old wp-content directory, that contains themes, plugins and uploads.

    3- Install a clean WordPress on your new VPS.

    If you don't know how to configure a web server, you could use virtualmin which has better security practice than vestacp and use virtualmin UI to install clean WordPress.

    4- use phpmyadmin to import your old database backup in a new database and replace its information in wp-config.php file.

    5- replace your old wp-content with the newly installed wp-content.

    6- You're good to go.

  • mohamedmohamed Member
    • step 5- Virtualmin uses www-data user with apache so you could just change ownership of your old wp-content directory

    chown -R www-data: wp-content

    Its permission should be 755 not 777

    chmod 755 wp-content

    If you face any problems please don't hesitate to contact LET help desk.

    Thank you!

Sign In or Register to comment.