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

  • SEARCH
  • Home
  • 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 898483
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T15:03:02+00:00 2026-05-15T15:03:02+00:00

I have a program that returns a comma-separated string of numbers after doing some

  • 0

I have a program that returns a comma-separated string of numbers after doing some background processing. I intended to run this in symfony using shell_exec; however, all I get is NULL (revealed through a var_dump(). I tried the following debugging steps.

I ran the file (it’s a PHP class) through a command-line lime unit test in Symfony – it works and gives the correct result there.

Just to check, I tried a simple command ls -l at the same place to see whether I would get anything. Again, I had the same problem – the var_dump in the browser showed NULL, but it worked through the command line.

What could be the problem? Are there restrictions on running shell_exec() in a browser?

EDIT: Just to clarify, shell_exec() commands work when I run them as standalone php scripts on the web server (for example, by putting them in my document root. They don’t seem to be working under the symfony framework, for some reason.

  • 1 1 Answer
  • 3 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-15T15:03:03+00:00Added an answer on May 15, 2026 at 3:03 pm

    I finally solved it, and it turned out to be something quite simple, and quite unrelated.

    The shell command I was running was in this format: face_query -D args. I didn’t realize that Apache would be executing PHP as user www-data and thus the program face_query wouldn’t be in the PATH (the directory is actually ~/bin). Changing the program name to the full path of the program solved it.

    I also gather from this that only commands which www-data has permission to execute can be run. In this case, www-data is in the same group as my user, but it might be a problem otherwise.

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

Sidebar

Related Questions

I have this program that returns a factorial of N. For example, when entering
I have a cherryPy program that returns a page that has an image (plot)
I am learning Java and have a rather simple program that returns a series
I have a program that generates some standard SQL like SELECT * FROM TEST
I have a c++ program that ssh's into a server and runs some commands.
I have a C++ dll that has a function that returns a c string
I have a program in C++ that has a BYTE array that stores some
I have a CSV (comma separated values) file that contains student information. The column
I have a program that returns me a list of file names. I need
I have a program that needs a class file written to make it run

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.