Giving WordPress Its Own Directory ERROR

Status
Not open for further replies.

thegoldenpuffle61

New Member
Messages
19
Reaction score
0
Points
0
I tried giving wordpress it's own directory (I followed here: http://codex.wordpress.org/Giving_WordPress_Its_Own_Directory ) but this came up:

Warning: require(,/wordpress/wp-blog-header.php) [function.require]: failed to open stream: No such file or directory in /home/hannahxd/public_html/index.php on line 17

Warning: require(,/wordpress/wp-blog-header.php) [function.require]: failed to open stream: No such file or directory in /home/hannahxd/public_html/index.php on line 17

Fatal error: require() [function.require]: Failed opening required ',/wordpress/wp-blog-header.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/hannahxd/public_html/index.php on line 17
 

carl6969

Community Support Team
Community Support
Messages
6,874
Reaction score
206
Points
63
Where did you place the wordpress directory?
It should be in the /public_html directory.
Example: /public_html/wordpress
 

thegoldenpuffle61

New Member
Messages
19
Reaction score
0
Points
0
I'm pretty sure I did.
Heres what it looks like in Filezilla:
ve4vao.jpg
 

carl6969

Community Support Team
Community Support
Messages
6,874
Reaction score
206
Points
63
Is your wordpress directory named "wordpress" or "blog"?
It appears to me that wordpress is looking for a directory named "wordpress".
And if I am reading the information you posted from your FTP correctly there is only a "blog" directory in public_html .
 

bhupendra2895

New Member
Messages
554
Reaction score
20
Points
0
Where is your wp-admin directory?Is it in /home/<your user name>/public_html/blog/ or it is in /home/<your user name>/public_html/blog/wordpress
Well wherever it is all you need to do to is to tell index.php in your public_html to require index.php of wordpress installation.For this you need to update the file_path in require_once function.
 

thegoldenpuffle61

New Member
Messages
19
Reaction score
0
Points
0
bhupendra2895, How do I do that exactly? This is my first time building a website.
And my wp-admin directory is in /public_html/wordpress (previously called 'blog')/wp-admin/
 
Last edited:

bhupendra2895

New Member
Messages
554
Reaction score
20
Points
0
Copy the index.php from public_html/wordpress/ and paste it in public_html folder.Now you need to update the file path in all require_once functions.For example if a path is
PHP:
require_once('wp-includes/something.php')
Change it to
PHP:
require_once('wordpress/wp-includes/something.php')
 

thegoldenpuffle61

New Member
Messages
19
Reaction score
0
Points
0
I did not see a "require_once" file. I tried to put it into "require;,/wordpress/wp-blog-header.php" but that did not work.

(taylorswifties.co.cc to see the error message)

Here is what is in index.php:
<?php
/**
* Front to the WordPress application. This file doesn't do

anything, but loads
* wp-blog-header.php which does and tells WordPress to load

the theme.
*
* @package WordPress
*/

/**
* Tells WordPress to load the WordPress theme and output it.
*
* @var bool
*/
define('WP_USE_THEMES', true);

/** Loads the WordPress Environment and Template */
require_once('wordpress/wp-includes/something.php')
?>
 
Last edited:

bhupendra2895

