acctman Posted August 26, 2007 Share Posted August 26, 2007 the exec function doesn't process, but it works fine if i put it in a empty php file by itself. Is there a reason why it would not run with other coding around it? // Handle MP3 uploads if(!move_uploaded_file($_FILES['Filedata']['tmp_name'], $upload_path . session_id() . ".mp3")) { header("HTTP/1.0 500 Internal Server Error"); } $cmd = '/usr/local/bin/lame -b 112 /home/site/public_html/temp/tempo.mp3 /home/site/public_html/temp/112_tempo.mp3' exec($cmd); Link to comment https://forums.phpfreaks.com/topic/66788-solved-php-not-processing/ Share on other sites More sharing options...
Glyde Posted August 26, 2007 Share Posted August 26, 2007 Well first of all for all we know /public_html/temp/tempo.mp3 doesn't exist...why are you moving the file using $upload_path and session_id(), and yet accessing it using a static value? Link to comment https://forums.phpfreaks.com/topic/66788-solved-php-not-processing/#findComment-334662 Share on other sites More sharing options...
acctman Posted August 26, 2007 Author Share Posted August 26, 2007 i was testing with a file in the /temp/ folder... once the upload is done, it should process the exec function this what the actually line should be but it's not work, is my $cmd array format correct? if(!move_uploaded_file($_FILES['Filedata']['tmp_name'], $upload_path . session_id() . ".mp3")) { header("HTTP/1.0 500 Internal Server Error"); } $cmd = '/usr/local/bin/lame -b 112 /home/site/public_html/temp/' . session_id() . '.mp3' '/home/site/public_html/temp/112_' . session_id() . '.mp3'; exec($cmd); Link to comment https://forums.phpfreaks.com/topic/66788-solved-php-not-processing/#findComment-334668 Share on other sites More sharing options...
acctman Posted August 26, 2007 Author Share Posted August 26, 2007 any ideas ? Link to comment https://forums.phpfreaks.com/topic/66788-solved-php-not-processing/#findComment-334740 Share on other sites More sharing options...
teng84 Posted August 26, 2007 Share Posted August 26, 2007 have you tried it without using the php script Link to comment https://forums.phpfreaks.com/topic/66788-solved-php-not-processing/#findComment-334742 Share on other sites More sharing options...
acctman Posted August 26, 2007 Author Share Posted August 26, 2007 have you tried it without using the php script i just tried this and it didn't work $mp3file = "tempo.mp3"; $cmd = '/usr/local/bin/lame -b 112 /home/site/public_html/temp/' . $mp3file . '/home/site/public_html/temp/112_' . $mp3file; exec($cmd); this works though $cmd = '/usr/local/bin/lame -b 112 /home/site/public_html/temp/tempo.mp3 /home/site/public_html/temp/112_tempo.mp3'; exec($cmd); so its something wrong with my Array formatting for the first code with $cmd, is everything spaced correctly with the $mp3file? Link to comment https://forums.phpfreaks.com/topic/66788-solved-php-not-processing/#findComment-334774 Share on other sites More sharing options...
teng84 Posted August 26, 2007 Share Posted August 26, 2007 echo the $cmd and look if your getting the same value? Link to comment https://forums.phpfreaks.com/topic/66788-solved-php-not-processing/#findComment-334779 Share on other sites More sharing options...
acctman Posted August 26, 2007 Author Share Posted August 26, 2007 echo the $cmd and look if your getting the same value? thanks for the tip, this is what it's showing. How do i add a space in between? /usr/local/bin/lame -b 112 /home/site/public_html/temp/tempo.mp3/home/site/public_html/temp/112_tempo.mp3 Link to comment https://forums.phpfreaks.com/topic/66788-solved-php-not-processing/#findComment-334793 Share on other sites More sharing options...
teng84 Posted August 26, 2007 Share Posted August 26, 2007 space? " " as easy as that is that what you mean $teng ." ".$teng Link to comment https://forums.phpfreaks.com/topic/66788-solved-php-not-processing/#findComment-334797 Share on other sites More sharing options...
acctman Posted August 27, 2007 Author Share Posted August 27, 2007 space? " " as easy as that is that what you mean $teng ." ".$teng how do i combine the session id with .mp3 for the $mp3 array? session_start(); $mp3 = session_id() ".mp3"; echo $mp3 Link to comment https://forums.phpfreaks.com/topic/66788-solved-php-not-processing/#findComment-334857 Share on other sites More sharing options...
teng84 Posted August 27, 2007 Share Posted August 27, 2007 what array? are you sure you want array because you do this echo $mp3 echo works for variables , string etc.. and array that index is being initialize not the exact array i guess this should work in this case session_start(); $mp3[] = session_id() ".mp3"; print_r($mp3); or if you want echo then echo $mp3[1]; note i use 1 as an array index Link to comment https://forums.phpfreaks.com/topic/66788-solved-php-not-processing/#findComment-334858 Share on other sites More sharing options...
hitman6003 Posted August 27, 2007 Share Posted August 27, 2007 How do i add a space in between? By putting a space in your variable, the same as you would any other time: $cmd = '/usr/local/bin/lame -b 112 /home/site/public_html/temp/' . $mp3file . ' /home/site/public_html/temp/112_' . $mp3file; Link to comment https://forums.phpfreaks.com/topic/66788-solved-php-not-processing/#findComment-334860 Share on other sites More sharing options...
acctman Posted August 27, 2007 Author Share Posted August 27, 2007 Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/site/public_html/temp/test.php on line 4 this is what i'm trying to do in my script. $mp3file should have the sessionID.mp3 then added to $cmd for the exec. the coding doesn't like this line $mp3file = session_id() ".mp3"; same with the test.php i get an error with $mp3[] = session_id() ".mp3"; $mp3file = session_id() ".mp3"; $cmd = '/usr/local/bin/lame -b 112 /home/site/public_html/temp/' . $mp3file . ' /home/site/public_html/temp/112_' . $mp3file; exec($cmd); Link to comment https://forums.phpfreaks.com/topic/66788-solved-php-not-processing/#findComment-334864 Share on other sites More sharing options...
teng84 Posted August 27, 2007 Share Posted August 27, 2007 $mp3[] = session_id() ".mp3"; you forgot the dot or i forgot the dot $mp3[] = session_id(). ".mp3"; Link to comment https://forums.phpfreaks.com/topic/66788-solved-php-not-processing/#findComment-334865 Share on other sites More sharing options...
acctman Posted August 27, 2007 Author Share Posted August 27, 2007 thanks Link to comment https://forums.phpfreaks.com/topic/66788-solved-php-not-processing/#findComment-334880 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.