Problem scenario: Transcode files with FFmpeg.
Problem Description: Use PHP to implement transcoding with three methods called Terminal ffmpeg via exec (), PassThru (), System ()
The code is as follows:
To run this PHP file in the terminal, it can be transcoded normally.
However, access to this file via the Web cannot be transcoded. Why??
Before the full path of the FFmpeg is written, the status Code of PassThru () is not found in the command, and now is the Web Access returned in 1, stating that no execution was successful.
Executes the PHP file directly in, the state is 0, the execution succeeds.
Does FFmpeg have a problem with user permissions
The users who print out on the web are Www-data
Terminal is root
What is the reason for this situation?
。 Urgent and urgent ...
Little brother to do mobile development, this is not familiar,, Google a lot of themselves, did not find the cause and solution----
-------!!!!!!!!!!!!!
Reply content:
Problem scenario: Transcode files with FFmpeg.
Problem Description: Use PHP to implement transcoding with three methods called Terminal ffmpeg via exec (), PassThru (), System ()
The code is as follows:
To run this PHP file in the terminal, it can be transcoded normally.
However, access to this file via the Web cannot be transcoded. Why??
Before the full path of the FFmpeg is written, the status Code of PassThru () is not found in the command, and now is the Web Access returned in 1, stating that no execution was successful.
Executes the PHP file directly in, the state is 0, the execution succeeds.
Does FFmpeg have a problem with user permissions
The users who print out on the web are Www-data
Terminal is root
What is the reason for this situation?
。 Urgent and urgent ...
Little brother to do mobile development, this is not familiar,, Google a lot of themselves, did not find the cause and solution----
-------!!!!!!!!!!!!!
You are using the root user in the terminal, this user privilege is invincible, and the user rights in the Web is limited ~.