In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-14 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly explains "php how to deal with video card", the article explains the content is simple and clear, easy to learn and understand, the following please follow the editor's ideas slowly in depth, together to study and learn "php how to deal with video card" bar!
Php to deal with video is not stuck: 1, set whether to allow files to be uploaded through http; 2, set the maximum execution time of the script; 3, set the maximum amount of memory that can be allocated by the script; 4, set the maximum size of files allowed to be uploaded; 5, set the maximum size that post mode can accept, and so on.
The operating environment of this paper: Windows7 system, PHP7.1, Dell G3.
How does php deal with non-jammed videos? How to slice and process large Video Files with php
PHP uses the super global variable array $_ FILES to record file upload information.
1.file_uploads=on/off
Is it allowed to upload files through http?
2.max_execution_time=30
Allow the maximum execution time of the script, after which an error will be reported.
3.memory_limit=50M
Set the maximum amount of memory that a script can allocate to prevent runaway scripts from consuming too much memory. This instruction can only be set at compile time.
-- it will not take effect until the enable-memory-limit flag
4.upload_max_filesize=20M
Maximum size of files allowed to be uploaded, this instruction must be less than post_max_size
5.upload_tmp_dir
Temporary storage directory for uploaded files
6.post_max_size=30M
Allow post mode to accept maximum size
$_ FILES ['myFile'] [' name'] the original name of the client's last file.
The MIME type of the $FILES ['myFile'] [' type'] file, which requires the browser to provide support for this information, such as "image/gif".
$_ FILES ['myFile'] [' size'] the size of the uploaded file in bytes.
The temporary file name stored on the server after the $_ FILES ['myFile'] [' tmp_name'] file is uploaded, which is generally the system default. It can be specified in the upload_tmp_dir of php.ini, but setting it with the putenv () function does not work.
$_ FILES ['myFile'] [' error'] and the status code associated with the file upload. ['error'] is added in PHP version 4.2.0. Here is its description: (they become constants after PHP3.0)
UPLOAD_ERR_OK
Value: 0; No error occurred and the file was uploaded successfully.
UPLOAD_ERR_INI_SIZE
Value: 1; the uploaded file exceeds the limit of the upload_max_filesize option in php.ini.
UPLOAD_ERR_FORM_SIZE
The size of the uploaded file exceeds the value specified by the MAX_FILE_SIZE option in the HTML form.
UPLOAD_ERR_PARTIAL
Value: 3; only part of the file is uploaded.
UPLOAD_ERR_NO_FILE
Value: 4; No files have been uploaded.
Value: 5; upload file size is 0.
After the file is uploaded, it is stored in the temporary directory by default, and you must delete it from the temporary directory or move it somewhere else. If not, it will be deleted.
That is, regardless of whether the upload is successful or not, the files in the temporary directory will be deleted after the script is executed.
Attachment: the method of modifying the size limit of files uploaded by PHP
1. General file upload, unless the file is very small. Like a 5 m file, it will probably take more than a minute to upload.
But in php, the default maximum execution time for this page is 30 seconds. That is, after more than 30 seconds, the script stops execution.
This leads to the inability to open the web page. At this point we can modify the max_execution_time
Look for it in php.ini
Max_execution_time
The default is 30 seconds. Change to
Max_execution_time = 0
0 means there is no limit
two。 Modify post_max_size to set the maximum size allowed for POST data. This setting also affects file uploads.
The default post_max_size of php is 2m. If the POST data size is greater than post_max_size $_ POST and $_ FILES superglobals, it will be empty.
Look for post_max_size. Change to
Post_max_size = 150m
3. Many people will change the second step. But when uploading files, the maximum is still 8m.
Why。 We also need to change the parameter upload_max_filesize to indicate the maximum size of the uploaded file.
Find upload_max_filesize. Default is 8m instead of
Upload_max_filesize = 100m
It is also important to note that post_max_size is greater than upload_max_filesize.
Thank you for your reading, the above is the content of "how to deal with video card in php". After the study of this article, I believe you have a deeper understanding of how to deal with video card in php, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.