Hello

I am a astudent and my domain area is C++ I am and new
to PHP and all other scripting language. Couldnt hire
a PHP programmer coz of lack of funds :)

The program I wrote was just to learn how to execute a
binary from PHP. My actuall program takes a Name as
the first parameter and generates a registration code
for my software. I wanted a web based interface
wherein a user gives a Name and I can generate a Reg
Code for them and show it as output.

Therefore I do something like this -

./myapp "Karam"

output

a3fdgt567vcx75

Thats it. It only outputs the regcode and nothing
else. This is using some algorithm which is not
possible in PHP so cant use PHP out here :)

I have set the error reporting to full but nothing
happens. The PHP page loads up blank.

Ideally I should be doing something like this -

exec ( "myapp \"Karam\"");

and it should output the regcode?

I dont have any idea about safe mode. My PHP is loaded
up in my Host's server. Can I change the settings? If
yes then what should I do?

Thanks for your help.

Karam

--- Jason Wong <[EMAIL PROTECTED]> wrote:
> On Friday 05 December 2003 14:04, Karam Chand wrote:
> 
> > I created a linux binary using GCC. Whenever you
> > execute it reads a file from the current directory
> and
> > outputs the contents. e.g. -
> >
> > ./myapp
> >
> > output
> >
> > hello world.
> 
> If that is all it does, and that is all you need,
> why not implement it in PHP 
> code?
> 
> > Now I want to execute it from php() so that I can
> > output the content on a HTML page or get the data
> in a
> > variable. Reading thru the manuals i came across
> > passtrhu() and exec().
> >
> > I tried passthru
> >
> > passthru("myapp");
> > and
> > passthru("./myapp");
> >
> > but nothing is outputted. What is wronf?
> 
> 1) enable FULL error reporting
> 2) check safe mode settings
> 
> -- 
> 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
> ------------------------------------------
> /*
> Win98 is called Win98 because you need 98 MB RAM to
> install it.
> */
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


__________________________________
Do you Yahoo!?
Free Pop-Up Blocker - Get it now
http://companion.yahoo.com/

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

Reply via email to