New Member
Messages
554
Reaction score
20
Points
0
Come on why you put something.php there something.php is some thing, means an example.Change your index.php to this.
PHP:
<?php
*
* @package WordPress
*/
/**
* Tells WordPress to load the
WordPress theme and output it.
*
* @var bool
*/
define('WP_USE_THEMES', true);
/** Loads the WordPress
Environment and Template */
require_once('wordpress/wp-blog-
header.php')
?>
 

calistoy

Free Support Volunteer
Community Support
Messages
5,602
Reaction score
87
Points
48
Replace the bottom require_once with this instead:

require_once('./wordpress/wp-blog-header.php')
 

leafypiggy

Manager of Pens and Office Supplies
Staff member
Messages
3,819
Reaction score
163
Points
63
Since I'm assuming you can't access your wp admin panel, use PHPmyAdmin to get to your wordpress tables, and pull up options (default: wp_options)

There should be a field for installation directory, make sure that it is set to where you have wp-admin, wp-content, and wp-includes, etc.
 

thegoldenpuffle61

New Member
Messages
19
Reaction score
0
Points
0
Okay I've tried both of you guys' advice (not leafypiggy's yet), but nothing seems to work *pulls hair out*
When I check the site, it says:
"Parse error: syntax error, unexpected '*' in /home/hannahxd/public_html/index.php on line 2"
 
Last edited:

bhupendra2895

New Member
Messages
554
Reaction score
20
Points
0
Change your index.php to this.
PHP:
<?php
/*
* @package WordPress
*/
/**
* Tells WordPress to load the
WordPress theme and output it.
*
* @var bool
*/
define('WP_USE_THEMES', true);
/** Loads the WordPress
Environment and Template */
require_once('wordpress/wp-blog-
header.php')
?>

I guess you have no knowledge of php?
 
Last edited:

thegoldenpuffle61

New Member
Messages
19
Reaction score
0
Points
0
Hate to say it, but no knowledge whatsoever. That's why I came for help here in the first place.
The error message is still the same. :/ I don't know what to do next.....
 

bhupendra2895

New Member
Messages
554
Reaction score
20
Points
0
Hi this is my index.php file and my wordpress is installed in the same location as yours, so it should work
PHP:
<?php
/**
 * Front to the WordPress application. This file doesn't do anything, but loads
 * wp-blog-header.php which does and tells WordPress to load the theme.
 *
 * @package WordPress
 */

/**
 * Tells WordPress to load the WordPress theme and output it.
 *
 * @var bool
 */
define('WP_USE_THEMES', true);

/** Loads the WordPress Environment and Template */
require('wordpress/wp-blog-header.php');
?>

Also if you want to use cool urls then put this in your .htaccess at public_html folder.For doing this you need to enable viewing of hidden file.
Code:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /wordpress/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /wordpress/index.php [L]
</IfModule>
 

thegoldenpuffle61

New Member
Messages
19
Reaction score
0
Points
0
Not working. Same error:
Parse error: syntax error, unexpected '*' in /home/hannahxd/public_html/index.php on line 2
Does anyone know why this error pops up?
 
Last edited:

techairlines

x10 Flyer
Community Support
Messages
2,867
Reaction score
165
Points
63
Not working. Same error:
Parse error: syntax error, unexpected '*' in /home/hannahxd/public_html/index.php on line 2
Does anyone know why this error pops up?

That means you have a unexpected asterisk in index.php.

Make sure your file starts like this:
PHP:
<?php
/**
 * Front to the WordPress application. This file doesn't do anything, but loads
 * wp-blog-header.php which does and tells WordPress to load the theme.
 *
 * @package WordPress
 */

You might have deleted the slash on line 2. The slash indicates its a PHP comment and not to attempt to execute.
 

bhupendra2895

New Member
Messages
554
Reaction score
20
Points
0
In that case please attach your /home/hannahxd/public_html/index.php file with your post if you can or post the contents of it.Because if you put what I posted above in home/hannahxd/public_html/index.php the error won't generate.
 

thegoldenpuffle61

New Member
Messages
19
Reaction score
0
Points
0
It is:
<?php
*
* @package WordPress
*/
/**
* Tells WordPress to load the
WordPress theme and output it.
*
* @var bool
*/
define('WP_USE_THEMES', true);
/** Loads the WordPress
Environment and Template */
require_once('wordpress/wp-blog-
header.php')
?>
 

techairlines

x10 Flyer
Community Support
Messages
2,867
Reaction score
165
Points
63
Yup. Please add a / in front of the asterisk on line 2 and the error will go away.

You can just copy the following and replace your entire file with this:

PHP:
<?php
/**
 * Front to the WordPress application. This file doesn't do anything, but loads
 * wp-blog-header.php which does and tells WordPress to load the theme.
 *
 * @package WordPress
 */

/**
 * Tells WordPress to load the WordPress theme and output it.
 *
 * @var bool
 */
define('WP_USE_THEMES', true);

/** Loads the WordPress Environment and Template */
require('wordpress/wp-blog-header.php');
?>
 
Last edited:
Status
Not open for further replies.
Top