[PHP] exec, passthru calling /usr/local/bin/php4 problem

2003-06-24 Thread Devin

I am currently using Apache 1.3.27, PHP 4.3.2 and our server is
configured to force all users to use PHP as a script by calling
#!/usr/local/bin/php at the top of each script causing suexec to control
scripts. I noticed a really strange thing from one of our users. I have
tested the following and get error message about unable to fork
("/usr/local/bin/php") error.

I created a simple test.php file that contains:
#!/usr/local/bin/php 


The somefile.php contains:


However when I run test.php from within a browser I get the following as
the output:

Content-type: text/html
X-Powered-By: PHP/4.3.2

Content-type: text/html
X-Powered-By: PHP/4.3.2

Content-type: text/html
X-Powered-By: PHP/4.3.2

Content-type: text/html
X-Powered-By: PHP/4.3.2

Content-type: text/html
X-Powered-By: PHP/4.3.2

Content-type: text/html
X-Powered-By: PHP/4.3.2


Warning:  passthru(): Unable to fork 
[/home/u/utefans/public_html/ftml_templates/test.php] in 
/home/u/utefans/public_html/ftml_templates/test.php on line 4

Does anyone have any idea what is happening? It appears as if the PHP binary runs over 
and over
until it finally freaks out and gives "unable to fork" error message. Any help
would greatly be appreciated.

Devin Atencio



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] exec(), passthru()

2003-06-19 Thread Jason Wong
On Friday 20 June 2003 00:11, Mignon Hunter wrote:

> I am trying to use either of the functions above to execute a compiled c
> program on linux.  The command line works with ./a.out (a.out being the
> filename).  Both my test.php and the exe are in the same directory.
> I've tried combinations of all the following. Thx Mignon

What exactly do you want to do? exec() & passthru() have different uses. Do 
you want to capture the output of the program? The exit value? Or what?

When running external programs from PHP I find that it helps to specify the 
full path to the program. And you have made sure that you have the right 
permissions to execute said program?

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
Valerie: Aww, Tom, you're going maudlin on me ...
Tom: I reserve the right to wax maudlin as I wane eloquent ...
-- Tom Chapin
*/


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] exec(), passthru()

2003-06-19 Thread Mignon Hunter
hello all,

I am trying to use either of the functions above to execute a compiled c
program on linux.  The command line works with ./a.out (a.out being the
filename).  Both my test.php and the exe are in the same directory. 
I've tried combinations of all the following. Thx Mignon

http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] exec(), passthru(), system() and shell_exec() hang.

2003-04-01 Thread Lasse Riis
Hi everyone.

I'm running a RedHat Linux 8.0 server with php 4.2.2 on apache. I'm
having trouble using the system execution commands. If any of these
commands are included in my script it hangs, I don't even get output
that is flushed before the command:
echo 'Text to be flushed';
flush();
$ud = passthru('command parameters');
What's wrong? The command executed is "sudo service dansguardian
restart". I'm making a web interface for updating a config file for the
service dansguardian. But the changes won't be used before the service
has been restarted. On my old setup (RH 7.3) i could at least get the
output with system() or passthru(), but the script would still hang. Now
I get nothing. Well except if I comment out the system command, then
everything works fine (no infinite loops that could cause the hang), but
that doesn't get my service restarted
I have edited my /etc/sudoers file so that the apache user can execute
/sbin/service. It works fine in console (with another username (can't
really su to apache))
Help me
Lasse Riis
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] exec/passthru: io operation not permitted

2003-02-28 Thread ati ati
Hello all,
I've installed PHP 4.1.2 to the Apache Web server,
and I wanted to control IO ports. But I always got
  "error: Cannot open /dev/port: Operation not permitted "
or
   "error: ioperm: Operation not permitted "
I played with the httpd.conf -  ... 
 ...
no success. I have root access.
Any help aprecaited.
Thanks






_
The new MSN 8: smart spam protection and 2 months FREE*  
http://join.msn.com/?page=features/junkmail

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php