You are here: Re: Restart apache using PHP « PHP Programming Language « IT news, forums, messages
Re: Restart apache using PHP

Posted by Tim Roberts on 10/25/05 09:30

"black francis" <cristian.melendez@gmail.com> wrote:
>
>i`m trying to restart apache from php but have failed completely.
>has anyone sucesfully done it?
>
>i'm currently able to execute other unix commands from php adding the
>proper permissions to the sudo file but apache refuses to restart.
>
>here's the pseudo-script:
>
><?php
>...
>$output = shell_exec("/usr/sbin/httpd -k restart");
>exit;
>?>
>(i tried /etc/init.d/httpd too but got the same results)
>
>here's the sudo file
>
>...
>apache ALL = NOPASSWD: /usr/bin/php, /usr/sbin/useradd,
>/usr/sbin/chpasswd, /httpd/scr, /usr/sbin/httpd
>...

Yes, but your shell_exec isn't calling sudo. Did you intend to?
--
- Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация