Jump to content

[SOLVED] passthru() exit code 255


rubing

Recommended Posts

I am trying to execute system command, but am getting a return value of 255.  (i guess from bash)

 

Here is my php script:

<?php
echo '<pre>';

passthru('lame --mp3input --resample 44.1 -m s --alt-preset cbr 192 -q 0 /home/bob/public_html/blahblah.com/public/ads/fosters.mp3 /home/bob/public_html/blahblah.com/public/ads/fosters2.mp3',$retval);

// Printing additional info
echo '
</pre>
<hr />output: 
<hr />Return value: ' . $retval;
?>

 

 

And this is the output I get:

 

output:

Return value: 255

 

 

When I input this command on my shell it works fine. 

 

 

Link to comment
https://forums.phpfreaks.com/topic/130580-solved-passthru-exit-code-255/
Share on other sites

From my understanding the return value is bash's.  And the 255 code means that the program generated a return value that was out of range. 

 

Anyways, I just managed to fix by setting the permissions on these directories as 777

 

It seems that i need to do this with every directory php may write to, even though  I added apache to the same group as my main user who owns these folders.  I guess it's not really a problem since I am the only one who accesses the site, but this still bugs for the long term. 

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.