php-windows Digest 1 Jan 2002 07:35:06 -0000 Issue 930

Topics (messages 11239 through 11248):

Re: Is there a FAQ for this list ?
        11239 by: alain samoun

Re: Settings per virtual site on IIS ?
        11240 by: Shane Caraveo

What the hell?!?!
        11241 by: LaserJetter

Passing by reference...
        11242 by: Anthony Ritter
        11243 by: Michael Sims
        11244 by: Anthony Ritter
        11245 by: Michael Sims
        11246 by: Anthony Ritter

Filemanager Problems...
        11247 by: VivoAnt

Re: Using Exec on windows
        11248 by: David

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [EMAIL PROTECTED]


----------------------------------------------------------------------
--- Begin Message ---
No faq, but an archive at:
http://marc.theaimsgroup.com/?l=php-windows&r=1&w=2
A+
Alain

-----Original Message-----
From: Olivier Mascia [mailto:[EMAIL PROTECTED]]
Sent: Monday, December 31, 2001 1:33 AM
To: [EMAIL PROTECTED]
Subject: [PHP-WIN] Is there a FAQ for this list ?


Is there a FAQ for list ?

When subscribed to this list, can I post to it through the related news
group at news.php.net and set the list itself in no-mail mode ?

-- 
Olivier Mascia <[EMAIL PROTECTED]>


-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

--- End Message ---
--- Begin Message ---
Yes, you can use the registry to do per-directory settings.

HKEY_LOCAL_MACHINE\SOFTWARE\PHP\Per Directory Values

Create keys for each directory, then add the entries.  So if you're
website is at c:\inetpub\wwwroot, under the above key, add:

HKEY_LOCAL_MACHINE\SOFTWARE\PHP\Per Directory Values\c\inetpub\wwwroot\

Then add the ini entries.


Olivier Mascia wrote:
> 
> Hello,
> 
> Is there some mechanism with PHP 4.1 on Win32/IIS (ISAPI module)
> allowing to define some initialisation settings per website ?
> 
> Something along the line of Apache php_value/php_flag instructions that
> can be set in its httpd.conf file within virtual-sites settings :
> 
>   php_value include_path ".:/usr/local/lib/php"
>   php_flag safe_mode on
> 
> Or possibility to have the ISAPI module load an additional php.ini local
> to the site in addition to the global one in %SYSTEM% ?
> 
> phpinfo() lists "local" settings and "global" settings.
> Are those necessarily the same with PHP ISAPI on IIS ?
> 
> Thanks for any answer or suggestions,
> --
> Olivier Mascia <[EMAIL PROTECTED]>
> 
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
I've just been preparing a site for upload from my local test server to the
net and have come accross a php.error.log file which was 13.4Mb!
I'm using PHP 4.1.0 and Apache 1.3.19 on Win98se and ever since upgrading to
4.1 PHP
has been creating these error log files all over the place. Does anyone know
what to change in php.ini to stop it doing this?
Also, apart from my coding being rubbish and causing lots of errors, does
anyone know of any reason why an error log file would grow to such a huge
size? The page has onle been accessed a few times and I can't think of any
way a single page could create 1Mb of error text on each hit.

LJ




--- End Message ---
--- Begin Message ---
I'm using Windows98 / Apache and looking at a php snippet from Wrox on page
204.

It goes like this:
..................................
<?
function tax (&$Salary)
 {
  $Salary= $Salary - (($Salary/100)*20);
  return $Salary;
 }
$Salary=2500;
echo $Salary;
?>
......................................

The result in the textbook is 2000 but I'm getting 2500.

It says that to pass an argument by reference you *add* an ampersand to the
front variable that you are passing.

Any help would be appreciated.

Happy new year to all,
Tony Ritter


--- End Message ---
--- Begin Message ---
At 07:37 PM 12/31/2001 -0600, Anthony Ritter wrote:
>..................................
><?
>function tax (&$Salary)
>  {
>   $Salary= $Salary - (($Salary/100)*20);
>   return $Salary;
>  }
>$Salary=2500;
>echo $Salary;
>?>
>......................................
>
>The result in the textbook is 2000 but I'm getting 2500.

That particular snippet of code *should* echo 2500...because you're not 
even calling the function.  You're setting the $Salary variable equal to 
2500 and then immediately echoing it...

Add this line before the last one:

tax($Salary);

And it should then echo 2000...

If you typed it in correctly then the book must have a misprint...

--- End Message ---
--- Begin Message ---
Michael,
The following is the code taken line for line from Wrox - Beginning PHP - on
page 204.
...............................................
<?
function tax (&$Salary)
 {
  $Salary= $Salary - (($Salary/100)*20);
  return $Salary;
 }
$Salary=2500;
echo (tax($Salary));  // This displays $2000
echo $Salary;         // This also displays $2000
?>
........................................

The question really was about the *ampersand* in the argument line which
supposedly changes the value of the variable to 2000 from 2500 because of
the ampersand symbol.

function tax(&$Salary)

