0

更具体地说,我在更改最大上传和帖子大小时意外地将我的 php_value memory_limit 更改为 20GB。我把它改回原来的 512MB,但我的页面仍然给我一个 HTTP ERROR 500。

有人知道我缺少什么吗?

这是我的 .htaccess

<IfModule mod_headers.c>
  <IfModule mod_setenvif.c>
    <IfModule mod_fcgid.c>
       SetEnvIfNoCase ^Authorization$ "(.+)" XAUTHORIZATION=$1
       RequestHeader set XAuthorization %{XAUTHORIZATION}e env=XAUTHORIZATION
    </IfModule>
    <IfModule mod_proxy_fcgi.c>
       SetEnvIfNoCase Authorization "(.+)" HTTP_AUTHORIZATION=$1
    </IfModule>
  </IfModule>

  <IfModule mod_env.c>
    # Add security and privacy related headers
    Header set X-Content-Type-Options "nosniff"
    Header set X-XSS-Protection "1; mode=block"
    Header set X-Robots-Tag "none"
    Header set X-Frame-Options "SAMEORIGIN"
    Header set X-Download-Options "noopen"
    Header set X-Permitted-Cross-Domain-Policies "none"
    SetEnv modHeadersAvailable true
  </IfModule>

  # Add cache control for CSS and JS files
  <FilesMatch "\.(css|js)$">
    Header set Cache-Control "max-age=7200, public"
  </FilesMatch>
</IfModule>
<IfModule mod_php5.c>
  php_value upload_max_filesize 5G
  php_value post_max_size 5G
  php_value memory_limit 512MB
  php_value mbstring.func_overload 0
  php_value always_populate_raw_post_data -1
  php_value default_charset 'UTF-8'
  php_value output_buffering 0
  <IfModule mod_env.c>
    SetEnv htaccessWorking true
  </IfModule>
</IfModule>
<IfModule mod_php7.c>
  php_value upload_max_filesize 5G
  php_value post_max_size 5G
  php_value memory_limit 512MB
  php_value mbstring.func_overload 0
  php_value default_charset 'UTF-8'
  php_value output_buffering 0
  <IfModule mod_env.c>
    SetEnv htaccessWorking true
  </IfModule>
</IfModule>
<IfModule mod_rewrite.c>
  RewriteEngine on
  RewriteRule .* - [env=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
  RewriteRule ^\.well-known/host-meta /public.php?service=host-meta [QSA,L]
  RewriteRule ^\.well-known/host-meta\.json /public.php?service=host-meta-json [QSA,L]
  RewriteRule ^\.well-known/carddav /remote.php/dav/ [R=301,L]
  RewriteRule ^\.well-known/caldav /remote.php/dav/ [R=301,L]
  RewriteRule ^remote/(.*) remote.php [QSA,L]
  RewriteRule ^(?:build|tests|config|lib|3rdparty|templates)/.* - [R=404,L]
  RewriteCond %{REQUEST_URI} !^/.well-known/acme-challenge/.*

这是我的错误日志

[Sun Sep 10 16:37:08.095999 2017] [proxy_fcgi:error] [pid 634:tid 1974465584] [client 212.238.239.196:56997] AH01071: Got error 'PHP message: PHP Fatal error:  Allowed memory size of 2097152 bytes exhausted (tried to allocate 65536 bytes) in /var/www/nextcloud/lib/composer/composer/ClassLoader.php on line 412\n'
[Sun Sep 10 16:38:14.788907 2017] [mpm_event:notice] [pid 632:tid 1995735040] AH00491: caught SIGTERM, shutting down
[Sun Sep 10 16:38:15.055829 2017] [ssl:warn] [pid 1218:tid 1995862016] AH01909: 127.0.1.1:443:0 server certificate does NOT include an ID which matches the server name
[Sun Sep 10 16:38:15.153908 2017] [ssl:warn] [pid 1219:tid 1995862016] AH01909: 127.0.1.1:443:0 server certificate does NOT include an ID which matches the server name
[Sun Sep 10 16:38:15.159375 2017] [mpm_event:notice] [pid 1219:tid 1995862016] AH00489: Apache/2.4.25 (Raspbian) OpenSSL/1.0.2l configured -- resuming normal operations
[Sun Sep 10 16:38:15.159570 2017] [core:notice] [pid 1219:tid 1995862016] AH00094: Command line: '/usr/sbin/apache2'
[Sun Sep 10 16:38:16.044752 2017] [proxy_fcgi:error] [pid 1223:tid 1974465584] [client 212.238.239.196:57043] AH01071: Got error 'PHP message: PHP Fatal error:  **Allowed memory size of 2097152 bytes exhausted (tried to allocate 65536 bytes)** in /var/www/nextcloud/lib/composer/composer/ClassLoader.php on line 412\n'

任何帮助将不胜感激

4

2 回答 2

2

您的 htaccess 文件无效。您正在启动指令<IfModule mod_rewrite.c>,但从不使用</IfModule>.

我建议下载 nextcloud 提供的默认 htaccess 文件,然后重试。只需从此处下载 zip 文件:https : //nextcloud.com/install/#instructions-server 并替换 htacess 文件。

于 2017-09-12T06:00:02.223 回答
0

htaccess 设置仅用于在该文件夹或子文件夹中执行的 PHP - php.ini 和 .htaccess 有什么区别?

查看错误消息 ( Allowed memory size of 2097152 bytes exhausted) 表明 composer 的内存限制比您设置的要低得多,所以我的猜测是它不受您的 htaccess 影响。

尝试在您的 php.ini 文件中设置限制。

于 2017-09-11T08:18:42.380 回答