已经:
【记录】在线WordPress中用插件All in One WP Migration实现迁移到在线环境网站搬家
现在需要把一个很大的视频,400多MB视频,上传到WordPress中。
而此处Media媒体显示最大只能上传50MB文件:
需要扩大文件上传的大小。
之前就知道,要去修改php的配置即可,而之前也折腾过类似问题:
【已解决】Wordpress上传zip的主题文件失败:The link you followed has expired
不过此处由于在线WordPress环境是OneinStack安装的
所以要去搞清楚,php的配置在哪里
OneinStack php 位置
PHP:/usr/local/php
“默认 ip 直接访问内容对应根目录:/data/wwwroot/default,该目录包含首页demo、Opcache 缓存管理、phpinfo、phpmyadmin、探针等文件,目录里面文件可删除,目录不能删除。”
[root@izj6cefkuu3496m71s907xz etc]# pwd /usr/local/php/etc [root@izj6cefkuu3496m71s907xz etc]# ll -lh total 96K -rw-r--r-- 1 root root 1.2K Aug 26 21:47 pear.conf drwxr-xr-x 2 root root 4.0K Aug 26 21:57 php.d -rw-r--r-- 1 root root 1.1K Aug 26 21:47 php-fpm.conf -rw-r--r-- 1 root root 4.4K Aug 26 21:47 php-fpm.conf.default drwxr-xr-x 2 root root 4.0K Aug 26 21:47 php-fpm.d -rw-r--r-- 1 root root 70K Aug 26 21:47 php.ini
就可以去修改php.ini,去增加
; Maximum allowed size for uploaded files. ; http://php.net/upload-max-filesize ; upload_max_filesize = 50M upload_max_filesize = 1024M ; Maximum size of POST data that PHP will accept. ; Its value may be 0 to disable the limit. It is ignored if POST data reading ; is disabled through enable_post_data_reading. ; http://php.net/post-max-size ; post_max_size = 100M post_max_size = 1024M
然后重启
; post_max_size = 100M post_max_size = 1024M [root@izj6cefkuu3496m71s907xz etc]# cat php.ini | grep max_filesize ; upload_max_filesize = 50M upload_max_filesize = 1024M
再去重启php:
[root@izj6cefkuu3496m71s907xz etc]# /etc/init.d/php-fpm restart Gracefully shutting down php-fpm . done Starting php-fpm done
就生效了:
【总结】
此处是去/usr/local/php/etc,修改php.ini为:
; upload_max_filesize = 50M upload_max_filesize = 1024M ; upload_max_filesize = 50M upload_max_filesize = 1024M
然后重启php:
/etc/init.d/php-fpm restart
即可。