One nette application tries to touch files in another

Notice: This thread is very old.
saleck
Member | 3
+
0
-

Hi,

we are currently having a strange problem on our shared webserver:

The first application is located at /path/to/first/app/www and the second one at /path/to/second/app/www. The first one is run and shows no problem. The second one however displays blank page and writes into the apache error log:

PHP Fatal error: require_once(): Failed opening required '/path/to/first/app/www/vendor/composer/autoload_real.php' (include_path='.:/usr/share/php:/usr/local/lib/global-php:/usr/local/lib/php') in /path/to/second/app/www/vendor/autoload.php on line 5

So it looks as if the second application is trying to include file from the first app which is strange because on line 5 of the autoload.php is:

require_once __DIR__ . '/composer/autoload_real.php';

I have tried to put echo __DIR__; before this line and the output has been correct:

/path/to/second/app/www/vendor

And with the echo command before the require_once the application included the correct file from the correct directory and moved to the same problem in the file vendor/nette/safe-stream/src/loader.php.

After adding the echo to the second location as well the application started working. If we remove it it stops.

Both applications are run under different user accounts – apache runs with the itk thus creating for each user it's own process.

Versions:
Apache – 2.4.10
PHP – 5.6.26
Nette – 2.4

Has anyone similar problem? Does anyone know how to solve this problem? We have no report from other users that run different frameworks about similar problem this seems to affect only Nette projects.

Last edited by saleck (2016-10-24 17:17)

saleck
Member | 3
+
0
-

To add another clue – the server hosts older Nette projects as well and those are not affected (e.g. Nette version 2.0.4).

saleck
Member | 3
+
0
-

We have isolated the issue to the OPcache – it looks it doesn't respect it's own setting of
opcache.use_cwd=1. :(

After turning OPcache off and switching to XCache the problem disappeared.