Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6745025
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T12:09:16+00:00 2026-05-26T12:09:16+00:00

I have a linux server running ubuntu 10.10 maverick with apache and php installed,

  • 0

I have a linux server running ubuntu 10.10 maverick with apache and php installed, in the /var/www directory I have a download directory. I have used OSFile manager and modified to include a function to split files here is the code:

function spl($fname){
 global $folder;
 if (!$fname == ""){
    maintop("Split");
    $dirfile = $folder.$fname;

    \\escape directory path
    $dirfile = str_replace(" ","\ ",$dirfile);
    $dirfile = str_replace("(","\(",$dirfile);
    $dirfile = str_replace(")","\)",$dirfile);
    $command = "split -d -b1024m ".$dirfile." ".$fname."_";
    echo "Command: ".$command;
    echo"<br />";


    $returnval =0;
    unset($output2);
    $output = exec($command,$output2,$returnval);

    //echo results
    echo($output);
    echo"<br />";
    print_r($output2);
    echo"<br />";
    echo($returnval);
    echo"<br />";
    mainbottom();
 }
  else
    home();
}

The command does not execute. The file and directory is correct but it returns exit code 1, and Array() as the output values, I have created a group that includes a few users, I have made this group the owner of downloads/ and given it read write and execute permissions, this group includes www-data.

Any Help will be apreciated

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T12:09:17+00:00Added an answer on May 26, 2026 at 12:09 pm

    IF you don’t get any error messages from exec and the error.log stays empty, then use this wrapper for executation:

     exec("sh -c \" $cmd 2>&1 \"");
    

    The 2>&1 redirects the stderr channel to stdout, so that it shows up in the result array.
    In the shell, what does " 2>&1 " mean?

    Another option would be proc_open where you can read each channel separately, but is more work to set up.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

On one Linux Server running Apache and PHP 5, we have multiple Virtual Hosts
I have a server that is running Ubuntu Linux Server Edition. I once had
I have a PHP script (running on a Linux server) that ouputs the names
I have recently installed Ruby 1.9.2 on Linux Ubuntu 10.04 running 0.7.65 when I
I have a running (in production) mysql instance on my linux server (ubuntu-10.10) however
I have a shell account on a Linux server (running Ubuntu 8.04) with user
I bought a domain name with GoDaddy.com. I have a Ubuntu linux server running
i have a problem with my server which is running ubuntu (debian) linux and
I have a Subversion repository (running SVN 1.6.6) on an Ubuntu Linux server, and
I'm new to Linux and have inherited keeping our single linux server running. It's

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.