if i create a PHP script that includes files, can it include files from a different username on the same server?

the php file is located here:

in this php file, there is an include("/home/usernameY/")

or is it blocked for security reasons?

If your users are from the same webid, or to say in another way, if all users are on the same group, you can read, and therefore, do include with others users path (as long as are on the same group, if you have created both users and done no more, I think that these is the standar permisions… you can do more thinks with groups and group premissions on the web panel)

But the include itself is gona to give you an error…
of fopen

You need to change a little your include… citing from above

Server-Side Includes

Many developers include files by pointing to a remote URL, even if the file is within the local system. For example:

<?php include(""); ?>

With allow_url_fopen disabled, this method will not work. Instead, the file must be included with a local path, and there are three methods of doing this:

  1. By using a relative path, such as …/includes/example_include.php.
  2. By using an absolute path (also known as relative-from-root), such as /home/username/
  3. By using the PHP environment variable $_SERVER[‘DOCUMENT_ROOT’], which returns the absolute path to the web root directory. This is by far the best (and most portable) solution. The example that follows shows the environment variable in action:

Example Include

<?php include($_SERVER['DOCUMENT_ROOT']."/includes/example_include.php"); ?>

so as long as i use /home/username/etc… i’ll be okay looks like