更具体地说,当我更改最大上传和发布尺寸时,我将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'
任何帮助都将受到最大的赞赏
答案 0 :(得分:2)
您的htaccess文件无效。您正在启动指令<IfModule mod_rewrite.c>
,但从未使用</IfModule>
关闭它。
我建议下载nextcloud发布的默认htaccess文件,然后重试。只需从此处下载zip文件:https://nextcloud.com/install/#instructions-server并替换htacess文件。
答案 1 :(得分:0)
htaccess设置仅用于在该文件夹或子文件夹中执行的PHP - What is the difference between php.ini and .htaccess?
查看错误消息({{1}})表明作曲家的内存限制比你设置的低得多,所以我的猜测是它不受你的htaccess的影响。
尝试在php.ini文件中设置限制。