How to get video length and php.ini configuration in php

不言
Release: 2023-04-03 14:26:02
Original
2607 people have browsed it

This article introduces you to the article about how to obtain the video length in php and configure php.ini. It has a good reference value and I hope it can help friends in need.

php Get video length

$long = exec("ffmpeg -i video.mp4 2>&1 | grep 'Duration' | cut -d ' ' -f 4 | sed s/,//");//总长度   
video.mp4  是文件路径
Copy after login

1. The server needs to install ffmpeg,

2. Open php.ini and find

disable_functions=passthru,system,exec,......
Copy after login

Delete exec, shell_exec save

3. Restart the service

After modification, you need to restart it to take effect. The restart here does not mean restarting nginx-be sure to pay attention.

If your lnmp is installed with php-cgi, restart php-cgi, if it is installed with php-fpm, restart php-fpm

Recommended related articles:

Introduction to the method of using arrays as parameters in php to optimize performance (with code)

How to enable the slow log configuration in php-fpm?

The above is the detailed content of How to get video length and php.ini configuration in php. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!