I'm trying to run FFMPEG on the app engine flex env for php.
I've whitelisted the exec() function in my app.yaml and installed FFMPEG using the docker file - so far so good.
When I'm running a exec("usr/bin/ffmpeg [args]...") I get an error that ffmpeg can't access the dev/stderr and the function shuts down. see ref:
WARNING: [pool app] child 44 said into stderr: "NOTICE: PHP message: ALERT - Unable to open logfile: /dev/stderr (attacker '', file '/app/index.php', line 49)"
WARNING: [pool app] child 44 said into stderr: "NOTICE: PHP message: PHP Warning: exec() has been disabled for security reasons in /app/index.php on line 49"
My configuration files are as follows:
APP.YAML:
runtime: custom
env: flex
runtime_config:
document_root: .
COMPOSER.JSON:
{
"require": {
"php": "5.6.*",
"google/cloud-storage": "^1.0",
}
}
DOCKERFILE:
FROM gcr.io/google-appengine/php:latest
ENV DOCUMENT_ROOT /app
RUN apt-get -y update && apt-get install -y ffmpeg
INDEX.PHP:
<?php
//downloaded images into /tmp folder
$cmd = "/usr/bin/ffmpeg -r 24 -i /tmp/frame_%05d.png -r 24 -vcodec libx264 -pix_fmt yuv420p -b 50M -s 1920x1080 -y /tmp/export.mp4";
exec($cmd);
?>
I've tried using all the other shell function - system(), exec_shell(),proc_open() With the same result.
Any help?
Thank you