I have a site with symfony3. Everything works like charm. For a couple of days, I installed an another project, to a different folder, and install symfony(3) with composer.
And there comes the problem. The first project works, but the second wouldnt. But if I restart the FPM, and browse the second project, it works, but the first goes wrong. I tried with symfony2.7 too. the same
the folder structure is
/var/www/domain1
/var/www/domain2
The default was the projects used the same fpm-socket, but i tried on different.
The nginx configuration is the following:
server {
server_name domain1;
root /var/www/domain1/web;
location / {
try_files $uri /app.php$is_args$args;
}
location ~ ^/(app_dev|config)\.php(/|$) {
fastcgi_pass unix:/var/run/php5-fpm-domain1.sock;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
location ~ ^/app\.php(/|$) {
fastcgi_pass unix:/var/run/php5-fpm-domain1.sock;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
internal;
}
location ~ /\.ht {
deny all;
}
error_log /var/log/nginx/domain1_error.log;
access_log /var/log/nginx/domain1_access.log;
}
server {
server_name domain2;
root /var/www/domain2/web;
server_tokens off;
location / {
try_files $uri /app.php$is_args$args;
}
location ~ ^/(app_dev|config)\.php(/|$) {
fastcgi_pass unix:/var/run/php5-fpm-domain2.sock;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
location ~ ^/app\.php(/|$) {
fastcgi_pass unix:/var/run/php5-fpm-domain2.sock;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
internal;
}
location ~ /\.ht {
deny all;
}
error_log /var/log/nginx/domain2_error.log;
access_log /var/log/nginx/domain2_access.log;
}
The fpm configurations:
[domain1]
user = www-data
group = www-data
listen = /var/run/php5-fpm-domain1.sock
listen.owner = www-data
listen.group = www-data
listen.mode = 0660
pm = dynamic
pm.max_children = 5
pm.start_servers = 2
pm.min_spare_servers = 1
pm.max_spare_servers = 3
chdir = /
[domain2]
user = domain2
group = domain2
listen = /var/run/php5-fpm-domain2.sock
listen.owner = domain2
listen.group = domain2
listen.mode = 0660
pm = dynamic
pm.max_children = 5
pm.start_servers = 2
pm.min_spare_servers = 1
pm.max_spare_servers = 3
chdir = /
php_admin_value[error_log] = /var/log/fpm-php.domain2.log
php_admin_flag[log_errors] = on
the domain2 user exists too, and user of the folder. and permission is good.
But the log says (it's very strange), that the secondary opened project wants to read from the other project o.0
I mean, the log is like this:
2015/11/05 13:17:04 [error] 26029#0: *33508 FastCGI sent in stderr: "PHP message: PHP Fatal error: Class 'AppBundle\AppBundle' not found in /var/www/domain2/app/AppKernel.php on line 19
PHP message: PHP Stack trace:
PHP message: PHP 1. {main}() /var/www/domain2/web/app_dev.php:0
PHP message: PHP 2. Symfony\Component\HttpKernel\Kernel->handle() /var/www/domain2/web/app_dev.php:33
PHP message: PHP 3. Symfony\Component\HttpKernel\Kernel->boot() /var/www/domain1/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php:183
PHP message: PHP 4. Symfony\Component\HttpKernel\Kernel->initializeBundles() /var/www/domain1/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php:121
PHP message: PHP 5. AppKernel->registerBundles() /var/www/domain1/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php:435" while reading response header from upstream, client: 46.139.10.151, server: domain2, request: "GET /app_dev.php HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm-domain2.sock:", host: "domain2"
Sooo, there is something very bad. But i dont know, as my colleagues, what the hell is this.
Somebody have a clue?