在使用ownCloud的时候,你会遇到这样的问题:
owncloud_max_size_error
可以看到,当前大小不能超过:8M,太小了。

需要修改上传文件大小的限制。
该限制主要有两个位置配置:
1. ownCloud目录中的文件:.htaccess

[root@knowledge-system htdocs]# cat owncloud/.htaccess 



SetEnvIfNoCase ^Authorization$ "(.+)" XAUTHORIZATION=$1
RequestHeader set XAuthorization %{XAUTHORIZATION}e env=XAUTHORIZATION




php_value upload_max_filesize 10240M
php_value post_max_size 10240M
php_value memory_limit 10240M
php_value mbstring.func_overload 0

  SetEnv htaccessWorking true



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/carddav/ [R]
RewriteRule ^\.well-known/caldav /remote.php/caldav/ [R]
RewriteRule ^apps/calendar/caldav\.php remote.php/caldav/ [QSA,L]
RewriteRule ^apps/contacts/carddav\.php remote.php/carddav/ [QSA,L]
RewriteRule ^remote/(.*) remote.php [QSA,L]


AddType image/svg+xml svg svgz
AddEncoding gzip svgz


DirectoryIndex index.php index.html

AddDefaultCharset utf-8
Options -Indexes

        ModPagespeed Off


ErrorDocument 403 /owncloud/core/templates/403.php
ErrorDocument 404 /owncloud/core/templates/404.php
[root@knowledge-system htdocs]#

如上代码所示的:
php_value upload_max_filesize 10240M
php_value post_max_size 10240M
php_value memory_limit 10240M
即为对上传文件的大小限制。(这里的配置是我修正之后的状态)

另一个位置是PHP自己的配置文件,在我的环境里,它位于:/usr/local/php/etc/php.ini

[root@knowledge-system htdocs]# cat /usr/local/php/etc/php.ini | grep --color upload_max
;upload_max_filesize = 2M
upload_max_filesize = 10240M
[root@knowledge-system htdocs]# cat /usr/local/php/etc/php.ini | grep --color post_max
post_max_size = 10240M
[root@knowledge-system htdocs]# 

在php.ini中,需要配置的参数如上的Log中已经体现出来了。

然后,重启Apache服务即可:

[root@knowledge-system htdocs]# ps -ef | grep httpd
root     22735     1  0 09:24 ?        00:00:00 /usr/local/apache//bin/httpd -k start
daemon   22736 22735  0 09:24 ?        00:00:00 /usr/local/apache//bin/httpd -k start
daemon   22738 22735  0 09:24 ?        00:00:00 /usr/local/apache//bin/httpd -k start
daemon   22740 22735  0 09:24 ?        00:00:01 /usr/local/apache//bin/httpd -k start
daemon   22823 22735  1 09:25 ?        00:00:24 /usr/local/apache//bin/httpd -k start
root     22995 22521  0 09:57 pts/1    00:00:00 grep httpd
[root@knowledge-system htdocs]# 
[root@knowledge-system htdocs]# /usr/local/apache/bin/apachectl stop
[root@knowledge-system htdocs]# 
[root@knowledge-system htdocs]# ps -ef | grep httpd
root     23001 22521  0 09:58 pts/1    00:00:00 grep httpd
[root@knowledge-system htdocs]# 
[root@knowledge-system htdocs]# /usr/local/apache/bin/apachectl start
[root@knowledge-system htdocs]# 
[root@knowledge-system htdocs]# ps -ef | grep http
root     23005     1  0 09:58 ?        00:00:00 /usr/local/apache//bin/httpd -k start
daemon   23006 23005  0 09:58 ?        00:00:00 /usr/local/apache//bin/httpd -k start
daemon   23008 23005  0 09:58 ?        00:00:00 /usr/local/apache//bin/httpd -k start
daemon   23010 23005  0 09:58 ?        00:00:00 /usr/local/apache//bin/httpd -k start
root     23091 22521  0 09:58 pts/1    00:00:00 grep http
[root@knowledge-system htdocs]# 

再次,尝试ownCloud中上传:
Upload_successful

[root@knowledge-system software]# find /usr/local/apache/htdocs/ -name *.mp4
/usr/local/apache/htdocs/owncloud/data/adamhuan/files/Wushang Group/Others/Film/America/Gotham.S01E10.WEBrip.720X400.mp4
[root@knowledge-system software]# 

不过有一点需要注意,ownCloud中,目录不应该包含中文,否则会出现“无效目录”的错误,另外上传的文件的文件名也不应该是中文,否则可能上传失败。
ownCloud的中文化支持不够好。

期待它的下一个版本中能够得到改善吧。
——————————————————————
Ending。

4
说点什么

avatar
3 Comment threads
1 Thread replies
0 Followers
 
Most reacted comment
Hottest comment thread
3 Comment authors
Adamhuanyyn良辰洋葱新闻 Recent comment authors

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据

  Subscribe  
提醒
洋葱新闻
游客

谢谢 我的默认是2mb 新建了一个.htaccess 加进去这个代码就可以用了

良辰
游客

metoo

yyn
游客
yyn

请问怎么将搜索栏固定住,不让它隐藏或收起?