Thanking all in advance,
Tony Ritter
........................................................


Michael Sims <[EMAIL PROTECTED]> wrote in message:

> That particular snippet of code *should* echo 2500...because you're not
> even calling the function.  You're setting the $Salary variable equal to
> 2500 and then immediately echoing it...
>
> Add this line before the last one:
>
> tax($Salary);
>
> And it should then echo 2000...
>
> If you typed it in correctly then the book must have a misprint...
.....................................................


--- End Message ---
--- Begin Message ---
At 08:51 PM 12/31/2001 -0600, Anthony Ritter wrote:
>...............................................
><?
>function tax (&$Salary)
>  {
>   $Salary= $Salary - (($Salary/100)*20);
>   return $Salary;
>  }
>$Salary=2500;
>echo (tax($Salary));  // This displays $2000
>echo $Salary;         // This also displays $2000
>?>
>........................................
>
>The question really was about the *ampersand* in the argument line which
>supposedly changes the value of the variable to 2000 from 2500 because of
>the ampersand symbol.

Yes, that is true.  The "tax" function has the ampersand in the argument 
list, which means that any variable that you send to it gets passed by 
reference.  This means that any changes to that variable that occur inside 
the function will actually affect the same variable that is in the scope of 
the main script.  Without the ampersand, the function will only modify it's 
own local copy of the variable and leave the one in the main script 
unaltered.  If you remove the ampersand from the above script and re-run 
it, then the output of the first echo statement should not change, but the 
second one will change to 2500 since the function will no longer be 
altering the variable in the main script.

http://www.php.net/manual/en/language.references.pass.php

Sorry if I'm not understanding your question...



--- End Message ---
--- Begin Message ---
Michael Sims wrote in message:
> Yes, that is true.  The "tax" function has the ampersand in the argument
> list, which means that any variable that you send to it gets passed by
> reference.  This means that any changes to that variable that occur inside
> the function will actually affect the same variable that is in the scope
of
> the main script.  Without the ampersand, the function will only modify
it's
> own local copy of the variable and leave the one in the main script
> unaltered.  If you remove the ampersand from the above script and re-run
> it, then the output of the first echo statement should not change, but the
> second one will change to 2500 since the function will no longer be
> altering the variable in the main script.
>
> http://www.php.net/manual/en/language.references.pass.php
>
> Sorry if I'm not understanding your question...
....................................

Thanks for the reply Michael.   You've answered my question.

A happy and healthy new year to you and yours.
Tony Ritter



--- End Message ---
--- Begin Message ---
I've tried searching on google/yahoo to solve this problem but for some reason I found 
nothing... Wierd...
Anyways ... I'm trying to goto the filemanager page to do stuff but these errors pop 
up:

  Warning: SAFE MODE Restriction in effect. The script whose uid is 11219 is not 
allowed to access /users/ionichost.com/vivoant owned by uid 0 in 
/users/ionichost.com/vivoant/admin/modules/filemanager.php on line 63

  Warning: OpenDir: Permission denied (errno 13) in 
/users/ionichost.com/vivoant/admin/modules/filemanager.php on line 64

  Warning: Supplied argument is not a valid Directory resource in 
/users/ionichost.com/vivoant/admin/modules/filemanager.php on line 65

  Warning: Supplied argument is not a valid Directory resource in 
/users/ionichost.com/vivoant/admin/modules/filemanager.php on line 69 

Warning: SAFE MODE Restriction in effect. The script whose uid is 11219 is not allowed 
to access /users/ionichost.com/vivoant owned by uid 0 in 
/users/ionichost.com/vivoant/admin/case/case.filemanager.php on line 28

???
--- End Message ---
--- Begin Message ---
> 
> Laserjetter said something on 30 Dec 2001, in php.windows:
> 
>> WinZip will need parameters to run from the command line for example
>> to tell it what file to unzip. Did you include these in the command
>> string? WinZip might be waiting for you to press a key or enter some
>> information. It might not be able to find files because the dos window
>> could open at any folder. Did you use absolute path names like
>> c:\winzip\folder (not ..\winzip)?
>> Try using the other executing commands, I think passthru() might work.
>> 
>> LJ
>> "David" <[EMAIL PROTECTED]> wrote in message
>> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... 
>>> Hi,
>>> I'm trying to execute a command line program using exec.
>>> I am tring to run a command line interface of Winzip, simpily by
>>> executing a string which works when it is typed into the command
>>> line. 
>>>
>>> However, PHP just hangs there, I can see the program running the the
>>> background, but it does not do anything.
>>>
>>> When it is run from the command line it takes about 2 seconds to run,
>>> but using exec, it will never finish... 
>>>
>>> Does anyone have any idea with this problem?
>>>
>>> Regards,
>>> David
>> 

In responce to my own question, I believe the problem was some thing with 
the fact the the webserver didn't have permission to perform that 
operation.
If I run the same script on the command line it works like a charm.

Regarsd,
David


--- End Message ---

Reply via email to