Installing in a subfolder

Installing in a subfolder

PLEASE NOTE THIS IS NO LONGER NEEDED WITH THE LATEST RELEASE (2.9.x and up)

This issue is becoming increasingly common as more people try out WPMU on their existing servers, with an existing WordPress install in place. You put the files in a folder, go to the URL, and unlike what the instructions say, you get a brief message saying "There doesn't seem to be a wp-config.php file. I need this before we can get started." and a big " Create configuration file." button.

This is the install message from the single WordPress install. This is not what you should see when installing WordPressMU. Why does it show this? Because within the code of both versions, it looks up a directory for existing installs. This is used in single WP to have the files out of the root, but the blog running off the root. If you do click it, you will wind up in what we call "Install Hell".

So how do we get around this to install WPMU? Well, you could temporarily remove or rename the wp-config.php file in the other WP install. This will bring down your other site until you put it back. I realize this is not ideal for many people, but it is a quick and dirty way, plus it's easy.

So! Let's go hack MU - it's only used once and doesn't matter if it gets overwritten on upgrade, as we only use it the once.

Open the file wp-blog-header.php, it is in the root folder of the WPMU files.

Comment out line 9:

"if ( !file_exists( dirname(__FILE__) . '/wp-config.php') && !file_exists( dirname( dirname(__FILE__) ) . '/wp-config.php')) {"

then go to line 24, which is "}" and comment it out too. That's the end of that particular command.

To comment out these lines, put a // at the beginning of them.

That should allow the real WPMU install screen to show up. Make sure you have deleted any htacess file & wp-config file (if they were created) in the MU root before installing again. Now when you return to your URL, you should definitely see a much longer and different install form.

EDIT: If after doing this, new blogs show the install screen, go back and undo the edits we made above. Everything will run smoothly after that, since you're already installed.

