php-windows Digest 3 Jan 2002 03:45:47 -0000 Issue 933
Topics (messages 11266 through 11275):
Re: MSSQL DB Connect
11266 by: Jerry
Re: 500 Internal Server Error
11267 by: Olivier Mascia
Re: Settings per virtual site on IIS ?
11268 by: Olivier Mascia
11269 by: Olivier Mascia
11272 by: Christoph Grottolo
Re: problem login as root
11270 by: Pac mon
PHP and IIS
11271 by: Matt Obstgarten
PHP settings blues
11273 by: Olivier Mascia
Re: Building PHP on Win32
11274 by: Frank M. Kromann
Win Zend IDE 2.0 Question
11275 by: Glen Schoenung
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 ---
Thanks Jeremy, I finally found the solution:
<?php
$query="SELECT * FROM DB1 JOIN DB2 ON DB1.dataid=DB2.dataid";
$queryupd="UPDATE DB1 SET dateval='20010101' where dateval='20000101'";
$hostname = "serverdb";
$username = "user";
$password = "pwd";
$dbName = "DB";
mssql_connect($hostname,$username,$password) or die("DATABASE FAILED TO
RESPOND.");
mssql_select_db($dbName) or DIE("Table unavailable");
$result2 = MSSQL_QUERY($queryupd); // Execute Update Statment
$result = MSSQL_QUERY($query); // Execute Select Statment
$number = MSSQL_NUM_ROWS($result);
$i=0;
if($number == 0) print "No data?";
elseif($number > 0){
print "Number of rows: $number<BR>";
while($i < $number){
$dateval= mssql_result($result,$i,"dateval");
echo "<TR><TD><FONT color=#112266>$dateval</FONT></TD>";
$i++;}
}?>
And it works fine !
Now I'm looking for the same function for IBM DB2 database connection...
Jerry
"Jeremy Reed" <[EMAIL PROTECTED]> wrote:
> What was the error message you received? Also, when passing the variables
> to the mssql_connect() function, you need not use quotes since you've
> already initialized them to the strings. Pass them as follows:
$connection
> = mssql_connect($a,$b,$c). Also, you aren't passing the actual sql string
> to the mssql_query() function. You have $sql = "blah" but you pass
> $sql_temp.
> Jerry wrote:
> > Hi
> > I have PHP on windows 2000 web server
> > I would like to remote to a MS SQL database on another web server.
> > I tried something like:
> > <?php
> > $h = "server adr";
> > $u = "user";
> > $p = "passw";
> > $b = "db";
> > $connexion = mssql_connect("$h", "$u", "$p");
> > mssql_select_db($b);
> > $sql_temp= "select * from test";
> > $result = mssql_query($sql_temp);
> > mssql_close($connexion);
> > ?>
> > But it didn't work. Please help me.
> > Jerry
--- End Message ---
--- Begin Message ---
Hello,
Chris Burwell wrote:
CB> Now i am encountering another problem. It seems session vars do not retain
CB> their values once you leave the page that registers them. I have found
CB> several entries in the bug database about this. My question is does anyone
CB> else encounter this problem, and has anyone solved this problem. Also, does
CB> anyone know if this problem is going to be addressed in future releases of
CB> PHP?
I'm new with PHP and started with 4.1 without getting used to previous
versions. I remember having read that there are numerous changes
regarding global variables and sessions variables in 4.1 compared to
previous versions. Here is how I use sessions variables and it works
flawessly for me with PHP 4.1 / ISAPI / IIS 5.0 :
session_start();
$vcu = &$_SESSION["visitcountupdated"];
...
$vcu = TRUE;
That is, I always act on sessions variables through the $_SESSION array
(I do not make use of the register() function.)
To simplify writing in my scripts I often starts as above by creating a
short-hand variable and have it reference the $_SESSION element as in
the above $vcu = &$_SESSION["visitcountupdated"];
The real session variable is "visitcountupdated", but the variable I use
and update in the script is $vcu which is a shorthand for the other one.
I do not know if that is the best way to do it, but it undoubtly works
great for me on the above configuration.
--
Olivier Mascia <[EMAIL PROTECTED]>
--- End Message ---
--- Begin Message ---
Hello,
Shane Caraveo wrote:
SC> Yes, you can use the registry to do per-directory settings.
SC>
SC> HKEY_LOCAL_MACHINE\SOFTWARE\PHP\Per Directory Values
SC>
SC> Create keys for each directory, then add the entries. So if you're
SC> website is at c:\inetpub\wwwroot, under the above key, add:
SC>
SC> HKEY_LOCAL_MACHINE\SOFTWARE\PHP\Per Directory Values\c\inetpub\wwwroot\
SC>
SC> Then add the ini entries.
It doesn't work well (or completely for me).
If I override 'include_path' (restart IIS) I can see the new local
setting reflected with phpinfo(). Great.
But if also override 'open_basedir' and 'upload_tmp_dir', both these
values keep their default global setting of 'no value' (there is indeed
no values set for these in PHP.INI).
Are there known bugs with this system ? Or could there be some
mis-understanding of how it works on my side ?
I defined three values in the key leaf corresponding to the root of the
website I wanted to test against :
include_path REG_SZ {the physical path of my website}
open_basedir REG_SZ {the same}
upload_tmp_dir REG_SZ {the same}
And obviously only the include_path is taken into account.
I do not know if it is only the first setting which is taken into
account or if there is something un-understood by me regarding the other
two, but it looks buggy.
Thanks in advance for any hint or suggestion !
--
Olivier Mascia <[EMAIL PROTECTED]>
--- End Message ---
--- Begin Message ---
Hello,
Olivier Mascia wrote:
OM> SC> Yes, you can use the registry to do per-directory settings.
OM> SC> HKEY_LOCAL_MACHINE\SOFTWARE\PHP\Per Directory Values
OM> SC> Create keys for each directory, then add the entries. So if you're
OM> SC> website is at c:\inetpub\wwwroot, under the above key, add:
OM> SC> HKEY_LOCAL_MACHINE\SOFTWARE\PHP\Per Directory Values\c\inetpub\wwwroot\
OM> SC> Then add the ini entries.
OM>
OM> It doesn't work well (or completely for me).
OM> If I override 'include_path' (restart IIS) I can see the new local
OM> setting reflected with phpinfo(). Great.
OM> But if also override 'open_basedir' and 'upload_tmp_dir', both these
OM> values keep their default global setting of 'no value' (there is indeed
OM> no values set for these in PHP.INI).
OM>
OM> Are there known bugs with this system ? Or could there be some
OM> mis-understanding of how it works on my side ?
OM>
OM> I defined three values in the key leaf corresponding to the root of the
OM> website I wanted to test against :
OM>
OM> include_path REG_SZ {the physical path of my website}
OM> open_basedir REG_SZ {the same}
OM> upload_tmp_dir REG_SZ {the same}
OM>
OM> And obviously only the include_path is taken into account.
OM> I do not know if it is only the first setting which is taken into
OM> account or if there is something un-understood by me regarding the other
OM> two, but it looks buggy.
OM>
OM> Thanks in advance for any hint or suggestion !
There must be something wrong on my way of thinking.
I checked the PHP source code and it looks like the loop to iterate over
the values in the registry is correct. Indeed I have another value which
I can change the local value without difficulties : 'sendmail_from'.
That is correctly reflected as locally changed (as well as 'include_path')
by phpinfo(). Though 'open_basedir' and 'upload_tmp_path' are still not
taken into account.
I'm a little bit lost in conjectures World !
:-)
--
Olivier Mascia <[EMAIL PROTECTED]>
--- End Message ---
--- Begin Message ---
"Olivier Mascia" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
| Hello,
|
| Olivier Mascia wrote:
|
| OM> SC> Yes, you can use the registry to do per-directory settings.
| OM> SC> HKEY_LOCAL_MACHINE\SOFTWARE\PHP\Per Directory Values
| OM> SC> Create keys for each directory, then add the entries. So if
you're
| OM> SC> website is at c:\inetpub\wwwroot, under the above key, add:
| OM> SC> HKEY_LOCAL_MACHINE\SOFTWARE\PHP\Per Directory
Values\c\inetpub\wwwroot\
| OM> SC> Then add the ini entries.
| OM>
| OM> It doesn't work well (or completely for me).
| OM> If I override 'include_path' (restart IIS) I can see the new local
| OM> setting reflected with phpinfo(). Great.
| OM> But if also override 'open_basedir' and 'upload_tmp_dir', both these
| OM> values keep their default global setting of 'no value' (there is
indeed
| OM> no values set for these in PHP.INI).
| OM>
| OM> Are there known bugs with this system ? Or could there be some
| OM> mis-understanding of how it works on my side ?
| OM>
| OM> I defined three values in the key leaf corresponding to the root of
the
| OM> website I wanted to test against :
| OM>
| OM> include_path REG_SZ {the physical path of my website}
| OM> open_basedir REG_SZ {the same}
| OM> upload_tmp_dir REG_SZ {the same}
| OM>
| OM> And obviously only the include_path is taken into account.
| OM> I do not know if it is only the first setting which is taken into
| OM> account or if there is something un-understood by me regarding the
other
| OM> two, but it looks buggy.
| OM>
| OM> Thanks in advance for any hint or suggestion !
|
| There must be something wrong on my way of thinking.
| I checked the PHP source code and it looks like the loop to iterate over
| the values in the registry is correct. Indeed I have another value which
| I can change the local value without difficulties : 'sendmail_from'.
| That is correctly reflected as locally changed (as well as 'include_path')
| by phpinfo(). Though 'open_basedir' and 'upload_tmp_path' are still not
| taken into account.
|
I'm pretty shure you can't change open_basedir and upload_tmp_path values
because of security issues. I think the IIS-per directory settings are
parsed like the values in the .htaccess file with apache.
So if the user could change the'open_basedir' value, he would be able to
access any file on the server with php by just putting
open_basedir="/";
into .htaccess (think of an ISP environment). I think I've read an article
about that somewhere, but I can't remember where, sorry.
Christoph
--- End Message ---
--- Begin Message ---
Did you mean to delete the column!? I'd suggest just backing up the data and
reinstalling MYSQL. Then restoring the data.
Easiest and most likely to work..
>
>Help me!!! I have problem login as root at my MySQL. I remember the last
>thing I did before this happened, is that I deleted the root column from
>user table from mysql database. Since then, I can login as root (without
>password), but when I want to use the databases, I can't. I also cannot
>grant(give privileges), It seemed like I login as a user, not an
>administrator. Can somebody please help me? Thank you.
>
>
>
>--
>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]
>
_________________________________________________________________
MSN Photos is the easiest way to share and print your photos:
http://photos.msn.com/support/worldwide.aspx
--- End Message ---
--- Begin Message ---
Hello,
I am new to PHP. I have PHP (cgi version) configured on my
machine running XP Pro and IIS. It works fine. The first script I wanted
to write was the ever-useful feedback form script where the contents of
a form are e-mailed to the webmaster. I am sure that I have a working
script but when I test on my machine I get a server error. I realize
that this is most likely because I don't have any mail settings
configured on IIS (new to this as well). I was wondering if someone
could give me some advice on how to properly set this up so I can
locally test mail scripts like this. Thanks,
Matt
--- End Message ---
--- Begin Message ---
In order to setup my server correctly (using IIS 5, PHP 4.1 as ISAPI)
and offer PHP services to the people who have some small virtual websites
hosted on that machine, I fell on the following problem.
The per directory settings that can be set through the registry do not
allow me to restrict 'open_basedir'. I can only set it through the
system wide PHP.INI in %WINDOWS%\PHP.INI.
This means I am left with the only option to set aside a tree on the
server and set the global open_basedir to that tree. At least my users
won't have access to all the disks. But they will share a common tree.
And that is not a very good idea for privacy purposes. Of course I admit
I depict a situation a little bit darker that in real life. The IUSR_...
user (identity under which the IIS runs) does not have access to many
things on the system, so basically I can restrict people from going
everywhere by carefully setting the file system access lists. But it
would be so easy and comfortable to be able to preset all these websites
to distinct cleary isolated subtrees by virtue of 'open_basedir'.
I first thought of a bug. Then I found the following page :
<http://www.php.net/manual/en/function.ini-set.php>
which states that 'open_basedir' is a 'PHP_INI_SYSTEM' setting.
Conceptually what was the intent ?
On Apache, if I had some per-directory settings in the httpd.conf file,
are those considered SYSTEM settings or per-directory settings for this
purpose ?
How do system administrators do with Apache (and IIS) to restrict users
(who have rights to maintain one virtual web-site) to not be able to use
PHP scripts to access any info outside of some clearly defined world ?
Isn't it what open_basedir is all about at first and don't you have the
feeling it is defeated by not being updatable on a per_directory level
by the administrator ?
The funny thing is that the PHP.INI file says the following comment
about open_basedir :
; open_basedir, if set, limits all file operations to the defined directory
; and below. This directive makes most sense if used in a per-directory
; or per-virtualhost web server configuration file.
Yep, but at least with the way the per-directory settings are
implemented on Win32, that intent is defeated.
Do you think this should be logged in as bug ?
--
Olivier Mascia <[EMAIL PROTECTED]>
--- End Message ---
--- Begin Message ---
So far it works fine with MS VC++. I dont think it is possible to build it with gcc at
this point.
If you want binaries from the latest CVS you can download them from
http://kromann.info/php4.php. This page is updated each morning at 4 am PST.
- Frank
> Hi all,
>
> Has anyone had luck building PHP from source on Windows? In particular, has
> anyone pulled it off using gcc rather than Visual C++?
>
> Thanks,
> Fred Woolsey
>
> --
> 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 ---
Have been trying to get the Zend 2.0 IDE to run with no luck. The IDE
seems to work except ant time I try to run a program nothing appears in
the output window. Also it seems that stepping through a program or
adding watches does nothing. Any experiences suggestions?
--
__O
_-\<,_
(+)/ (+)
--- End Message ---