PDA

View Full Version : Chdir


Kamui Shirou
02-28-2003, 01:59 PM
HI folks. I do have little problems with this hack.
https://vborg.vbsupport.ru/showthread.php?s=&threadid=37134&perpage=15&highlight=login&display=&pagenumber=10

I do not having probs with get it working on my server ( where the forum is placed) but get it working on another server where the site is placed. It has sometihing to do with the various directions.

on the server, where the board is, this code workz perfectly (i have to include the global.php and set the chdir)

<?php
chdir("/is/htdocs/28554/www.mangaboard.com/forums/");
require('global.php');
?>

But with the same settings placed on the other server the code runs into this error message

Warning: ChDir: No such file or directory (errno 2) in /homepages/45/d72897891/htdocs/vashXT/laststyle2/index2.php on line 2

Fatal error: Failed opening required 'global.php' (include_path='.:/usr/local/lib/php') in /homepages/45/d72897891/htdocs/vashXT/laststyle2/index2.php on line 3

Hope you are able to help. thx

amykhar
02-28-2003, 02:03 PM
The chdir on the other server needs to be
chdir("/homepages/45/d72897891/htdocs/vashXT/laststyle2/forums/");

or something pretty darn similar depending on the subdirectory your forums are in.

Kamui Shirou
02-28-2003, 02:48 PM
oh you missunderstood me.
the site and the forums are on different servers.
the full path to the forum is
is/htdocs/28554/www.mangaboard.com/forums/
and the path to the site is something like
/homepages/45/d72897891/htdocs/vashXT/laststyle2/

and that causes the problems

Sebastian
03-01-2003, 07:25 AM
so you are installing that hack twice on two different servers? The path is not correct, did you double check it?

You don't have to use full path, if your forums is located in the webroot like: /main root/forums/

then you could do:


chdir("../forums/");
require("global.php");


you cannot have a .php file in the line of chdir (change directory)..

I see you have index.php in chdir();

Kamui Shirou
03-01-2003, 12:39 PM
nope. i only install this hack one time. but on different servers.
ah. just have a look.
i uploaded the page on the server the forum is placed on for testing:
http://www.mangaboard.com/test/animeshock/index2.php

nad here is the tets page on the server where the main page is normally placed:
http://www.shamanking.org/nokx/laststyle2/index2.php

Darren Lewis
03-02-2003, 02:16 PM
Hi, you can't use chdir if the directories you're changing from and to are on different physical servers. To use the hack on different servers would require a complete rewrite so that it didn't use the vbulletin global.php file.

It would work using the full server path, if you had something like
home/htdocs/www.site1.com
home/htdocs/www.site2.com
as the directories are on the same server.