admin管理员组文章数量:1122846
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!
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!
Share Improve this question edited Jul 30, 2014 at 4:02 markratledge 8,7356 gold badges40 silver badges62 bronze badges asked Jul 1, 2014 at 3:37 ccbarccbar 151 gold badge2 silver badges12 bronze badges 1- Create a sub domain if you can. Like wp.example.com – Amirking Commented Oct 30, 2019 at 1:51
5 Answers
Reset to default 0To 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
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.
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.
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.
The best explanation with examples is in WordPress documents Giving WordPress Its Own Directory
本文标签: installationInstalling WordPress in a subdirectory
版权声明:本文标题:installation - Installing WordPress in a subdirectory 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736282106a1926535.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论