php-windows Digest 6 Jul 2003 17:06:35 -0000 Issue 1812
Topics (messages 20697 through 20704):
fwrite error (noobie I am)
20697 by: Ron Stephenson
20698 by: Stephen March
20700 by: Ron Stephenson
20704 by: Stephen March
Re: PHP 5 Beta 1 and IIS
20699 by: Denis Bourdon
20703 by: Frank M. Kromann
Test
20701 by: The.Rock
Question w/ Ming
20702 by: Stan Lemon
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 ---
I'm trying to learn PHP and I have it loaded on my PC with XP pro and IIS
5.1. I run the following script and receive the error below.
//hit_counter1.php
$counter_file = "./count.txt";
if(!($fp = fopen($counter_file, "r"))) die ("Cannot open $counter_file.");
$counter = (int) fread($fp, 20);
fclose($fp);
$counter++;
echo "You're visitor No. $counter.";
$fp = fopen($counter_file, "w");
fwrite($fp, $counter);
fclose($fp);
When run I get this error:
You're visitor No. 126.
Warning: fopen(./count.txt) [function.fopen]: failed to create stream:
Permission denied in c:\inetpub\wwwroot\hit_counter1.php on line 12
Warning: fwrite(): supplied argument is not a valid stream resource in
c:\inetpub\wwwroot\hit_counter1.php on line 13
Warning: fclose(): supplied argument is not a valid stream resource in
c:\inetpub\wwwroot\hit_counter1.php on line 14
I though I had set all necessary permissions but I seem to have missed
something. Can someone help? I have been to numerous newsgroups and no one
has been able to figure it out. I know it is something I'm doing wrong.
Ron
--- End Message ---
--- Begin Message ---
If you right click on the file count.txt, go to properties -> security.
Does "everyone" have modify/write permissions to this file? The
first error it posts, is that it doesn't
have permissions to alter the file. This would also account for it
failing to create the stream.
~Steve
Ron Stephenson wrote:
I'm trying to learn PHP and I have it loaded on my PC with XP pro and IIS
5.1. I run the following script and receive the error below.
//hit_counter1.php
$counter_file = "./count.txt";
if(!($fp = fopen($counter_file, "r"))) die ("Cannot open $counter_file.");
$counter = (int) fread($fp, 20);
fclose($fp);
$counter++;
echo "You're visitor No. $counter.";
$fp = fopen($counter_file, "w");
fwrite($fp, $counter);
fclose($fp);
When run I get this error:
You're visitor No. 126.
Warning: fopen(./count.txt) [function.fopen]: failed to create stream:
Permission denied in c:\inetpub\wwwroot\hit_counter1.php on line 12
Warning: fwrite(): supplied argument is not a valid stream resource in
c:\inetpub\wwwroot\hit_counter1.php on line 13
Warning: fclose(): supplied argument is not a valid stream resource in
c:\inetpub\wwwroot\hit_counter1.php on line 14
I though I had set all necessary permissions but I seem to have missed
something. Can someone help? I have been to numerous newsgroups and no one
has been able to figure it out. I know it is something I'm doing wrong.
Ron
--- End Message ---
--- Begin Message ---
That's the part I think I'm missing because when I right click on the file
and go to the properties there is no "Security" tab, button or anything. It
does have two check boxes one for read only (unchecked) and one for Hidden.
This is the Windows Explorer version.
In the IIS properties there is a "File Security" tab, but it doesn't seem to
help. See the attached file. (wouldn't let me send the file Too big I guess)
Thanks
"Stephen March" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> If you right click on the file count.txt, go to properties -> security.
>
> Does "everyone" have modify/write permissions to this file? The
> first error it posts, is that it doesn't
> have permissions to alter the file. This would also account for it
> failing to create the stream.
>
> ~Steve
>
> Ron Stephenson wrote:
>
> >I'm trying to learn PHP and I have it loaded on my PC with XP pro and IIS
> >5.1. I run the following script and receive the error below.
> >//hit_counter1.php
> >$counter_file = "./count.txt";
> >if(!($fp = fopen($counter_file, "r"))) die ("Cannot open
$counter_file.");
> >$counter = (int) fread($fp, 20);
> >fclose($fp);
> >
> >$counter++;
> >
> >echo "You're visitor No. $counter.";
> >
> >$fp = fopen($counter_file, "w");
> >fwrite($fp, $counter);
> >fclose($fp);
> >
> >When run I get this error:
> >
> >You're visitor No. 126.
> >Warning: fopen(./count.txt) [function.fopen]: failed to create stream:
> >Permission denied in c:\inetpub\wwwroot\hit_counter1.php on line 12
> >
> >Warning: fwrite(): supplied argument is not a valid stream resource in
> >c:\inetpub\wwwroot\hit_counter1.php on line 13
> >
> >Warning: fclose(): supplied argument is not a valid stream resource in
> >c:\inetpub\wwwroot\hit_counter1.php on line 14
> >
> >I though I had set all necessary permissions but I seem to have missed
> >something. Can someone help? I have been to numerous newsgroups and no
one
> >has been able to figure it out. I know it is something I'm doing wrong.
> >
> >Ron
> >
> >
> >
> >
> >
> >
>
>
>
--- End Message ---
--- Begin Message ---
Allright, I got ya :)
Open up any folder, let's say My Documents. Then go to the tools menu
=> Folder Options.
From the "view" tab, scroll all the way down, and you should see
something like this:
http://www.enerds.ca/files/screenshots/simple_filesharing.jpg
You must "uncheck" the simple file-sharing.
Now when you right click on the count.txt file, go to properties, you
should see a "Security tab"
Hope this helps!
~Steve.
Ron Stephenson wrote:
That's the part I think I'm missing because when I right click on the file
and go to the properties there is no "Security" tab, button or anything. It
does have two check boxes one for read only (unchecked) and one for Hidden.
This is the Windows Explorer version.
In the IIS properties there is a "File Security" tab, but it doesn't seem to
help. See the attached file. (wouldn't let me send the file Too big I guess)
Thanks
"Stephen March" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
If you right click on the file count.txt, go to properties -> security.
Does "everyone" have modify/write permissions to this file? The
first error it posts, is that it doesn't
have permissions to alter the file. This would also account for it
failing to create the stream.
~Steve
Ron Stephenson wrote:
I'm trying to learn PHP and I have it loaded on my PC with XP pro and IIS
5.1. I run the following script and receive the error below.
//hit_counter1.php
$counter_file = "./count.txt";
if(!($fp = fopen($counter_file, "r"))) die ("Cannot open
$counter_file.");
$counter = (int) fread($fp, 20);
fclose($fp);
$counter++;
echo "You're visitor No. $counter.";
$fp = fopen($counter_file, "w");
fwrite($fp, $counter);
fclose($fp);
When run I get this error:
You're visitor No. 126.
Warning: fopen(./count.txt) [function.fopen]: failed to create stream:
Permission denied in c:\inetpub\wwwroot\hit_counter1.php on line 12
Warning: fwrite(): supplied argument is not a valid stream resource in
c:\inetpub\wwwroot\hit_counter1.php on line 13
Warning: fclose(): supplied argument is not a valid stream resource in
c:\inetpub\wwwroot\hit_counter1.php on line 14
I though I had set all necessary permissions but I seem to have missed
something. Can someone help? I have been to numerous newsgroups and no
one
has been able to figure it out. I know it is something I'm doing wrong.
Ron
--- End Message ---
--- Begin Message ---
Thank you Frank!
It works well :
- libxml2.dll and iconv.dll either in the same folder where php.exe is ->
CGI
- libxml2.dll and iconv.dll (+ php4ts.dll) either in %systemdir%\system32 ->
ISAPI
however I'd like to know how you can keep everything in c\php5 ? Is it only
for CGI configuration ? Do you use the "-c path/file" of php.exe (can't make
it work) ?
Is it possible for the ISAPI config too? as "php4ts.dll" is not named
"php5ts.dll", I can't have PHP4 and PHP5 at the same time?
Thanks for your answer,
den
"Frank M. Kromann" <[EMAIL PROTECTED]> a écrit dans le message de
news:[EMAIL PROTECTED]
> Hi Den,
>
> PHP5 needs libxml2.dll and iconv.dll either in the same folder where
> php.exe (CGI version) is or in %systemdir%\system32.
>
> I prefer to keep everything in c:\php5. That makes it possible to run
> different versions of PHP on the same system.
>
> - Frank
>
> > Hello there!
> >
> > Just wanted to know if anyone succeeded in installing the latest PHP 5
> > Beta 1 under IIS (5 or 6)
> >
> > I tried :
> > - ISAPI configuration : the loading of "php4isapi.dll" by W3SVC failed
> > (I put php4ts.dll and php.ini in %systemdir%)
> > - CGI/EXE configuration : I get the following (I put
> > "cgi.force_redirect = 0" in php.ini) :
> > >> CGI Error
> > >> The specified CGI application misbehaved by not returning
> > >> a complete set of HTTP headers. The headers it did return are:
> >
> > Any idea?
> > PHP5 "structure" seems to be equivalent to the one of PHP4 (DLLs are
> > always named php4___) so I'm wondering if there's a bug in IIS support
> > rather than a new way of installing it compared to PHP4.
> >
> > Thanks in advance for your suggestions
> >
> > den
> >
> >
> >
> > --
> > PHP Windows Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>
>
>
--- End Message ---
--- Begin Message ---
Hi Den,
I have two directories on my system: c:\php4 and c:\php5. In each of these
directories I have all files needed for each version.
php.exe (my cli version)
php-cgi.exe
php4ts.dll
php4isapi.dll
..
all extensions
I then have a directory with all my PHP scripts. Each project in a sub
folder. I have created 3 different virtual directories, all pointing to
the same root; php4, php5 and php5isapi. It is not possible to use both
php4isapi and php5isapi.
For each of these virtual directories I have chreated script mappings on
the .php extension pointing to c:\php4\php-cgi.exe, c:\php5\php-cgi.exe
and c:\php5\php4isapi.dll.
Now I can access the same script vith different PHP versions by changing
my url.
localhost/php4/phpinfo.php
localhost/php5/phpinfo.php
localhost/php5isapi/phpinfo.php
I do not have any files copied to \eindows or \windows\system32 (I using
XP Pro) and all my installations work fine.
- Frank
> Thank you Frank!
> It works well :
> - libxml2.dll and iconv.dll either in the same folder where php.exe is
->
> CGI
> - libxml2.dll and iconv.dll (+ php4ts.dll) either in
%systemdir%\system32 ->
> ISAPI
>
> however I'd like to know how you can keep everything in c\php5 ? Is it
only
> for CGI configuration ? Do you use the "-c path/file" of php.exe (can't
make
> it work) ?
> Is it possible for the ISAPI config too? as "php4ts.dll" is not named
> "php5ts.dll", I can't have PHP4 and PHP5 at the same time?
>
> Thanks for your answer,
>
> den
>
> "Frank M. Kromann" <[EMAIL PROTECTED]> a écrit dans le message de
> news:[EMAIL PROTECTED]
> > Hi Den,
> >
> > PHP5 needs libxml2.dll and iconv.dll either in the same folder where
> > php.exe (CGI version) is or in %systemdir%\system32.
> >
> > I prefer to keep everything in c:\php5. That makes it possible to run
> > different versions of PHP on the same system.
> >
> > - Frank
> >
> > > Hello there!
> > >
> > > Just wanted to know if anyone succeeded in installing the latest PHP
5
> > > Beta 1 under IIS (5 or 6)
> > >
> > > I tried :
> > > - ISAPI configuration : the loading of "php4isapi.dll" by W3SVC
failed
> > > (I put php4ts.dll and php.ini in %systemdir%)
> > > - CGI/EXE configuration : I get the following (I put
> > > "cgi.force_redirect = 0" in php.ini) :
> > > >> CGI Error
> > > >> The specified CGI application misbehaved by not returning
> > > >> a complete set of HTTP headers. The headers it did return are:
> > >
> > > Any idea?
> > > PHP5 "structure" seems to be equivalent to the one of PHP4 (DLLs
are
> > > always named php4___) so I'm wondering if there's a bug in IIS
support
> > > rather than a new way of installing it compared to PHP4.
> > >
> > > Thanks in advance for your suggestions
> > >
> > > den
> > >
> > >
> > >
> > > --
> > > PHP Windows Mailing List (http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> > >
> >
> >
> >
>
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--- End Message ---
--- Begin Message ---
test message
--- End Message ---
--- Begin Message ---
Has anyone here worked with Ming? I have a question about setting a
font, I'm having a real pickle of a time on my Windows machine. Any
help would be appreciated. Thanks.
- Stan
--- End Message ---