LinuxQuestions.org
Visit Jeremy's Blog.
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 07-21-2004, 12:50 PM   #1
guideweb
Member
 
Registered: Mar 2004
Location: /planet/earth
Posts: 110

Rep: Reputation: 15
PHP HOWTO : Run script as root


Hi,


I need to (if it possible) run a php script as user ROOT with apache.


Do you have any idea how i can do this ?



Thanks for help
 
Old 07-21-2004, 01:59 PM   #2
Mega Man X
Guru
 
Registered: Apr 2003
Location: ~
Distribution: Ubuntu, FreeBSD, Solaris, DSL
Posts: 5,339

Rep: Reputation: 63
Re: PHP HOWTO : Run script as root

Quote:
Originally posted by guideweb
Hi,


I need to (if it possible) run a php script as user ROOT with apache.


Do you have any idea how i can do this ?



Thanks for help
I did not quite understand your question. PHP script is embedded with the html code. Basically, you write PHP into html tags. PHP will only work when you upload your page to the server. Here is an example:

PHP Code:

<html>

<body>


<?php

$myvar 
"guideweb";

echo 
$myvar;

?>


</body>

</html>
PHP code starts with "<?php" and ends with "?>". Save that page as index.php and put on your server (usually at /var/www/index.html).

Assuming that you have apache with PHP modules support, that should work..

Is that what you mean?
 
Old 07-24-2004, 12:38 AM   #3
guideweb
Member
 
Registered: Mar 2004
Location: /planet/earth
Posts: 110

Original Poster
Rep: Reputation: 15
No


i have a php script myscript.php
admin go to page exemple.com/myscript.php ( login required )
myscript.php need to do something as user root but i cant run apache as root
 
Old 08-22-2004, 11:38 PM   #4
techrolla
Member
 
Registered: Nov 2003
Distribution: Gentoo, Debian
Posts: 188

Rep: Reputation: 30
execute a shell_exec command?
 
  


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
HOWTO Run as root in graphical environment fedix Fedora 7 10-14-2005 02:39 PM
How do I run a PHP script as a service? robbiemorgan Linux - Newbie 3 04-13-2005 02:03 PM
howto run a script from cron every 5 minutes except 11pm-8am ? cccc Programming 2 03-20-2005 03:52 AM
howto start vpnclient with php script and sudo ? cccc Programming 1 01-12-2004 11:46 AM
help getting pptp-php-gtk.php to run as root mrtwice Linux - Software 0 11-21-2003 12:49 PM


All times are GMT -5. The time now is 07:07 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration