Search code examples
phpcross-domainmodxhttp-status-code-503

Include PHP file on same server, different domains


I get a 503 error when calling an include statement to another domain on my PLESK server in ModX e.g.

if (!@include_once (MODX_CORE_PATH . "model/modx/modx.class.php")){
    //throw 503 error
}

Is this a CORS issue, or is something else making this if statement fail?

Thanks in Advance.


Solution

  • You need to update your open_basedir setting in plesk to allow domain1 access to domain2's directory structure:

    http://php.net/manual/en/ini.core.php#ini.open-basedir

    Depending on your host you may not be able to do this ~ quite likely not, that would be a pretty huge security problem. [in effect you could access & manipulate files on any domain on the server just by editing this setting]