PC & IT SUPPORT MADE EASY FORUM
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Running Linux Bash Shell Commands From Inside PHP Web Server

Go down

Running Linux Bash Shell Commands From Inside PHP Web Server Empty Running Linux Bash Shell Commands From Inside PHP Web Server

Post by jamied_uk 28th May 2016, 20:53

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
jamied_uk
jamied_uk
Admin

Posts : 3053
Join date : 2010-05-09
Age : 41
Location : UK

https://jnet.sytes.net

Back to top Go down

Running Linux Bash Shell Commands From Inside PHP Web Server Empty Re: Running Linux Bash Shell Commands From Inside PHP Web Server

Post by jamied_uk 28th May 2016, 21:02

jamied_uk
jamied_uk
Admin

Posts : 3053
Join date : 2010-05-09
Age : 41
Location : UK

https://jnet.sytes.net

Back to top Go down

Running Linux Bash Shell Commands From Inside PHP Web Server Empty Re: Running Linux Bash Shell Commands From Inside PHP Web Server

Post by jamied_uk 28th May 2016, 21:45

Bash Shell Via PHP To Generate Voice Wav Clip

jamied_uk
jamied_uk
Admin

Posts : 3053
Join date : 2010-05-09
Age : 41
Location : UK

https://jnet.sytes.net

Back to top Go down

Running Linux Bash Shell Commands From Inside PHP Web Server Empty Re: Running Linux Bash Shell Commands From Inside PHP Web Server

Post by jamied_uk 29th May 2016, 01:07

Text To Speech PHP & Bash



You will need write permissions on the files folder for www-data

https://app.box.com/s/ioup6nj8nfnh3c2ayj6ydflf8rzueduw
jamied_uk
jamied_uk
Admin

Posts : 3053
Join date : 2010-05-09
Age : 41
Location : UK

https://jnet.sytes.net

Back to top Go down

Running Linux Bash Shell Commands From Inside PHP Web Server Empty Re: Running Linux Bash Shell Commands From Inside PHP Web Server

Post by jamied_uk 29th May 2016, 01:21

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
jamied_uk
jamied_uk
Admin

Posts : 3053
Join date : 2010-05-09
Age : 41
Location : UK

https://jnet.sytes.net

Back to top Go down

Running Linux Bash Shell Commands From Inside PHP Web Server Empty Re: Running Linux Bash Shell Commands From Inside PHP Web Server

Post by jamied_uk 1st June 2016, 00:18

jamied_uk
jamied_uk
Admin

Posts : 3053
Join date : 2010-05-09
Age : 41
Location : UK

https://jnet.sytes.net

Back to top Go down

Running Linux Bash Shell Commands From Inside PHP Web Server Empty Re: Running Linux Bash Shell Commands From Inside PHP Web Server

Post by Sponsored content


Sponsored content


Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum