0

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. 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. So my concern is, change maximum file upload size from php.ini and do I need to rename php.ini.default to php.ini

1 Answer 1

1

The php.ini file should be named php.ini to be read. 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.

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.

echo 'post_max_size = ' . ini_get('post_max_size') . PHP_EOL;
Sign up to request clarification or add additional context in comments.

2 Comments

Why the PHP_EOL constants? You only need to be concerned with the server platform if working with local files - you can use \n or <br /> to trigger line breaks in the HTML output.
I'm just use them for portability, i'm not always in an unix enviroment, but you can avoid the use of them. They just put an enter whatever your platform it is runnning on.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.