Recent Topics

1 Aug 31, 2008 15:29    

My b2evolution Version: 2.4.x

I've not been able to get to my blog in the past couple of days. I originally thought it was a server problem so I hounded by hosting company for answers. The strange thing is, my 2 other websites (subdomains) on the same server worked fine, including one that is a WP blog for my wife. My hosting company finally got back to me and said the index.php file may be corrupt.

I then replaced it w/ the original file that came w/ the stable release but still nothing. Can someone please help? I'm not even sure what to even look for to begin. Is this really a b2 problem like my host says? I've posted the index.php file code here for you to review.

<?php
/**
 * This is the main public interface file.
 *
 * IF YOU ARE READING THIS IN YOUR WEB BROWSER, IT MEANS THAT PHP IS NOT PROPERLY INSTALLED
 * ON YOUR WEB SERVER. IF YOU DON'T KNOW WHAT THIS MEANS, CONTACT YOUR SERVER ADMINISTRATOR
 * OR YOUR HOSTING COMPANY.
 *
 * This file is NOT mandatory. You can delete it if you want.
 * You can also replace the contents of this file with contents similar to the contents
 * of a_stub.php, a_noskin.php, multiblogs.php, etc.
 *
 * b2evolution - {@link http://b2evolution.net/}
 * Released under GNU GPL License - {@link http://b2evolution.net/about/license.html}
 * @copyright (c)2003-2008 by Francois PLANQUE - {@link http://fplanque.net/}
 *
 * {@internal Note: we need at least one file in the main package}}
 *
 * @package main
 */

/**
 * First thing: Do the minimal initializations required for b2evo:
 */
require_once dirname(__FILE__).'/conf/_config.php';

require_once $inc_path.'_main.inc.php';

// Check if a specific blog has been requested in the URL:
param( 'blog', 'integer', '', true );

if( empty($blog) )
{ // No blog requested by URL param, let's try to match something in the URL
	$Debuglog->add( 'No blog param received, checking extra path...', 'detectblog' );

	$BlogCache = & get_Cache( 'BlogCache' );

	if( preg_match( '#^(.+?)index.php/([^/]+)#', $ReqHost.$ReqPath, $matches ) )
	{ // We have an URL blog name:
		$Debuglog->add( 'Found a potential URL blog name: '.$matches[2], 'detectblog' );
		if( (($Blog = & $BlogCache->get_by_urlname( $matches[2], false )) !== false) )
		{ // We found a matching blog:
			$blog = $Blog->ID;
		}
	}

	if( empty($blog) )
	{ // No blog identified by URL name, let's try to match the absolute URL
		if( preg_match( '#^(.+?)index.php#', $ReqHost.$ReqPath, $matches ) )
		{ // Remove what's not part of the absolute URL
			$ReqAbsUrl = $matches[1];
		}
		else
		{
			$ReqAbsUrl = $ReqHost.$ReqPath;
		}
		$Debuglog->add( 'Looking up absolute url : '.$ReqAbsUrl, 'detectblog' );

		if( (($Blog = & $BlogCache->get_by_url( $ReqAbsUrl, false )) !== false) )
		{ // We found a matching blog:
			$blog = $Blog->ID;
			$Debuglog->add( 'Found matching blog: '.$blog, 'detectblog' );
		}
	}

	if( empty($blog) )
	{ // Still no blog requested, use default
		$blog = $Settings->get('default_blog_ID');
		if( (($Blog = & $BlogCache->get_by_ID( $blog, false, false )) !== false) )
		{ // We found a matching blog:
			$Debuglog->add( 'Using default blog '.$blog, 'detectblog' );
		}
		else
		{
			$blog = NULL;
		}
	}

	if( empty($blog) )
	{ // No specific blog to be displayed:
		// we are going to display the default page:
		require dirname(__FILE__).'/default.php';
		exit();
	}
}

// A blog has been requested... Let's set a few default params:

# You could *force* a specific skin here with this setting:
# $skin = 'basic';

# This setting retricts posts to those published, thus hiding drafts.
# You should not have to change this.
$show_statuses = array();

# Here you can set a limit before which posts will be ignored
# You can use a unix timestamp value or 'now' which will hide all posts in the past
$timestamp_min = '';

# Here you can set a limit after which posts will be ignored
# You can use a unix timestamp value or 'now' which will hide all posts in the future
$timestamp_max = 'now';

# Additionnaly, you can set other values (see URL params in the manual)...
# $order = 'ASC'; // This for example would display the blog in chronological order...

// That's it, now let b2evolution do the rest! :)
require $inc_path.'_blog_main.inc.php';

?>

Here's the b2 url that's not working: www.savethelegs.com

I appreciate any help. Thanks in advance.

Jack

2 Aug 31, 2008 16:03

What did you do just before it stopped working?

¥

3 Aug 31, 2008 16:10

I was in the middle of a post. As soon as I hit "save" my site went down giving me the standard website cannot be found page. But it wasn't until later that when I went to my url, it was just a blank white screen, not even the page cannot be found page. It's very strange. I have not done anything to the code for the past few weeks (and even that was so minor, just adding a gif image to the sidebar) and has worked flawlessly until Friday evening.

Any thoughts? Thanks again in advance.

4 Aug 31, 2008 16:12

ok, try this, crack open /conf/_config.php and add this line just below the opening <?php

ini_set('display_errors', 'on' );

Then revisit your page and see if you get any error messages

