简体   繁体   English

PHP文件无法上传

[英]PHP file won't upload

I am using bluehost.com and when I tried to upload video files, they didn't upload, without showing any errors, I guess this is caused by php.ini file. 我正在使用bluehost.com,当我尝试上传视频文件时,它们没有上传,没有显示任何错误,我想这是由php.ini文件引起的。 So I went to cPanel and went to PHP Config, and copied the file but it renamed to php.ini.default, and when I make changes to that file it doesn't seem to be working. 因此,我去了cPanel并去了PHP Config,并复制了文件,但将其重命名为php.ini.default,当我对该文件进行更改时,它似乎无法正常工作。 So my concern is, change maximum file upload size from php.ini and do I need to rename php.ini.default to php.ini 因此,我的担忧是,将最大文件上传大小从php.ini更改,我是否需要将php.ini.default重命名为php.ini

The php.ini file should be named php.ini to be read. php.ini文件应命名为php.ini才能读取。 Anyway some servers will block your changes to that file, to check if the change is in effect you can use the function ini_get to see what is your setting value. 无论如何,有些服务器会阻止您对该文件的更改,要检查更改是否生效,可以使用ini_get函数查看您的设置值。

echo 'upload_max_filesize =' . ini_get('upload_max_filesize') . PHP_EOL;

Also you should check the post_max_size in your php.ini file, files are transfered using POST. 另外,您还应该检查php.ini文件中的post_max_size,使用POST传输文件。

echo 'post_max_size = ' . ini_get('post_max_size') . PHP_EOL;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM