Find the answer to your Linux question:
Results 1 to 3 of 3
Hi every one, I want apache to do any root command via exec() function like this: exec("service mysqld restart"), I could not do that, also when i tried to copy ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Mar 2008
    Posts
    23

    apache


    Hi every one,
    I want apache to do any root command via exec() function like this:
    exec("service mysqld restart"), I could not do that, also when i tried to copy file by using copy() php function also Icould not copy, but i can copy the empty file, I tried to write php program to copy file and I executed it by shell command #php file.php the result is file copied but when i execute the same script by browser(apache) no file copied
    may be the problem from permission I edidted visudo file and gave apache all permission but no thing changed.
    Can you help me, I sure you can

  2. #2
    Linux Engineer jledhead's Avatar
    Join Date
    Oct 2004
    Location
    North Carolina
    Posts
    1,077
    can I ask why you would want to do that? Seems a big security risk to allow apache to run commands as root. why not use something like webmin if you just want a web gui?

  3. #3
    Just Joined!
    Join Date
    Mar 2008
    Posts
    23

    apache

    the reson is i want to design web-base interface by php to configure asterisk system and in this interface i want to relaod the asterisk after configuration but my problem is i can not do any command like reload asterisk by exec("asterisk -rx reload") as i told

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •