disable_functions eval,link,symlink,system,shell_exec,passthru,exec,popen,proc_close,proc_get_status,proc_open,proc_terminate
저는 php-fpm 에서 저렇게 막습니다.
이 때문에 라이믹스의 기본 gif2mp4 기능을 못 쓰네요. (물론 원인제공은 제가..)
서비스중인 php-fpm 에서 exec 함수를 막으면서도 ffmpeg 끌어다 쓰는 약간의 꼼수가 있습니다.
vi /etc/hosts
127.0.0.1 gif2mp4
vi /etc/httpd/conf/httpd.conf (nginx 도 비슷하겠죠?)
<VirtualHost 127.0.0.1:80> ServerName gif2mp4 DocumentRoot "${PUBLIC_HTML}/~/public_html" <FilesMatch \.php$> SetHandler "proxy:unix:/var/opt/remi/php74/tmp/php-fpm2.sock|fcgi://127.0.0.1/" </FilesMatch> </VirtualHost>
vi /etc/opt/remi/php74/php-fpm.d/gif2mp4.conf
;php-fpm [gif2mp4] user = apache group = apache ;listen = 127.0.0.1:9010 listen = /var/opt/remi/php74/tmp/php-fpm2.sock listen.owner = apache listen.group = apache listen.mode = 0660 # 아래는 대충 listen.allowed_clients = 127.0.0.1 pm = dynamic pm.max_children = 50 pm.start_servers = 5 pm.min_spare_servers = 5 pm.max_spare_servers = 35 php_admin_flag[log_errors] = off php_flag[display_errors] = off php_admin_value[memory_limit] = 256M
exec 대신 php curl 대체
<?php $data = ['source' => $source,'target' => $target]; // $source = local gif $ch = curl_init('http://gif2mp4/~/exec.php?' . http_build_query($data)); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 59); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $res = curl_exec($ch); curl_close($ch);
라믹에서 업로드할 때 insertFile before 트리거에서 인코딩 하고 after 트리거도 걸어서 width, height, duration, thumbnail 등의 인자를 갱신해줘야 합니다.
이상 잡담이었습니다.