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
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. 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.