I have moved a site from one server to a new one. On the new server, the web site is not working at all. I believe the problem lies within an include page that has the following in it:
/*global $_root;
$_root=$_SERVER['DOCUMENT_ROOT'];*/
define('_ROOT',$_SERVER['DOCUMENT_ROOT']);
global $html_root_offset;
$html_root_offset="";
Specifically, I think it is the $_server line but I really do not have much knowledge in this area.
Does anyone have any ideas of how this might be causing the site not to work? I have changed nothing since the old server location and all worked just fine there.
Well I can access the index.php page ok. It is built on a CMS system (a quite old one) which we will be moving into a newer one shortly. Anyways, the links on the page are all driven from within the cms system. When I select a page, I get a 404 - Page not Found.
System 404. Unfortunately I cannot gain access to anything web side within the cms most likely due to that _server setting. At least that is what I am thinking is causing the issue.
You say you can access the index.php, and select pages. I assume ‘select a page’ means clicking a link? What does that link look like?
And even if you can’t access anything on the new site (from the front end), surely you can check the admin part for settings on the old site? Or check the scripts for a config.php or something?
Unfortunately, this system does not have settings like that in the backend available to change. Everything is within lib files. I have done a search looking for where that variable is set but there is none.
From what I have read through google. sometimes $_server settings are not available on certain servers but I have also read these can be changed. I just do not know where to change it on the server to allow $_server to have function.
Well that is where I go back to the $_Server variable. From the PHP site:
$_SERVER is an array containing information such as headers, paths, and script locations. The entries in this array are created by the web server. There is no guarantee that every web server will provide any of these; servers may omit some, or provide others not listed here.
Well thats simple enough to check. Stick “echo $_SERVER[‘DOCUMENT_ROOT’];” into index.php, and run it. If it spits out the document root, your problem is not in the server variable.