Unable to locate WordPress Content directory (wp-content).
by Hui Wang
This error arised from the installation of a plugin within the dashboad where the ftp information is needed. I am currently using byethost.com as my web host.
I found that someone here is talking about the similar problem. For this moment, I have just figoured out that error is generated by the file
wp-admin/includes/class-wp-upgrader.php in line 48.
It may be a server configuration problem or a WordPress bug. Get some ideas?
Continued…
Hello, everyone. I am very glad to give you the solution which work for me. Many thanks for mcarretero!
Add the following code at the end of your wp-config.php file.
/** Override default file system method*/ if(is_admin()) { add_filter('filesystem_method', create_function('$a', 'return "direct";' )); define( 'FS_CHMOD_DIR', 0751 ); }
Broadly speaking, this piece of code set the file system method to be direct which means that php scripts(in our case, wordpress) could creat and remove files directly if you get connected. In a result, we could install plugins without ftp connection.
Please let me konw wheather it works for you.
Comments
Thank you very much .
God will Help you
Thanks very much. This is a great help.
You are welcome, This problem has also bothered me for a long time. Many Thanks for our dynamic wordpress community.
hi many thanks for you, you really help me out from this problem.. i’m using byethost too, and i meet this trouble things since i work with wordpress 2.7, firstly i cannot upgrade my plugin, but its not a problem since i just use a few plugin and i just need to overwrite it when the plugin need tobe update but since i work with wordpress to 2.8 and use more plugin, the upgrade of plugin that i use before is harder and need more time, hehehehe and thanks to your post, you really help me out, and if you don’t mind i want to tell my friend about your post
Hi Vande, please feel free to tell any body you like about this solution. I love to share!
Thank you. You made my day!
weird when im using this trick wordpress reditect me to the install process!
Thanks a lot…..it worked for me too!!!!!!!!!!!!
Hey, that works great!
Thanks a lot
[...] Früher hatte ich meinen Blog direkt bei WordPress gehostet. Aus Gründen, an die ich mich nicht mehr erinnern kann zog ich irgendwann zu Byethost um. Ist zwar nicht der schnellste Webspace, kostet dafür aber auch nichts Allerdings konnte ich seit diesem Tag die Autoupdate Funktion für meine Plugins nicht mehr nutzen. Bei Google-Analytics oder meinem Kram war das durchaus zu verschmerzen. Da ich nun aber diese Spamfilter nutze, möchte ich diese Plugins doch aktuell halten. Ich bekam immer die Meldung wp-content not found nachdem ich die Zugangsdaten für FTP eingetippt hatte. Auf dieser netten Seite fand ich dann die Lösung. [...]
This is awesome! Thank you SOO much.
You are welcome, Jacky.
Thanks for your feedback, you are welcome, schmiddi.
thank so much for ur great help..
Sorry, this solution did not work for me.
hi. im having the same problem and i’m a newbee. I’m using byethost and installed wordpress through their fantastico type installer. my question is where do i get that wp-config.php file?. if it’s not too much to ask, can you email me the instructions on how to solve this problem? Thanx so much!
im sorry.. im really just starting on my site.. i dont know where i can find my wp-config.php file.. can anyone help me with this? pls? thank u very much.
Nice, it works!
Hi ailleen, feel free to ask any question.
I installed my site with byethost’s FTP and I get a free account. So I couldn’t promise you that the following instrctuion works for their fantastico type installer. Anyway, have a try.
Firstly and necessarily, install a FTP client in your computer if you don’t have one. I would recommend the Filezilla FTP client.
Secondly, Get connected to your FTP server via the FTP client I mentioned above. You will be asked a host, a username and a password which are available in your user control panel when you log in your account on byethost.com
Thirdly, typically you could find a directory named by your domain name. Browser yourself to the htdocs directory where you could find all the source files concerning your site, of course, the wp-config.file . So the hierarchy comes like yourDomainNameDirectory->htdocs->wp-config.php
The last work is to modify the file as what I have said in the post, right click on the file wp-config.php and choose the View/Edit option, you will be redirected to a file editor. After saving the modified file, come back the FTP client and confirm the change.
If this is not clear enough for you, please don’t hesitate to let me know.
@blogoncherry – I am sorry to hear it, but don’t be discouraged. Could you give us more error informations? By the way, your site design is very elegant.
Wow It’s Work !!!
im almost say good bye with wp after i found this solution
love it !!
Thankssss
Hi. thank you very much for your help. I’m now able to install themes.. thanx a lot! you’re such an angel!
very useful!
thanks a lot
Thank you very much .
Hey, I am also using Byethost as my web host and have been getting the same error. I thank you, your fix have solved my problem. thanks.
Great little modification, fixed my problem right away. Thanks very much for sharing.
after using the fix i get the error message: Download failed. Could not create Temporary file
@WPU User – This is a file permission related issue. Could you please give us more information about your hosting environment? Which web server do you use?
I really did not expect this to work, I thought the problem was directory structure related and that the wp-admin is not found because it further down under httpdocs directory.
I’m gonna have to file this under those “Things that work but I don’t understand category”
Thanks
Ur a legend!
Unfotunately it did not help. What I got on screen:
Install Themes
* Search |
* Upload |
* Featured |
* Newest |
* Recently Updated
An Unexpected HTTP Error occured during the API request.
Try again
—
This is a CentOS server
vsftp installed with write permissions
Does somebody recognize this problem?
Thanks very much fron Tokyo. Arigatoune
Somethings to add on. Some host may require the permission to set to 777 and don’t forget to change the ‘upgrade’ folder permission as well.
[...] kaynak… [...]
…danke, das war hilfreich!…
I gave up on bytehost the last time because of the same problem. Thanks for the solution.
[...] Unable to locate WordPress Content directory (wp-content). | WhuIsOnline. Share this post! [...]
Works effortlessly. Cheers.
You rock!
I thank you very much dear. It works fine. Will there be any prob to our site content? since we have changed the access permission.
Thanks once again.
[...] this while googling for a solution, I thought It was a server restriction problem (You’ll [...]
waaawww,, That’s Great. Thaks a Lot, may god bless u
Thanks a lot dude. It worked for me
Thanxxxxxxxxxxxxxxxxxxx
!!!
This is genius
@Mohamed: Hi Mohamed, in my opinion there won’t be additional risks since what we’ve changed is the file system method. To install files, you should at least get connected in WordPress. Regarding the file permissions, 751 is safe. So be sure keep your wp password a secret.
HI. When I try to upgrade my wordpress automatically i get the following error.
You do not have sufficient permissions to access this page.
is it to do something with the setting by the host or something else?
Please help
@Dr S K Verma: Hi Verma, I don’t think that it’s a problem in the host side. Probably because of an incomplete upgrade or something about your database settings. You would find plenty of posts by a simple google search. Good luck.
Thanks for the solution. Just what I needed!
THANK you for the solution! I’ve been racking my brain for the past 3 hours trying to get wordpress to configure. Your page saved a little of my sanity and my keyboard from further blunt damage.
Thanx a lot. I am using byethost for the first time and encountered the same problem
Thanks for this!
I have been banging my head against a wall for the past 2 hours with this one.
Works perfect now.
thanks a lot, it works pretty well in my blog ^^
[...] permissions to the necessary files were correct and after about 45 minutes I found a blog post by Hui Wang which provided the [...]
Works like charm. Thanks for a very useful tips. Success to you always.
Thank Hui!! this is exactly what I’m looking for.
I can’t find my wp-config.php file. Please help, and tell me the location where it stored on.
You can find it in your site’s root folder, public_html. It’s the one that you have to modify when you installed wordpress.
Thank you!
Hooray! Thanks a lot!
[...] hab ich endliche eine Lösung gefunden, die das Problem [...]
Many thanks!
It worked
Thank you very very much! I was really frustrated at my ftp and this solved all the problem! THX!
thx very much…
this is solve my problem
salam from indonesia
Yes, it worked for me, using a fresh instal of WP 2.9.2 on my local network NAS server. Thanks.
[...] plugin folder, upgrade folder) and to add the following to the wp-config file as indicated by Hui Wang: if(is_admin()) { add_filter(‘filesystem_method’, create_function(‘$a’, [...]
[...] Dank an dich, Hui Wang! Kategorien: Webdesign tags: fail, plugin, theme, wordpress, wp-content Hinterlasse [...]
Worked perfectly for me and first time…
Thanks for the heads up…
Thanks, it works perfectly
Thank you so much! It worked perfectly!!!
Thank you so much! You have save my blog.
Thanks for your post, I appreaciate you taking the time to help others.
But, this did not really work for me. I had to change the plugin folder chmod to 777 temporarily to remove plugins and add new ones.
I am running wordpress 2.9.2 after manually upgrading it.
The automatic upgrade also does not work.
thank’s a lot !!! it is very helpfull !
[...] LinkedIn [...]
Hi!
Been trying to edit the wp-config.php file but i was getting this message:
“Status: This file could not be saved”
I was able to edit and successfully save the changes with my first site but now with my other sites I am having this problem.
I am also using Byethost and I do hope you can shed some light on this.
Thank you so much for this very informative blog of yours!
Ok it would almost work but i need also a TMP file somewhere where do i put it? i use dotster for my hosting.
if(is_admin()) {
add_filter(‘filesystem_method’, create_function(‘$a’, ‘return “direct”;’ ));
define( ‘FS_CHMOD_DIR’, 0751 );
}
THIS WORKS PERFECTLY ON MY SITE!!
using WordPress 3.0
thanks brother
I did this and moved a step forward, but then it said:
Downloading install package from http://wordpress.org/extend/themes/download/lunatic-fringe.1.4.zip…
Unpacking the package…
Could not create directory. /home/[site]/public_html/blogtest/wp-content/upgrade
Hi. I got this error with the FTP some days ago and tried this workaround. It worked like a charm.
Problem is, I needed to modify some files from my current theme, and they were’nt on the FTP like they should. Okay, so I deleted the old theme and downloaded it again, this time without using your code. Now I have the new theme, bright and beautiful in my FTP with all its files at my dispose. BUT the old version of the theme is still there, in the form of an empty folder, and CANNOT be deleted. It won’t let me, even being empty. What can I do?
Great solution!
Thanks a lot, it works at Byethost!
Thank you very much~
Hi, this is so fantastic. I have tried so many different options from wp-codex advices and finally this works!
Smashing! More than made my day. Surely recommend you…
[...] WP cannot access your hosting account via FTP, simply add the snippet of code found here at the end of your wp-config.php file. Filed under: Hits and Tips Leave a comment Comments (0) [...]