Dynadot .com transfer sale, only $10.12 with coupon code DYNA12, available while supplies last, ends October 1, 2026.

Executing Linux files from PHP

Namecheap AuctionsNamecheap Auctions
Namecheap AuctionsNamecheap Auctions
Spacemail by SpaceshipSpacemail by Spaceship
Watch

JustinWI

Established Member
Impact
0
I have installed ffmpeg on my VPS so I can encode movies to FLV on the fly. It runs fine from the command line, but not when calling from php. I have set the permissions on the file and folder to 777 but it still doesnt work. I have also tried setting the ffmpeg to 777 and that didnt change anything. The only output I can get from php about an error is "1". I am current using system() but tried exec() as well. Here is my code :
PHP:
$vid2flv = system('ffmpeg -i /home/mctv/www/files/video/$uploadfile -acodec mp3 -ar $samprate -ab $bitrate -f flv -s 320x240 -aspect 4:3 -y /home/mctv/www/files/video/$flvFile', $err_msg);

I have copied that whole command line to my SSH and replaced it with the actual numbers passed through and the command will run.
Thanks
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
Do you have PHP Safe on?

Try shell_exec

iNod.
 
1
•••
I actually just messed with it a little more and got it to work. I had to add '/usr/local/bin/' before 'ffmpeg...'.

Do any of you guys know a workaround to get ffmpeg to read WMV9 and above?

Thanks
(rep added)
 
0
•••
Olitt — high-converting AI websites, only from $1/moOlitt — high-converting AI websites, only from $1/mo

We're social

Escrow.com
Spaceship
Escrowly
CryptoExchange.com
Domain Recover
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back