¥

5 Aug 31, 2008 16:43

Just did it, it shows this now:

Warning: require_once(/home/jack376/public_html/conf/_basic_config.php) [function.require-once]: failed to open stream: Permission denied in /home/jack376/public_html/conf/_config.php on line 21

Fatal error: require_once() [function.require]: Failed opening required '/home/jack376/public_html/conf/_basic_config.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/jack376/public_html/conf/_config.php on line 21

Thanks Yabba.

6 Aug 31, 2008 16:55

Check the permissions on that file ( conf/_basic_config.php ), and possibly the ownership ..... and I'd also be taking a look at the contents of that file as well to make sure they haven't been changed ;)

¥

7 Aug 31, 2008 23:30

Hi there,

I'm not sure what even to look at. The username, password and mysql database names are are consistent. plus, no one would have changed it other than me and i didn't.

I also tried to update the entire /conf directory with a backup that I did a while ago, still nothing coming up.

I replaced the _config.php file w/ the extra line code you suggested for now. Do you or any other person have any other suggestions? Should I just consider re-installing b2?

8 Sep 01, 2008 00:29

Also, I just re uploaded the main directory files (index.php, etc) as well as the files in the /conf directory from a back up I did a couple of weeks ago. Nothing happens as well. I'm beginning to think this is not b2 related. Could there be a server setting that may affect this? Keep in mind that 2 other sites are working on this same server, one of which is a WP install.

Thanks in advance for the suggestions.

9 Sep 01, 2008 03:08

It looks like the _basic_config.php file is not readable by your webserver. You should probably set the file to be owned by your user and have permissions like 644 (Owner: read/write, Group: read, Other: read). After you change the permissions, the unix permissions string should look something like like -rw-r--r--

I have noticed on my provider that sometimes the user that the apache webserver runs php as sometimes changes to something like nobody:nobody rather than my user (very annoying). Something like that may have changed on your site.

10 Sep 01, 2008 04:02

Ian! Thank you very much! That was exactly it! I changed the permissions and all went back to normal. It's very weird as well because I never touched the permissions in the first place. Is this something that the server does by itself sometimes or maybe the hosting company was messing with it?

Thanks also to Yabba for helping me out at the beginning. I appreciate it!

11 Sep 01, 2008 17:14

Just as I thought all was well, I am having trouble uploading images from the "files" button to my server.

It gives this message:

Warning: move_uploaded_file(/home/jack376/public_html/media/blogs/a/cycling/uschamp.jpg) [function.move-uploaded-file]: failed to open stream: Permission denied in /home/jack376/public_html/inc/files/upload.ctrl.php on line 334

Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move '/tmp/phpDVhIJx' to '/home/jack376/public_html/media/blogs/a/cycling/uschamp.jpg' in /home/jack376/public_html/inc/files/upload.ctrl.php on line 334

Warning: Cannot modify header information - headers already sent by (output started at /home/jack376/public_html/inc/files/upload.ctrl.php:334) in /home/jack376/public_html/inc/_core/_template.funcs.php on line 133

Warning: Cannot modify header information - headers already sent by (output started at /home/jack376/public_html/inc/files/upload.ctrl.php:334) in /home/jack376/public_html/inc/_core/_template.funcs.php on line 136

Is this a permissions problem as well? If so, which directory and/or file do I change?

The upload.ctrl.php and the _template.funcs.php have 644 on it. Should this be different?

I can see the existing images in the folder but just can't upload.

Thanks in advance for any help.

12 Sep 01, 2008 17:53

you should have a write permission on the media folder.

13 Sep 01, 2008 18:00

The folder is 777 and the sub directory of the blog is 775 so I believe it is writable. Should this be something else?

Thanks in advance.

14 Sep 01, 2008 21:15

If safe mode is enabled then yer screwed, if modsuphp is enabled then you can't use 777 .... ish.

¥

15 Sep 01, 2008 21:30

I checked my php configurations through cpanel and it says safe mode is off. I'm assuming this is where you check it? Forgive, still a rookie with this.

What is modsuphp?

Thank you.

16 Sep 02, 2008 10:52

That's certainly one place you can check. Modsuphp is a server mod that allows php to run as your user instead of nobody|apache and means that you can lower permissions on files and folders, typically to 0755 ( although a lot of mine are 0700 ).

If you were able to upload images before then I'd be asking your hosts what configuration changes they've made recently ;)

¥

17 Sep 03, 2008 23:45

I just finally got word from my host about what happened. Apparently, there was an attack and they had to change a bunch of configurations, one of which is the disabling of the php mail function. They tell me I should use SMTP, will look at swift smtp.

In regards to modsuphp, it's disabled. What does that mean in terms of what I need to set my permissions to?

Thanks again.

18 Sep 04, 2008 17:16

If modsuphp was enabled then they wouldn't have gotten bitch slapped by a hacker and all your files could be reduced to minimal permissions.

Personally I wouldn't even consider a server that wasn't running it.

Without suphp you either need to open yourself to the world by changing your perms to 0777 or, if apache owns the file/folder then you can drop your perms to 0755, but it's a pretty pointless exercise.

¥

19 Sep 05, 2008 05:06

I asked my they disabled modsuphp, they said they were having issues with the server so they disabled it. They are aware of the security risks but have alternative options. Should I be worried?

20 Sep 05, 2008 05:17

No need to worry, most shared hosts have modsuphp disabled.

Good luck


Form is loading...