Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
326 views
in Technique[技术] by (71.8m points)

c++ - GLIBCXX_3.4.9 not found when running ffmpeg from php in lampp server

I've written a php program which creates a video from sequence of images using ffmpeg.

<?php
    $res = shell_exec("ffmpeg -framerate 50 -i image/image%d.png -c:v libx264 -r 30 -pix_fmt yuv420p out.mp4 2>&1");
    echo "$res";

When I run it,

it says GLIBCXX_3.4.15 , GLIBCXX_3.4.9 , GLIBCXX_3.4.11 not found.

ffmpeg: /opt/lampp/lib/libstdc++.so.6: version `GLIBCXX_3.4.15' not

found (required by /usr/lib/i386-linux-gnu/libjack.so.0) ffmpeg:

/opt/lampp/lib/libstdc++.so.6: version `GLIBCXX_3.4.9' not found

(required by /usr/lib/i386-linux-gnu/libzmq.so.3) ffmpeg:

/opt/lampp/lib/libstdc++.so.6: version `GLIBCXX_3.4.11' not found

(required by /usr/lib/i386-linux-gnu/libopencv_core.so.2.4) ffmpeg:

/opt/lampp/lib/libstdc++.so.6: version `GLIBCXX_3.4.9' not found

(required by /usr/lib/i386-linux-gnu/libopencv_core.so.2.4)

But from the terminal, ffmpeg -framerate 50 -i image/image%d.png -c:v libx264 -r 30 -pix_fmt yuv420p out.mp4 command works fine. Why php can't find the libraries while from the terminal it works fine? and what should I do to fix the problem in php? Thanks in advance.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

I also got similar problem while executing the ffmpeg command from PHP script. I found the solution by executing the following command from the terminal. I am pasting that command here so somebody get help from this.

sudo mv /opt/lampp/lib/libstdc++.so.6 /opt/lampp/lib/libstdc++.so.6.orig

Now just run your php script, hope that will work.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...