(Visited 1 times, 1 visits today)
47 Comments
  • Bedo
    Posted at 02:53h, 26 June Reply

    Cool! Worked. Thank you!! 🙂

  • gili
    Posted at 09:50h, 26 June Reply

    Thanks for this.

    My question is more fundamental i guess: I use several share hosts like Dreamhost, Godaddy and so forth. Can i install WPMU on a shared hosting? Or do i need one of my own?

    Thanks,
    Gili

    • andrea
      Posted at 10:19h, 26 June Reply

      Technically you can, but you shouldn’t. There’s a WPMU-specific host in the banner ad above and also listed in the sidebar.

  • ray
    Posted at 18:05h, 14 July Reply

    this is very helpful. like this i can install the new mu-version in a subfolder, copy the database, replace the paths and test the entire thing without being stressed at all.
    great little hack.

  • Rob Parker
    Posted at 14:02h, 26 July Reply

    This is great, I got this problem too and its something that really should be made more obvious in the instructions. Thank you, I now have the install page all the other how-to’s seem to expect!
    .-= Rob Parker´s last blog ..Canada 2009 =-.

  • lisa
    Posted at 01:08h, 05 August Reply

    Interesting. I was actually able to semi-successfully install wpmu in a subfolder. Ran install, got a thumbs up, but cannot login. I get a 403 error saying I do not have access on this server. I’m a intermediate user, in that I learn from previous errors, but haven’t run up against this yet.

    I also used shared hosting and they said that installing mu wouldn’t be a problem.

  • Daniel Black
    Posted at 18:27h, 06 August Reply

    Many thanks. Just had a go of that myself. Wonder why the single WP can’t do this, too?
    .-= Daniel Black´s last blog ..People and me, we’re a hot and cold thing. =-.

  • Dave
    Posted at 20:02h, 10 August Reply

    This is great, thanks! I wonder if this is considered a ‘bug’ or if there is a useful reason for this to be in WordPress MU?

  • Minare
    Posted at 20:56h, 23 August Reply

    Thank you.

  • anomynous
    Posted at 01:36h, 26 August Reply

    THANK YOU!!!

    My error was a little different, it kept saying “Error establishing database connection” to which the standard response in the WP forums is “your database info isn’t correctly entered”.

    There’s nothing more frustrating that having people insist that something is wrong while you know it isn’t, instead of looking for the true problem. At least one person thinks open-minded. OK back to the development now.

  • Erin
    Posted at 11:45h, 26 August Reply

    Hi Andrea,

    Just posted a related issue at the MU forums regarding the opposite scenario (WPMU in root with WP in sub-directory).

    You mentioned that you could just flip the hack above, modifying the regular WP install script. But the code is a bit different in each, so maybe you could update this post with another similar solution for fools like me?

    I only mention it here because this post was returned in every search query I tried before posting at the forums. It might be nice if it had answers for both variants on the double installation question.

    Thanks.

    http://mu.wordpress.org/forums/topic/14081

    • andrea
      Posted at 12:28h, 26 August Reply

      After actually going and doing it: There isn’t any corresponding lines in single WordPress. 😀 Install it in a folder just like you would on any other site.

      As long as the folder name doesn’t match any permalinks on the WPMU site and you’re using a separate database, you’re good.

  • SpaceCowboy
    Posted at 02:01h, 01 September Reply

    I have successfully installed both in the root directory on a virtual server calling on “wordpress” and the other “wordpressmu” and have never had a problem.

    Are you saying you installed wordpressmu in a subdirectory of “wordpress”?

    Unless you have specified the same database name to be used for both installs, I can’t see where it would even get that far..

    The biggest issue I’ve seen and have read from others is with MySQL and MYPHPAdmin — hopefully in the future WordPress will mature to using a real database such as SQL or.. I would steer clear of using MyPHPAdmin and take the time out to learn how to manipulate the MySQL database from the command prompt.

    The drawback with using MyPHPAdmin is that is lags from the real information created in the MySQL database. The aforementioned is nothing more than a GUI (which explains why the makers of MyPHPAdmin installed a RELOAD or REFRESH Privileges button on the thing)… Also, when MyPHPAdmin goes out of sync for any given reason it can either duplicate entries or ignore them completely until you RELOAD PRIVILEGES from the database (MySQL)

  • Docpaul
    Posted at 13:09h, 01 September Reply

    I am pretty new to all this where eactly does these commands go can you give me an example?

  • Darren Taylor
    Posted at 10:24h, 09 September Reply

    Andrea, thanks for your help on the WordPress forum. I tried this and got the installation finished screen but at the bottom it had the following error:

    WordPress database error Table ‘gossywpmu.wp_blogs’ doesn’t exist for query SELECT * FROM wp_blogs WHERE domain = ‘gossy.us’ AND path = ‘//wordpress-mu/index.php/’ made by require, include, include_once, require_once, require_once WordPress database error Table ‘gossywpmu.wp_sitemeta’ doesn’t exist for query SELECT meta_value FROM wp_sitemeta WHERE site_id = 1 AND meta_key = ‘site_name’ made by require, include, include_once, require_once, require_once, get_current_site_name WordPress database error Table ‘gossywpmu.wp_blogs’ doesn’t exist for query SELECT blog_id FROM wp_blogs LIMIT 0,1 made by require, include, include_once, require_once, require_once WordPress database error Table ‘gossywpmu.wp_sitemeta’ doesn’t exist for query SELECT meta_value FROM wp_sitemeta WHERE meta_key = ‘wpmu_sitewide_plugins’ AND site_id = 1 made by require, include, include_once, require_once, get_site_option

    Now when I visit gossy.us/wordpress-mu/ I get an iis password error?

  • George
    Posted at 03:18h, 10 September Reply

    Awesome! You rock!

  • chicoespina
    Posted at 13:41h, 16 September Reply

    ERES DIOS!!!!

    • andrea
      Posted at 14:05h, 16 September Reply

      Muchos gracias! 😉

  • Bhavya Kamboj
    Posted at 06:53h, 03 October Reply

    I have shared hosting.
    Prob comes installingg in addon domain public_html/bhavyakamboj.com I simply extracted wpmu zip outside cgi-bin and installation works fine.

    But problem is that i get url like bhavyakamboj.com/wordpressmu/xxxxx but i wan the other blogs to be like bhavyakamboj.com/xxxx

    when i installed in cgi-bin, error message appears. bu in previous install all files are located in cgi-bin

    please tell how to install wordpress in the root or move from */wordpressmu/xxxx to */xxxx

    this is urgent. thanks for replying

    • andrea
      Posted at 16:54h, 04 October Reply

      Don’t install it in the CGI bin.

      Moving the files from within a folder and up a folder are basic ssh commands. If you extracted the zip on the server, your host (or google) can help you.

      What I do is extract the zip on the same level as public_html. I then rename that folder as public_old and rename the wordpressmu folder to public_html.

  • andrea
    Posted at 10:24h, 07 October Reply

    hi, i am with bluehost, i had a go at wpmu on a subfolder five time now, four blank screen right after the form and one past to login page, once clicked a Fatal error: Call to undefined function force_ssl_admin() /wp-login.php on line 15, and if tried with /wp-admin, Fatal error: Call to undefined function get_option()wp-admin/admin.php on line 22 – i followed exact permissions as chmod 777 and deleting .htacess , but must admit, , i’m not a linux/unix guru by any stretch of the imagination, but have not tried your procedure as yet… would kindly ask for help, if at all reachable. many thanks.

    • me
      Posted at 19:17h, 17 December Reply

      There is no help. NO ONE HAS THE ANSWER. I have been these forums for 2 weeks now trying to install wpmu. I follow EVERY direction to a t and NOTHING. I am so frustrated!!!!!!

      • me
        Posted at 15:54h, 18 December Reply

        AAAARGH!!!!!! That is how I felt when I wrote that last post. I got it figured out now. WPMU is soooo sensitive. I apologize. Thanks for the email Andrea. Turns out that all I had to do was delete the wordpress directory that I had extracted and redo it. =P

    • Ron
      Posted at 22:04h, 18 December Reply

      bluehost does not support WordPress MU installs, just WordPress installs.

  • Alfa
    Posted at 09:31h, 17 October Reply

    Hi

    I get trouble installing wpmu, when I open my website this message below appear on my web. please give me advice

    Installing WordPress µ

    Welcome to WordPress µ. I will help you install this software by asking you a few questions and asking that you change the permissions on a few directories so I can create configuration files and make a directory to store all your uploaded files.

    If you have installed the single-blog version of WordPress before, please note that the WordPress µ installer is different and trying to create the configuration file wp-config.php youself may result in a broken site. It’s much easier to use this installer to get the job done.

  • Miguel
    Posted at 05:17h, 19 October Reply

    Hi Andrea,

    The work you are doing for wpmu is excellent!
    I managed to install in a folder wpmu and install it but now when I try to visit the site I get the same install page. I have downloaded and installed buddypress and is active but i still dont see anything… is this the link I should use http://freepokermoneyonline.com/wpmu or the installation will redirect me to somewhere else? I still want to leave the home page as it is but maybe create a subdomain to work on wpmu. I hope you can help me! Thank you and best regards,
    Miguel

  • Miguel
    Posted at 13:49h, 19 October Reply

    Done! Its working now. You need to add to your instructions that once you have install MU you need to go back to the file wp-blog-header.php and remove the //. I have reinstall the entire MU now on a subdomain http://buddy.freepokermoneyonline.com and it seems to be working just fine. Im now moving into buddypress theme to see what can I do with it 🙂 Any suggestions for good free themes? Thank you!!!

  • J.Coles
    Posted at 12:42h, 30 October Reply

    Thank you so much, I’ve been trying to figure how to install Mu for days, a simple change of the original wp-config name was all it took! You rock!

  • WPMU installation: Round 2
    Posted at 20:11h, 05 November Reply

    […] folders into it. That’s it for now. Before I do anything else tomorrow I will be looking at Installing in a subfolder on Andrea’s very useful WPMU Tutorial web site which I discovered today thanks to her […]

  • Darren Littlejohn
    Posted at 22:33h, 19 November Reply

    OK this saved my arse. Thank you! But I found it quite by accident. Please post the solution to the wpmu.org forums as a sticky.

    -d

  • Raphael Roale
    Posted at 17:15h, 20 November Reply

    Perfect! I’ve spend 2 weeks in this problem. And 5 minutes reading your post to figure out solving this.

    Thanks.

  • Ron
    Posted at 01:07h, 22 November Reply

    @Darren – The WordPress MU forums are at http://mu.wordpress.org/forums/.

  • Mauro
    Posted at 13:37h, 26 November Reply

    Thanks a lot!

  • Gandung
    Posted at 23:27h, 04 December Reply

    Hello andrea,

    I can’t editing wp-blog-header.php according to your instructions “”then go to line 24, which is “}” and comment it out too. That’s the end of that particular command.””

    I’m using wp-mu 2.8.6, i have error massage “Parse error: syntax error, unexpected $end in /home/economy/public_html/forum/wp-blog-header.php on line 28”

    so, what should I do?

    • Ron
      Posted at 00:09h, 05 December Reply

      In 2.8.6, it’s line 15 that you comment not line 24 (which is an empty line).

      • Gandung
        Posted at 21:36h, 06 December Reply

        Thank of before, but i still have problem.

        When in the page index-install.php, I’ve followed all the instructions “What do I need?” but I still got a problem “One or more of the directories must be made writeable by the webserver. You will be reminded to reset the permissions at the end of the install. Please chmod 777 “directory-name” or chown that directory to the user the web server runs as (usually nobody, apache, or www-data) Refresh this page when you’re done!”

  • Maureen Otto
    Posted at 11:50h, 07 December Reply

    Hello Andrea:

    I was able to install fine. However, when trying to make a second blog it comes up as an 500 error. I have wordpress mu on other parts of my site- older versions.

    Could you please advise as to what to do to correct this issue. I cannot be the only one. I don’t think anyone else tried to create a 2nd. blog in these comments.

    Thank you!

    PS. My main wordpress blog is a single version and therefore I can use the www.

  • Melanie
    Posted at 19:23h, 08 December Reply

    This kind of helped. I did the commenting out like you said and it finally gave me the setup screen. But once I hit submit, I got the wp-config error again – still the Base is set as BASE.

    I made sure there was no htaccess and deleted the wp-config and tried again, but same error. Wp-config, btw, IS set to “/” not BASE, so I’m at a loss.

    Any extra help would be appreciated!

  • Melanie
    Posted at 20:35h, 08 December Reply

    Nevermind! I deleted all the files (save for my doctored wp-header.php file and reinstalled them. Then I refreshed my index.php file on my browser, re-entered the info, and it worked.

    Now let the fun begin! Thanks for your tutorial. Never would have figured this out otherwise.

  • John Bachir
    Posted at 02:46h, 10 December Reply

    Extraordinarily helpful. Thanks!

  • Chris Cera
    Posted at 20:50h, 12 December Reply

    Thank you!

  • russell
    Posted at 12:03h, 24 January Reply

    Till now I have always installed in to a subdirectory like q21digital.com/mu/goes-here then just scrubed my database for /mu/ and change the .htaccess and wp-config files in the new install.

    will try your way next time, thanks.

  • venu
    Posted at 21:18h, 25 January Reply

    We have done the development in a sub directory on our domain. now when we created an installation on the root to take the site live , we are running into couple of issues.
    1)
    When we try to log into wp-admin , it is getting redirected to the old subdirectory admin of the development site. However when i go through wp-login.php then i am able to go to the new installation admin but when i type http://www.xxxx.com/wp-admin it goes to the old admin.
    Where should i look to fix this issue

    2)We have the main site and a blog on the installation. We have created a subdomain blog.xxxxxx.com to point to the blog . We installed the domain mapping plug in and wanted to make the blog point to the sub domain. Can you please help as to how we do that? If we have a CNAME for the subdomain, where do we enter it or configure to point to the blog

    Would really appreciate some help in this regard. I am not that well versed with technicalities but can figure out if i have some pointers

    Regards

    venu

  • Bonny
    Posted at 15:22h, 02 February Reply

    I’m still struggling with this one. I’ve commented out what I *think* is the right line. Using the newest install of WPMU (2.9.1) has lines 23 and 27 ending with a }. If I comment out either line, I get:

    “There doesn’t seem to be a wp-config.php file. I need this before we can get started.”

    If I don’t comment out the line, I get the icky die() error.

    Help?

    • andrea
      Posted at 15:28h, 02 February Reply

      You no longer need to do this. If you’re getting the die error, you either filled out your config file beforehand (that’s a no-no, it tells you not to) or your db details are wrong.

      Just delete the wp-config.php file, visit your site in a browser, and run the installer again.

      • Bonny
        Posted at 19:07h, 02 February Reply

        Never touched the config file, and it has yet to get that far to create one.

        If I erase the comments, I just get the die () error again. I’ve re-created the databases I don’t know how many times now, they are solid – I’m assuming its because I’m installing in a folder off the root and I have several WP installs already elsewhere.

  • helpin
    Posted at 03:48h, 07 July Reply

    I am getting the url of my website is getting as mywebsite.com/mywebsite .But I am not getting the address like mywebsite.com for homepage .
    How can I change it on my cpanel after installing?

Post A Comment