如何使用PHP为localhost设置SITE变量

A contract programmer altered our site by adding a SITE variable and now when running it on local host it gives the following error:

"NetworkError: 403 Forbidden - http://localhost/test2016/%3C?=SITE?%3Ecss/screen_layout_medium.css"

We do not know how to overcome this problem. We have tried all 5 options below.

defined('DS') ? null : define('DS', DIRECTORY_SEPARATOR);

defined('SITE') ? null : define('SITE', "");
defined('SITE') ? null : define('SITE', __DIR__);
defined('SITE') ? null : define('SITE', __DIR__.DS);
defined('SITE') ? null : define('SITE', dirname(__FILE__));
defined('SITE') ? null : define('SITE', DS);

I have posted this because we are having a little difficulty getting an answer from him.

The SITE constant is probably defined in the local version as well. The problem is that the value of this constant is set to work in your production environment.

What you will have to do is to locate the SITE constant and change it to work with your local environment.

Another option is possible using a runkit extension.

// Redefine SITE constant
runkit_constant_redefine('SITE', dirname(__FILE__).DIRECTORY_SEPARATOR);

In order to help you out better, I will need some more information on both the server directory structure and the localhost directory structure.

You can find the PHP Manual entry to runkit_constant_redefine here

Edit

What could help is to dump the SITE constant and check it's value before trying to redefine it.

var_dump(SITE);