Running Linux Bash Shell Commands From Inside PHP Web Server
Page 1 of 1
Running Linux Bash Shell Commands From Inside PHP Web Server
- Code:
<?php
$output = shell_exec('ls -lart');
echo "<pre>$output</pre>";
?>
Original Video Lost But You Have All You Need Here!
Box Update Code Link
https://app.box.com/s/ioup6nj8nfnh3c2ayj6ydflf8rzueduw
Last edited by jamied_uk on 10th February 2017, 14:49; edited 3 times in total
Re: Running Linux Bash Shell Commands From Inside PHP Web Server
Bash Shell Via PHP To Generate Voice Wav Clip
Re: Running Linux Bash Shell Commands From Inside PHP Web Server
Text To Speech PHP & Bash
You will need write permissions on the files folder for www-data
https://app.box.com/s/ioup6nj8nfnh3c2ayj6ydflf8rzueduw
You will need write permissions on the files folder for www-data
https://app.box.com/s/ioup6nj8nfnh3c2ayj6ydflf8rzueduw
Re: Running Linux Bash Shell Commands From Inside PHP Web Server
- Code:
<?php
// convert from wav to mp3
//
$wavfile=$file;
$wav=file_get_contents($wavfile);
$descriptorspec = array(
0 => array( "pipe", "r" ),
1 => array( "pipe", "w" ),
2 => array( "file", "/dev/null", "w" )
);
$process = proc_open( "/usr/bin/lame - -", $descriptorspec, $pipes );
fwrite( $pipes[0], $wav );
fclose( $pipes[0] );
$mp3 = stream_get_contents( $pipes[1] );
fclose( $pipes[1] );
proc_close( $process );
//$new = $mp3;
echo file_put_contents("files/file.mp3","$mp3");
?>
but 1st install Lame
- Code:
sudo apt-get install -y lame
Update Code Link
https://app.box.com/s/ioup6nj8nfnh3c2ayj6ydflf8rzueduw
Similar topics
» Linux BASH Script Running Commands and Functions From Bash Script and saving to varables
» Linux Mint 18 2 Firewall Shell Commands & Scripts
» Top shell Commands To Make Working With Linux Easier
» W3M Linux BASH Commands
» Using Linux Play Synth Bash Shell Scripting
» Linux Mint 18 2 Firewall Shell Commands & Scripts
» Top shell Commands To Make Working With Linux Easier
» W3M Linux BASH Commands
» Using Linux Play Synth Bash Shell Scripting
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum