Unable to locate WordPress Content directory (wp-content).
Posted on | June 21, 2009 | Views (6,072)
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
55 Responses to “Unable to locate WordPress Content directory (wp-content).”
Leave a Reply
Hi everyone, I'm Hui, a student originally from China, now studying at TELECOM SudParis in France. Hui-Wang.info is being used as a place to record my various adventures with technology.
July 18th, 2009 @ 5:20 PM
Thank you very much .
God will Help you
[Reply]
July 19th, 2009 @ 12:46 PM
Thanks very much. This is a great help.
[Reply]
Hui Reply:
July 19th, 2009 at 8:03 PM
You are welcome, This problem has also bothered me for a long time. Many Thanks for our dynamic wordpress community.
[Reply]
July 29th, 2009 @ 6:03 AM
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
[Reply]
Hui Reply:
July 29th, 2009 at 9:44 AM
Hi Vande, please feel free to tell any body you like about this solution. I love to share!
[Reply]
August 1st, 2009 @ 6:01 PM
Thank you. You made my day!
[Reply]
August 4th, 2009 @ 12:20 PM
weird when im using this trick wordpress reditect me to the install process!
[Reply]
August 5th, 2009 @ 7:10 AM
Thanks a lot…..it worked for me too!!!!!!!!!!!!
[Reply]
August 6th, 2009 @ 12:42 PM
Hey, that works great!
Thanks a lot
[Reply]
Hui Reply:
August 10th, 2009 at 4:38 PM
Thanks for your feedback, you are welcome, schmiddi.
[Reply]
August 6th, 2009 @ 2:10 PM
[...] 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. [...]
August 7th, 2009 @ 3:03 AM
This is awesome! Thank you SOO much.
[Reply]
Hui Reply:
August 10th, 2009 at 4:37 PM
You are welcome, Jacky.
[Reply]
August 14th, 2009 @ 6:28 PM
thank so much for ur great help..
[Reply]
August 15th, 2009 @ 1:29 AM
Sorry, this solution did not work for me.
[Reply]
August 15th, 2009 @ 3:19 AM
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!
[Reply]
August 15th, 2009 @ 5:19 AM
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.
[Reply]
Hui Reply:
August 15th, 2009 at 9:51 AM
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.
[Reply]
August 15th, 2009 @ 9:47 AM
Nice, it works!
[Reply]
August 15th, 2009 @ 10:17 AM
@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.
[Reply]
August 16th, 2009 @ 7:31 PM
Wow It’s Work !!!
im almost say good bye with wp after i found this solution
love it !!
Thankssss
[Reply]
August 17th, 2009 @ 12:03 PM
Hi. thank you very much for your help. I’m now able to install themes.. thanx a lot! you’re such an angel!
[Reply]
August 20th, 2009 @ 4:14 AM
very useful!
thanks a lot
[Reply]
August 26th, 2009 @ 5:46 AM
Thank you very much .
[Reply]
August 27th, 2009 @ 12:37 PM
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.
[Reply]
August 28th, 2009 @ 5:32 PM
Great little modification, fixed my problem right away. Thanks very much for sharing.
[Reply]
September 8th, 2009 @ 9:35 AM
after using the fix i get the error message: Download failed. Could not create Temporary file
[Reply]
September 9th, 2009 @ 11:32 AM
@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?
[Reply]
September 16th, 2009 @ 7:39 AM
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
[Reply]
September 17th, 2009 @ 3:31 AM
Ur a legend!
[Reply]
September 17th, 2009 @ 11:44 PM
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?
[Reply]
September 19th, 2009 @ 6:11 AM
Thanks very much fron Tokyo. Arigatoune
[Reply]
September 20th, 2009 @ 9:28 AM
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.
[Reply]
September 23rd, 2009 @ 7:40 PM
[...] kaynak… [...]
November 5th, 2009 @ 9:03 AM
…danke, das war hilfreich!…
[Reply]
November 15th, 2009 @ 7:15 AM
I gave up on bytehost the last time because of the same problem. Thanks for the solution.
[Reply]
December 9th, 2009 @ 7:01 PM
[...] Unable to locate WordPress Content directory (wp-content). | WhuIsOnline. Share this post! [...]
December 10th, 2009 @ 11:40 PM
Works effortlessly. Cheers.
[Reply]
December 13th, 2009 @ 3:12 AM
You rock!
[Reply]
December 13th, 2009 @ 7:35 AM
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.
[Reply]
December 16th, 2009 @ 12:03 PM
[...] this while googling for a solution, I thought It was a server restriction problem (You’ll [...]
December 22nd, 2009 @ 4:18 PM
waaawww,, That’s Great. Thaks a Lot, may god bless u
[Reply]
December 22nd, 2009 @ 7:04 PM
Thanks a lot dude. It worked for me
[Reply]
December 25th, 2009 @ 4:39 PM
Thanxxxxxxxxxxxxxxxxxxx
!!!
This is genius
[Reply]
January 8th, 2010 @ 8:16 PM
@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.
[Reply]
January 8th, 2010 @ 9:44 PM
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
[Reply]
January 11th, 2010 @ 5:07 PM
@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.
[Reply]
January 31st, 2010 @ 1:49 AM
Thanks for the solution. Just what I needed!
[Reply]
February 3rd, 2010 @ 7:50 AM
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.
[Reply]
February 14th, 2010 @ 2:06 PM
Thanx a lot. I am using byethost for the first time and encountered the same problem
[Reply]
February 18th, 2010 @ 6:46 PM
Thanks for this!
I have been banging my head against a wall for the past 2 hours with this one.
Works perfect now.
[Reply]
February 19th, 2010 @ 5:12 AM
thanks a lot, it works pretty well in my blog ^^
[Reply]
February 19th, 2010 @ 3:43 PM
[...] permissions to the necessary files were correct and after about 45 minutes I found a blog post by Hui Wang which provided the [...]
March 2nd, 2010 @ 1:05 PM
Works like charm. Thanks for a very useful tips. Success to you always.
[Reply]
March 6th, 2010 @ 12:32 AM
Thank Hui!! this is exactly what I’m looking for.
[Reply]