Php include not working on Wordpress/ subdomain?

We have this functioning php-snippet:

<?php include($_SERVER['DOCUMENT_ROOT'].'/iapath/iapathlist.php');?>

It works fine,

however, when it is put into a Wordpress page on a subdomain wp3 =, which is hosting the Wordpress part of the site, then it doesn’t work.

Of course we use the absolute path in this case.

<?php include($_SERVER['DOCUMENT_ROOT'].'');?>

There is also a simple php date snippet running fine.

What can be the reason it, doesn’t compile?


with best regards, Omar KN, Stockholm, Sweden

“Absolute path” doesn’t mean “URL”. A URL is how a http client (such as a web browser) finds your file; an absolute path is the file system path from the root to your file. You can’t use them interchangeably.

Have you tried your original code on your subdomain? If it didn’t work, what was the error?

I put the file on the wp3 subdomain

[php = no success]

include ($_SERVER['DOCUMENT_ROOT']. '');

When I have it on my static page @ main domain, then this is the php:

<?php include($_SERVER['DOCUMENT_ROOT'].'/m/nlinks.php');?>
<br />	

My error-log is not updating right now (why?), the last entry was:

[09-Nov-2021 19:34:50 UTC] PHP Warning: include(): Failed opening ‘/home/livingis/’ for inclusion (include_path=’.:/opt/alt/php73/usr/share/pear’) in

/home/livingis/ : eval()'d code on line 2

older log entry

[24-Oct-2021 16:29:34 UTC] PHP Warning: include(/home/livingis/…/ failed to open stream: No such file or directory in

/home/livingis/ : eval()'d code on line 2


It might be a path issue, -


with best regards, Omar KN, Stockholm, Sweden

Sponsor our Newsletter | Privacy Policy | Terms of Service