Welcome to Geeklog, Anonymous Friday, November 01 2024 @ 01:36 pm EDT
Geeklog Forums
server migration causes strange forum errors
Status: offline
thelusiv
Forum User
Junior
Registered: 05/21/04
Posts: 23
Location:Clemson, SC
I recently set up a site for a someone on my Linux server and am now moving it to another web server. I'm not sure what it runs (though I think it's some type of Unix).
Everything works except the forums - I get strange errors when trying to post a topic or when trying to save forum settings. It tries to submit the settings form to an address like "http://my.publicaddress.com/path/to/geeklog/public_html/admin/plugins/forum/settings.php" instead of one like "http://my.publicaddress.com/admin/plugins/forum/settings.php" as it did on my Linux server. Similar things hapen when trying to post a new topic or reply in the forums.
I am wondering what causes this...I suspect it to be PHP settings. register_globals is probably off, and I don't have any way to control that (yet, contacting server owner now). Does this sound right or have I somehow misconfigured my Geeklog forums in the process of migration?
Everything works except the forums - I get strange errors when trying to post a topic or when trying to save forum settings. It tries to submit the settings form to an address like "http://my.publicaddress.com/path/to/geeklog/public_html/admin/plugins/forum/settings.php" instead of one like "http://my.publicaddress.com/admin/plugins/forum/settings.php" as it did on my Linux server. Similar things hapen when trying to post a new topic or reply in the forums.
I am wondering what causes this...I suspect it to be PHP settings. register_globals is probably off, and I don't have any way to control that (yet, contacting server owner now). Does this sound right or have I somehow misconfigured my Geeklog forums in the process of migration?
7
6
Quote
Status: offline
Dirk
Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
Quote by thelusiv: register_globals is probably off, and I don't have any way to control that
Go to http://yoursite/admin/moderation.php. If register_globals is off, you'll get a warning message on that page.
bye, Dirk
7
8
Quote
Status: offline
thelusiv
Forum User
Junior
Registered: 05/21/04
Posts: 23
Location:Clemson, SC
drat! I just realized I posted this in the wrong place. Sorry about that...please feel free to move it.
I checked the moderation page and it doesn't complain about register_globals. I did wonder why the forum was the only thing that didn't work, if that was the case.
I have also confirmed that the entire file set and database on the new server work properly when copied back to the old one.
I'm kinda lost as to what the problem is...it doesn't help any that I don't have shell access to this server, and for some reason their FTP server doesn't recognize chmod...
I am still waiting for an e-mail response from the server administrators at the university but I may not be getting one until Monday. Thanks for your help, though. Any more suggestions you have are welcome...
I checked the moderation page and it doesn't complain about register_globals. I did wonder why the forum was the only thing that didn't work, if that was the case.
I have also confirmed that the entire file set and database on the new server work properly when copied back to the old one.
I'm kinda lost as to what the problem is...it doesn't help any that I don't have shell access to this server, and for some reason their FTP server doesn't recognize chmod...
I am still waiting for an e-mail response from the server administrators at the university but I may not be getting one until Monday. Thanks for your help, though. Any more suggestions you have are welcome...
6
12
Quote
Status: offline
thelusiv
Forum User
Junior
Registered: 05/21/04
Posts: 23
Location:Clemson, SC
I did a little digging and figured out that this was due to the server in question having an old version of PHP (4.3.2). This version of PHP has a bug that causes it to report $PHP_SELF incorrectly, thus causing errors in the forum (the forum seems to be the only part of this particular Geeklog site that uses $PHP_SELF). I wrote a function to work around this and stuck it in /path/to/geeklog/public_html/admin/plugins/forum/gf_functions.php and /path/to/geeklog/public_html/lib-common.php. Here it is, for anyone else who ends up with this problem:
//function for working around a $PHP_SELF bug in some versions of PHP
function fix_PHP_SELF( $_PHP_SELF, $debug = 0 ) {
global $_CONF;
if ( $debug == 1 ) echo 'original PHP_SELF: ' . $_PHP_SELF . '<br>';
$path = $_CONF['path'];
// chop the path a bit here if necessary
// $path = str_replace( "/new/", "", $path );
$_PHP_SELF = str_replace( $path, "", $_PHP_SELF );
if ( $debug == 1 ) echo 'path to geeklog: ' . $_CONF['path']
. '<br>modified path: ' . $path
. '<br>modified PHP_SELF: ' . $_PHP_SELF . '<br>';
return $_PHP_SELF;
}
Now add a line in all the files that use $PHP_SELF thus:
If any of you Geeklog experts have a suggestion on a better way of writing this please let me know. I am trying to convince the server admins to upgrade PHP...we'll see how that goes...
Text Formatted Code
//function for working around a $PHP_SELF bug in some versions of PHP
function fix_PHP_SELF( $_PHP_SELF, $debug = 0 ) {
global $_CONF;
if ( $debug == 1 ) echo 'original PHP_SELF: ' . $_PHP_SELF . '<br>';
$path = $_CONF['path'];
// chop the path a bit here if necessary
// $path = str_replace( "/new/", "", $path );
$_PHP_SELF = str_replace( $path, "", $_PHP_SELF );
if ( $debug == 1 ) echo 'path to geeklog: ' . $_CONF['path']
. '<br>modified path: ' . $path
. '<br>modified PHP_SELF: ' . $_PHP_SELF . '<br>';
return $_PHP_SELF;
}
Now add a line in all the files that use $PHP_SELF thus:
Text Formatted Code
$PHP_SELF = fix_PHP_SELF($PHP_SELF);If any of you Geeklog experts have a suggestion on a better way of writing this please let me know. I am trying to convince the server admins to upgrade PHP...we'll see how that goes...
9
7
Quote
All times are EDT. The time is now 01:36 pm.
- Normal Topic
- Sticky Topic
- Locked Topic
- New Post
- Sticky Topic W/ New Post
- Locked Topic W/ New Post
- View Anonymous Posts
- Able to post
- Filtered HTML Allowed
- Censored Content