1

I'm creating an app using CodeIgniter, but I'm unable to run Linux commands using my PHP script.

How do I run terminal commands?

I've tried shell_exec() and exec(), but both don't work while using CI.

4
  • Which command are you trying to run using exec() ? Commented Apr 26, 2013 at 15:53
  • Put the following command in your php code to make sure that command is working: print exec('whoami'); Probably, there is issue with the command you are trying to run. Please provide more details to figure-out the issue. Commented Apr 26, 2013 at 15:56
  • This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post. Debugging requests like your post should be posted as a comment. Commented Apr 26, 2013 at 17:58
  • sure, i'll take care of that in future. Commented Apr 26, 2013 at 17:59

1 Answer 1

0

That depends on your server configuration if the functions are disabled, you need to enable them in your php.ini. Here are some alternatives:

Sign up to request clarification or add additional context in comments.

1 Comment

commands like ls and pwd are working at their best using system() function but commands like mkdir experience an epic failure

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.