提升WordPress的较大提交限定

I need to upload a PDF file to my wordpress site. When I go to Upload New Media, and try uploading it, it says


I tried looking for my php.ini file but could not find it. I ran phpinfo() by creating a new file and then opening it in my browser and found this.


Loaded Configuration File C:\Program Files (x86)\Parallels\Plesk\Additional\PleskPHP5\php.ini

in wp-admin, httpdocs and everywhere I had access, nothing worked The max upload file size is just 8 MB. Please help me, My client needs to upload that file.

Note: Please don't tell me to restart server, as I can't, It is a hosted site.

处理计划方案

Try with the following plugin:

 ?php
/* Plugin Name: Increase Upload Limit */
add_filter( 'upload_size_limit', 'b5f_increase_upload' );
function b5f_increase_upload( $bytes )
 return 33554432; // 32 megabytes

I built this code based on the following :

function wp_max_upload_size() {
 $u_bytes = wp_convert_hr_to_bytes( ini_get( 'upload_max_filesize' ) );
 $p_bytes = wp_convert_hr_to_bytes( ini_get( 'post_max_size' ) );
 $bytes = apply_filters( 'upload_size_limit', min( $u_bytes, $p_bytes ), $u_bytes, $p_bytes );
 return $bytes;

Another option is upload via FTP and use the plugin .


我必须将PDF文档提交到我的 wordpress网站。当我们进到提交互联网媒体并试着提交时,它会显示信息




FileName.pdf超过较大值该网站的提交尺寸。




我试着搜索php.ini文档,但找不着。我根据建立一个新文档随后在访问器中开启它来运作 phpinfo()。




 配备文档(php.ini)相对路径
C:\ Windows

载入的配备文档
C:\ \程叙文件(x86)\并行处理\Plesk\额外\PleskPHP5\php.ini



我用



 upload_max_filesize = 512M 
置放了php.ini文档post_max_size = 512M
max_execution_time = 300


在wp-admin,httpdocs与我能够浏览的一切地区,沒有一切实际效果较大提交文档尺寸仅为8 MB。请协助我,我的顾客必须提交该文档。



留意:请不必告知我再次起动网络服务器,由于我不会能,它是一个代管站点。


处理计划方案

试着下列软件:



 ?php 
/ *软件名字:提升提交限定* /

add_filter('upload_size_limit','b5f_increase_upload');

涵数b5f_increase_upload($ bytes)
{
return 33554432; // 32兆字节数
}


我根据下列:



 涵数wp_max_upload_size(){
$ u_bytes = wp_convert_hr_to_bytes(ini_get('upload_max_filesize')));
$ p_bytes = wp_convert_hr_to_bytes(ini_get(‘post_max_size’));
$ bytes = apply_filters(‘upload_size_limit’,min($ u_bytes,$ p_bytes),$ u_bytes,$ p_bytes);
回到$ bytes;
}


另外一个选择项是根据FTP提交并应用软件。