Jump to content

[SOLVED] PHP not processing


acctman

Recommended Posts

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

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);

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?

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

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);

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.