M
M
mirexdoors2018-03-28 16:56:01
1C-Bitrix
mirexdoors, 2018-03-28 16:56:01

500 error with symlinks?

Hello! I'm deploying an additional multi-site site on a neighboring domain.
site1 (main)
site2 (secondary)

Made symlinks. But the second site gives 500. In the logs

[pid 19196] [client **.**.194.246:50210] PHP Warning:  require(): open_basedir restriction in effect. File(/home/admin/web/site1/public_html/bitrix/header.php) is not within the allowed path(s): (/home/admin/web/site2/public_html:/home/admin/tmp) in /home/admin/web/site2/public_html/index.php on line 2
[Wed Mar 28 16:51:22.720081 2018] [:error] [pid 19196] [client ***.**.194.246:50210] PHP Warning:  require(/home/admin/web/site1/public_html/bitrix/header.php): failed to open stream: Operation not permitted in /home/admin/web/site2/public_html/index.php on line 2
[Wed Mar 28 16:51:22.720094 2018] [:error] [pid 19196] [client **.**.194.246:50210] PHP Fatal error:  require(): Failed opening required '/home/admin/web/site2/public_html/bitrix/header.php' (include_path='.:/usr/share/php') in /home/admin/web/site2/public_html/index.php on line 2

.htaccess of the second site:
RewriteBase /
Options -Indexes
Options +FollowSymLinks
ErrorDocument 404 /404.php

<IfModule mod_php5.c>
  php_flag allow_call_time_pass_reference 1
  php_flag session.use_trans_sid off  
  
  #php_value memory_limit 128M
  #php_value display_errors 1
  #php_value mbstring.internal_encoding UTF-8
</IfModule>

<IfModule mod_rewrite.c>
  Options +FollowSymLinks
  RewriteEngine On
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-l
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_FILENAME} !/bitrix/urlrewrite.php$
  RewriteRule ^(.*)$ /bitrix/urlrewrite.php [L]
  RewriteRule .* - [E=REMOTE_USER:%{HTTP:Authorization}]
</IfModule>

<IfModule mod_dir.c>
  DirectoryIndex index.php index.html
</IfModule>

<IfModule mod_expires.c>
  ExpiresActive on
  ExpiresByType image/jpeg "access plus 3 day"
  ExpiresByType image/gif "access plus 3 day"
</IfModule>

rights to folders 755. Files 644

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Nikolaev, 2018-03-28
@gromdron

The problem is NOT in Bitrix, but in the php settings of your web server.
More specifically, you are not allowed to open another directory in open_basedir.
You can try to set the open_basedir value to none, but since you have a non-standard configuration (I see on the path that it is not Bitrix Env), the best way is to contact your system administrator / hoster.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question