LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 06-10-2006, 05:14 AM   #1
suruchi
LQ Newbie
 
Registered: Jun 2006
Posts: 2

Rep: Reputation: 0
Question exec command not working


i tried to run exec, system command with php script but not working
not able to find out any reason

/// test.php
<?

echo exec('whoami');
echo shell_exec('whoami');
echo system('whoami');
?>

but no results when tried from browser to run this file


but when i tried to run this php from prompt it works perfectly
php test.php


i could'nt find reason y this is happening


please put ur thoughts

Last edited by suruchi; 06-12-2006 at 02:00 AM.
 
Old 06-11-2006, 12:11 AM   #2
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,290

Rep: Reputation: 378Reputation: 378Reputation: 378Reputation: 378
Probably PHP safe mode is enabled. Safe mode will prevent PHP, as invoked from Apache, from executing any executables except in precepicief directories (see the safe_mode_exec_dir parameter in your php.ini to see what this is set to). Believe me, safe mode is a good thing that helps prevent people from exploiting buggy PHP scripts to exploit your system (it's not perfect, or anywhere close, but it helps).
 
Old 06-12-2006, 02:02 AM   #3
suruchi
LQ Newbie
 
Registered: Jun 2006
Posts: 2

Original Poster
Rep: Reputation: 0
Unhappy exec not working

Quote:
Originally Posted by btmiller
Probably PHP safe mode is enabled. Safe mode will prevent PHP, as invoked from Apache, from executing any executables except in precepicief directories (see the safe_mode_exec_dir parameter in your php.ini to see what this is set to). Believe me, safe mode is a good thing that helps prevent people from exploiting buggy PHP scripts to exploit your system (it's not perfect, or anywhere close, but it helps).


i set safe_mode_exec_dir variable to "On" in php.ini but still not working
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
redhat 9.0 how to use the command 'find' with the action -exec arvin_shu Linux - Newbie 3 11-30-2005 08:09 AM
monitor mail box and exec command brumela Linux - General 2 05-30-2005 09:13 AM
exec bash command bendeco13 Linux - General 6 10-31-2004 04:50 PM
php: output the result of exec( $command ) zovres Programming 6 08-27-2004 07:41 PM
Kylix (delphi) missing exec command? RayJ Programming 2 09-24-2003 01:35 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:36 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration