I recently copied and adapted (modified) an existing application on the same Apache2 Server (On a Ubuntu Server) :
==> After deploy, If I access site 1, Site 2 Gives Apache 500 Error (and not cakephp 500 error page) . And vice versa if I access Site 2 first.
I changed the cache prefixes in app.php . On localhost (windows) I don’t have this problem. It appears only when I Deploy on the remote Ubuntu Server .
I had a look at apache error log and I found that Site 2 is trying to access Site 1 files. Here is the log:
(in this example, the correct path is not /…/web10/… , but /…/web9/.)
[Thu Mar 23 00:36:38.270054 2017] [:error] [pid 13132] [client 209.197.185.227:57088] PHP Warning: file_exists(): open_basedir restriction in effect. File(/var/www/clients/client1/web9/web/vendor/cakephp/chronos/src/Chronos.php) is not within the allowed path(s): (/var/www/clients/client1/web10/web:/var/www/clients/client1/web10/private:/var/www/clients/client1/web10/tmp:/var/www/jobea.ca/web:/srv/www/jobea.ca/web:/usr/share/php5:/usr/share/php:/tmp:/usr/share/phpmyadmin:/etc/phpmyadmin:/var/lib/phpmyadmin) in /var/www/clients/client1/web9/web/vendor/composer/ClassLoader.php on line 354
[Thu Mar 23 00:36:38.270369 2017] [:error] [pid 13132] [client 209.197.185.227:57088] PHP Warning: file_exists(): open_basedir restriction in effect. File(/var/www/clients/client1/web9/web/vendor/cakephp/cakephp/src/Chronos/Chronos.php) is not within the allowed path(s): (/var/www/clients/client1/web10/web:/var/www/clients/client1/web10/private:/var/www/clients/client1/web10/tmp:/var/www/jobea.ca/web:/srv/www/jobea.ca/web:/usr/share/php5:/usr/share/php:/tmp:/usr/share/phpmyadmin:/etc/phpmyadmin:/var/lib/phpmyadmin) in /var/www/clients/client1/web9/web/vendor/composer/ClassLoader.php on line 354
[Thu Mar 23 00:36:38.270412 2017] [:error] [pid 13132] [client 209.197.185.227:57088] PHP Warning: Class 'Cake\\Chronos\\Chronos' not found in /var/www/clients/client1/web9/web/vendor/cakephp/chronos/src/carbon_compat.php on line 16
[Thu Mar 23 00:36:38.270637 2017] [:error] [pid 13132] [client 209.197.185.227:57088] PHP Warning: file_exists(): open_basedir restriction in effect. File(/var/www/clients/client1/web9/web/vendor/cakephp/chronos/src/ChronosInterface.php) is not within the allowed path(s): (/var/www/clients/client1/web10/web:/var/www/clients/client1/web10/private:/var/www/clients/client1/web10/tmp:/var/www/jobea.ca/web:/srv/www/jobea.ca/web:/usr/share/php5:/usr/share/php:/tmp:/usr/share/phpmyadmin:/etc/phpmyadmin:/var/lib/phpmyadmin) in /var/www/clients/client1/web9/web/vendor/composer/ClassLoader.php on line 354
[Thu Mar 23 00:36:38.270870 2017] [:error] [pid 13132] [client 209.197.185.227:57088] PHP Warning: file_exists(): open_basedir restriction in effect. File(/var/www/clients/client1/web9/web/vendor/cakephp/cakephp/src/Chronos/ChronosInterface.php) is not within the allowed path(s): (/var/www/clients/client1/web10/web:/var/www/clients/client1/web10/private:/var/www/clients/client1/web10/tmp:/var/www/jobea.ca/web:/srv/www/jobea.ca/web:/usr/share/php5:/usr/share/php:/tmp:/usr/share/phpmyadmin:/etc/phpmyadmin:/var/lib/phpmyadmin) in /var/www/clients/client1/web9/web/vendor/composer/ClassLoader.php on line 354
[Thu Mar 23 00:36:38.270883 2017] [:error] [pid 13132] [client 209.197.185.227:57088] PHP Warning: Class 'Cake\\Chronos\\ChronosInterface' not found in /var/www/clients/client1/web9/web/vendor/cakephp/chronos/src/carbon_compat.php on line 17
[Thu Mar 23 00:36:38.271619 2017] [:error] [pid 13132] [client 209.197.185.227:57088] PHP Warning: file_exists(): open_basedir restriction in effect. File(/var/www/clients/client1/web9/web/vendor/cakephp/cakephp/src/Utility/Inflector.php) is not within the allowed path(s): (/var/www/clients/client1/web10/web:/var/www/clients/client1/web10/private:/var/www/clients/client1/web10/tmp:/var/www/jobea.ca/web:/srv/www/jobea.ca/web:/usr/share/php5:/usr/share/php:/tmp:/usr/share/phpmyadmin:/etc/phpmyadmin:/var/lib/phpmyadmin) in /var/www/clients/client1/web9/web/vendor/composer/ClassLoader.php on line 354
[Thu Mar 23 00:36:38.271640 2017] [:error] [pid 13132] [client 209.197.185.227:57088] PHP Fatal error: Class 'Cake\\Utility\\Inflector' not found in /var/www/clients/client1/web9/web/vendor/cakephp/cakephp/src/Utility/bootstrap.php on line 18
Thanks