Home > Article > Backend Development > How to get video length and php.ini configuration in php
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 是文件路径
1. The server needs to install ffmpeg,
2. Open php.ini and find
disable_functions=passthru,system,exec,......
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!