Recent Topics

1 Nov 08, 2010 06:13    

I just did a brand new fresh install of Beta 4.0.1, not an upgrade. Looked like everything installed correctly, but I am getting several errors and I could not find them anywhere else on the forums.

The new Blog is;
http://kayalton.com/blog1.php

And if you select any of the tabs (About This System or About Blog A) You get an error message;

An unexpected error has occurred!
If this error persists, please report it to the administrator.

Additional information about this error:
Can't identify current .php script name in PHP_SELF.

This error also shows up when you try to leave a comment on a post.

Is this a bug or is this an install issue?

Thanks,
Brian

2 Nov 09, 2010 13:14

I found a similar problem, but with a stub file which had a dot in the middle of the name, like "v1.0.php", I corrected by dropping the dot, but I see your problem is not exactly the same, since your stub file "blog1.php" has no dot before the extension. You could enable "debugging" by changing

$debug = 1;

in conf/_advanced.php to what you have in PHP_SELF and report back here

3 Dec 15, 2010 00:22

Hi,

I've the same issue, here, using the latest 4.0.2 beta release. I get only this short output with debug set to 1:

Can't identify current .php script name in PHP_SELF.

Backtrace:

1. debug_die( "Can't identify current .php script name in PHP_SELF." )
File: /inc/_init_hit.inc.php on line 109
2. require( "/inc/_init_hit.inc.php" )
File: /inc/_main.inc.php on line 93
3. require_once( "/inc/_main.inc.php" )
File: /index.php on line 27

Ignored last: 1

This occures when I try to use an extended blog name like http://domain.net/index.php/blog_a

I've a similar issue when I clic on a category, to display posts associated to a category.

4 Dec 27, 2010 09:38

Any new info on this? I upgraded to the 4.0.3 stable and I'm getting this
error message all over the place.

One interesting thing I noticed is that on the dashboard it says that this
version is a beta and shouldn't be used in production.

EDIT:

Backtrace:

1. debug_die( "Can't identify current .php script name in PHP_SELF." )
File: /home/zoltane/web/blogs/inc/_init_hit.inc.php on line 110

2. require( "/home/zoltane/web/blogs/inc/_init_hit.inc.php" )
File: /home/zoltane/web/blogs/inc/_main.inc.php on line 93

3. require_once( "/home/zoltane/web/blogs/inc/_main.inc.php" )
File: /home/zoltane/web/blogs/inc/_blog_main.inc.php on line 32

4. require( "/home/zoltane/web/blogs/inc/_blog_main.inc.php" )
File: /home/zoltane/web/blogs/blog.php on line 43

6 Dec 27, 2010 19:57

I saw this error on some PHP 4.x installs too. Upgrade to PHP 5 fixed it.

7 Dec 29, 2010 21:43

sam2kb wrote:

I saw this error on some PHP 4.x installs too. Upgrade to PHP 5 fixed it.

Well, PHP 4 is dead. It's not surprising that the b2evolution developers don't bother with it anymore.

8 Jan 11, 2011 12:50

I keep seeing this error when trying to access a file that has a DOT (.) in its name besides the last .php; I had the problem with a stub file, but I see it hapening to people trying to access old-style atom or rss feeds like /xmlsrv/atom.comments.php?blog=1 and /xmlsrv/rss2.comments.php?blog=5

The problems ocurrs in inc/_init_hit.inc.php line 110 or so, where the regular expresion doesn't allow for dots inside filenames. This fixes it:

bzr diff -r last:2 inc/_init_hit.inc.php
=== modified file 'inc/_init_hit.inc.php'
--- inc/_init_hit.inc.php       2010-10-01 07:50:06 +0000
+++ inc/_init_hit.inc.php       2011-01-11 11:42:27 +0000
@@ -105,7 +105,7 @@
 $pagenow = $pagenow[0];
 */
 // find precisely the first occurrence of something.php in PHP_SELF, extract that and ignore any extra path.
-if( ! preg_match( '#/([A-Za-z0-9_\-]+\.php[0-9]?)#', $_SERVER['PHP_SELF'], $matches ))
+if( ! preg_match( '#/([A-Za-z0-9_\-.]+\.php[0-9]?)#', $_SERVER['PHP_SELF'], $matches ))
 {
        debug_die('Can\'t identify current .php script name in PHP_SELF.');
 }
@@ -230,4 +230,4 @@
 /*
  * $Log: _init_hit.inc.php,v $
  */
-?>
\ No newline at end of file
+?>

The only change is really adding a dot (.) to the regular expression inside the brackets '[]' in preg_match().

Cheers

9 Jan 11, 2011 18:47

Thanks for the patch.
Added to CVS

10 Jan 15, 2011 06:24

bkant wrote:

I've a similar issue when I clic on a category, to display posts associated to a category.

I'm getting the same thing. I did add the patch above but didn't help. Only run into this where the 4.0.3 installation is running on php4.

I have another 4.0.3 installation running on a different host with php5 and it works fine.

11 Jan 15, 2011 19:52

I know this is not an excuse, but PHP4 is very old and not supported by developers any more (I mean PHP developers). It's time to switch to PHP5.

Compare the values of $_SERVER['PHP_SELF'] var in both PHP4 and PHP5. Ideally they should be the same.

12 Jan 28, 2011 23:35

@sam2kb: Issue is many providers only have PHP4... And we can't install PHP5 instead. So we have to do with what we have, and usually it's with PHP4.

I'm facing the issue myself and I'm looking for a way to fix it whitout have to move to another provider.


   1. debug_die(  "Can't identify current .php script name in PHP_SELF.", "/cnc/" )
      File: /homez.152/s.../inc/_init_hit.inc.php on line 110
   2. require( "/homez.152/s.../inc/_init_hit.inc.php" )
      File: /homez.152/s.../inc/_main.inc.php on line 93
   3. require_once( "/homez.152/spaggiars/www/inc/_main.inc.php" )
      File: /homez.152/s.../index.php on line 27

13 Feb 23, 2011 10:41

fixed it with


if( ! preg_match( '#/([A-Za-z0-9_\-]+\.php[0-9]?)#', $_SERVER['PHP_SELF'], $matches ))
	if( ! preg_match( '#/([A-Za-z0-9_\-]+\.php[0-9]?)#', $ReqURI, $matches ))
		debug_die('Can\'t identify current .php script name in PHP_SELF.');


on Line 109 in inc/_init_hit.inc.php

15 Mar 16, 2011 02:38

@jmspaggi : you can probably ask your current provider to move to PHP5. Most of them have servers with PHP5, they just don't tell you until you ask.

16 Mar 16, 2011 22:21

@b1gag3 and @sam2kb: I think the real fix would be to use SCRIPT_NAME and not PHP_SELF here.
The $ReqURI part is "duplicated" and catches the SCRIPT_NAME part.

@b1gag3: I guess that you are using a (Fast-)CGI setup probably?!

Anyway, just came here, because I got a merge conflict, where I have fixed this with using SCRIPT_NAME before already.


Form is loading...