Installing WordPress in a subdirectory

I am trying to install wordpress into a subdirectory of a website.

I simply want to build the client's new site in this subdirectory, so a separate and new WP install in this subdirectory, and then when complete, delete the current (old) site and move the new wp website from the subdirectory to the root.

I've uploaded the wordpress into the subdirectory, I've completed the wp-config file, created my database... and I have double-checked and triple checked that my database name, user and password are the same in my config file as in my database.

Reading the codex it appears I need to change the path in the index.php file, which I've done:

require( dirname( __FILE__ ) . '/subdirectory_name/index.php' 

when I go to the subdirectory to complete the WP install I get the following error message:

Fatal error: require() [function.require]: Failed opening required '/home/user/public_html/subdirectory_name/index.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/user/public_html/subdirectory_name/index.php on line 17

Any suggestions as to what I am doing wrong?

Does it matter that the client's current site is a Joomla site? Help is very much appreciated!

Topic installation Wordpress

Category Web


Apparently when zipping my wp folder and expanding it through cpanel>file manager, something wasn't working.

If I didn't zip my wp folder and simply uploaded it to the directory, the WP install in the subdirectory worked perfectly.


I had a similar situation. Have you have checked that in Dashboard>Settings>General Settings Wordpress Address(URL) and Site Address(URL) are the same. That is where my issue was.


Just create a sub directory in your domain root with somename "dev" and put your wordpress files under this directory. Now if your domain name is http://example.com and you have setup under dev directory .

Just hit http://example.com/dev, It will automatically show you install.php to install your wordpress in the current directory.


To build a separate site in the domainname.com/subdirectory_name directory while leaving the current site live at domainname.com, you would NOT want to modify the index.php file in the root. Your development site address is simply domainname.com/subdirectory_name

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.