Re: Can I set environment variables under Win-98 ?
tony@tony.com wrote:
[color=blue]
>
> I've tried:
>
> system("set PATH="%PATH%;e: \;c:\");
> But that doesnt seem to work.
> I thought maybe $_ENV['path='%PATH%;e :\;c:\'];
> But no luck.
>
> Can anyone tell me how please?
>
> thanks
>
> tony[/color]
Alernatively: Didn't win98 had a file called autoexec.bat that contained the
PATH? Or was that DOS only? Not sure.
Try to open it (need right rights of course) and add your piece of the path.
Hi Erwin
[color=blue]
>
> Win 98? Wow. :-)[/color]
yes I like to have a firewall on my internet connection.
[color=blue]
> Did you try to use putenv() ??[/color]
yes the trouble with putenv() is it doesnt seem to work at all under
wondows. (I have PHP version 5.0.2)
It works fine on my linux box but is just ignored by Billy Goats beasty.
I'm trying to make a persistent change that stays there until I change it
back again using PHP without having to use DOS batch files (Which would
as you suggest work - but putting it in a file on the disk would void my
reason for wanting this in the first place).
Re: Can I set environment variables under Win-98 ?
tony@tony.com wrote:[color=blue]
> In article <444f6b58$0$316 41$e4fe514c@new s.xs4all.nl>,
> since_humans_re ad_this_I_am_sp am...yourself.co m says...
>[color=green]
>>...[/color]
>
>
> Hi Erwin
>
>[color=green]
>>Win 98? Wow. :-)[/color]
>
>
> yes I like to have a firewall on my internet connection.
>
>
>[color=green]
>>Did you try to use putenv() ??[/color]
>
>
> yes the trouble with putenv() is it doesnt seem to work at all under
> wondows. (I have PHP version 5.0.2)
>
> It works fine on my linux box but is just ignored by Billy Goats beasty.
>
> I'm trying to make a persistent change that stays there until I change it
> back again using PHP without having to use DOS batch files (Which would
> as you suggest work - but putting it in a file on the disk would void my
> reason for wanting this in the first place).
>
> tony
>[/color]
You can't do it. Win98 only allows a process to change the environment for that
process and it's children. Once the process ends, the environment goes back to
what it was.
It works from a batch file because the process interpreting the batch file is
command.com - the same one which is running your window. But to process a PHP
file, command.com has to start a child process (php.exe). And php.exe can only
change it's environment and those of its children.
About the only thing you might be able to do is run the php program and from
there start a new command.com process. The new one will have the environment
variables you want.
--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp. jstucklex@attgl obal.net
=============== ===
Comment