php-windows Digest 6 Feb 2002 21:12:59 -0000 Issue 989
Topics (messages 11861 through 11881):
Re: Embeded MySQL
11861 by: Martin Lindhe
fopen / relativ links
11862 by: Patricio Galeas
apache/tomcat/php configuration problems...
11863 by: Martin.Andrew
11866 by: Pac mon
11870 by: Nicole Amashta
DOS box, scheduled tasks, PHP script
11864 by: DL Neil
11875 by: DL Neil
11876 by: Ziggi
11878 by: DL Neil
Re: undefined variable
11865 by: Pac mon
accessing mssql2k from win2k with PHP4.1.1
11867 by: chris
11868 by: Mike Maltese
php4, IIS5 and mssql8 problems
11869 by: chris
11871 by: Nicole Amashta
A good question to PHP gurus...
11872 by: Ziggi
11873 by: Richard Black
Trouble with GD - any suggestions?
11874 by: Michel Laine
.bat files for PHP
11877 by: Ziggi
Re: Help needed on point system
11879 by: Hugh Bothwell
For some reason this message didn't get through before
11880 by: Pac mon
Access to network shares
11881 by: Michael A. Fallavollita, Ph.D.
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 ---
> Yes! MySQL is install with the distribution, but I want to
> run mysql not on the server but along with my application.
> Embeded MySQL runs from a library libmysql.dll. Mysql.com
> just mentions that this makes it possible to distribute mysql
> with cd-rom applications.
Check out http://www.mysql.com/doc/C/l/Clients.html
for documentation and links to the various APIs available for using MySQL in
your programs
/Martin
--- End Message ---
--- Begin Message ---
Hello :
I tried to use :
$fn=fopen("http://WEB-address", "r");
But I have problems when the HTML document has relative LINKS or images with
relativ path.
This Links have my Server-Address as Path. !!
How can I solve it
Thank You for your Help
Please response to : [EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
This probably isn't a PHP problem but it does effect my php sites, so maybe
someone has some ideas what I'm doing wrong.
The current configuration Linux (debian) OS, Apache webserver, MySQL and PHP
4 all works fine.
I would like to configure Tomcat 3.3 for JSP pages/sites on the same server,
here is where the problems start.
Tomcat was configered normally and I get it running without problems on port
8080,
so
http://localhost/ shows the apache home page and all sub php sites work
fine.
http://localhost:8080 shows tomcat home page and all sub jsp/servlet driven
sites work fine
Of course 8080 must be removed from the url but changing the port to default
80 in server.xml results in the php sites no longer working although
jsp/servelts work fine.
Note: the tomcat webapps folder is in a different directory than the apache
document root (not sure if this can cause problems)
Any help much appreciated,
Andrew
--- End Message ---
--- Begin Message ---
I'm not too familiar with Tomcat, but I did some breif research and I was
curious if you were using mod_jk or the webapp module?
>
>This probably isn't a PHP problem but it does effect my php sites, so maybe
>someone has some ideas what I'm doing wrong.
>
>The current configuration Linux (debian) OS, Apache webserver, MySQL and
>PHP
>4 all works fine.
>
>I would like to configure Tomcat 3.3 for JSP pages/sites on the same
>server,
>here is where the problems start.
>Tomcat was configered normally and I get it running without problems on
>port
>8080,
>
>so
>
>http://localhost/ shows the apache home page and all sub php sites work
>fine.
>http://localhost:8080 shows tomcat home page and all sub jsp/servlet driven
>sites work fine
>
>Of course 8080 must be removed from the url but changing the port to
>default
>80 in server.xml results in the php sites no longer working although
>jsp/servelts work fine.
>Note: the tomcat webapps folder is in a different directory than the apache
>document root (not sure if this can cause problems)
>
>Any help much appreciated,
>
>Andrew
>
_________________________________________________________________
Chat with friends online, try MSN Messenger: http://messenger.msn.com
--- End Message ---
--- Begin Message ---
I thougth there was a version of tomcat that you used with apache so that
the 2 could work together. Go back to the apache site and find it.
http://jakarta.apache.org/tomcat/
I know you can set this up to work together. Sorry, I haven't done it enough
(only a couple times) to know or remember what to do to get it working. =P
good luck,
nicole amashta
www.aeontrek.com
"Martin.Andrew" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> This probably isn't a PHP problem but it does effect my php sites, so
maybe
> someone has some ideas what I'm doing wrong.
>
> The current configuration Linux (debian) OS, Apache webserver, MySQL and
PHP
> 4 all works fine.
>
> I would like to configure Tomcat 3.3 for JSP pages/sites on the same
server,
> here is where the problems start.
> Tomcat was configered normally and I get it running without problems on
port
> 8080,
>
> so
>
> http://localhost/ shows the apache home page and all sub php sites work
> fine.
> http://localhost:8080 shows tomcat home page and all sub jsp/servlet
driven
> sites work fine
>
> Of course 8080 must be removed from the url but changing the port to
default
> 80 in server.xml results in the php sites no longer working although
> jsp/servelts work fine.
> Note: the tomcat webapps folder is in a different directory than the
apache
> document root (not sure if this can cause problems)
>
> Any help much appreciated,
>
> Andrew
>
>
--- End Message ---
--- Begin Message ---
Have a 'monitoring' PHP command line script timed to run hourly.
Controlled by the new?IE5.5 Scheduled Tasks facility (as listed in Windows Explorer -
not quite the same as AT
(which is what I have used previously) )
Script is kicked off by a batch file.
Batch file is object in scheduled tasks entry.
When it fires, a DOS box opens, the batch file is executed, PHP kicks in; and upon
completion, breaks down in
the reverse sequence.
Works perfectly but...
How can one achieve this in the background - without popping up a DOS box over the top
of whatever else is
happening?
(and annoying the socks off an admin killing a printer/adding new users, etc)
Please advise,
=dn
WinNT4.0 SP6a, IE5.5 SP2, PHP vn 4.0.6, Apache vn 1.3.20WinNT, MySQL vn 3.23.40-nt
--- End Message ---
--- Begin Message ---
Thank you Pac mon, the idea of running the scheduled tasks under a different userId
(to the console operator)
certainly does stop the 'DOS box' (console window) putting in uninvited appearance.
Neat thinking!
Many thanks to all who contributed suggestions.
Mike: if PHP is run directly (as per the Scheduled Task Wizard) a 'DOS box' still
fires up - unless presumably
one uses Pac mon's technique, ie it is not the batch file that causes the DOS
box/console window to pop up.
The reason for the batch file is because there is a series of dependent tasks - the
second must not start until
the first has (successfully) completed, etc - and thus they are in a single
batch/command file, rather than
(say) a series of scheduled tasks (with individual command lines).
Alan: search.microsoft.com seems packed with helpful advice on programming such things
(MSDN) - which one has to
wade through before coming across a simple 'how to use from Win Explorer'. I didn't
want to have to write a
whole routine to use something I figured should be staring me in the face from the
GUI. The whole episode made
me think in terms of going 'back' to AT and NET commands...
Per your suggestion - and thoughts of similar switches when preparing .PIF files to
run in the background - I
was going round and round looking for what I figured would be a simple check box - but
no...
So new answer to the FAQ: run PHP scripts from the command line/a batch file on a
regular basis using "Scheduled
Tasks" AND running under a dedicated background userId!
=dn
> You could run it as a different user.
> i.e. Create user tasker. Change the Task to logon to the tasker account.
> you will no longer see the window.
> >Have a 'monitoring' PHP command line script timed to run hourly.
> >Controlled by the new?IE5.5 Scheduled Tasks facility (as listed in Windows
> >Explorer - not quite the same as AT
> >(which is what I have used previously) )
> >Script is kicked off by a batch file.
> >Batch file is object in scheduled tasks entry.
> >
> >When it fires, a DOS box opens, the batch file is executed, PHP kicks in;
> >and upon completion, breaks down in
> >the reverse sequence.
> >Works perfectly but...
> >
> >How can one achieve this in the background - without popping up a DOS box
> >over the top of whatever else is
> >happening?
> >(and annoying the socks off an admin killing a printer/adding new users,
> >etc)
> >
> >Please advise,
> >=dn
> >
> >WinNT4.0 SP6a, IE5.5 SP2, PHP vn 4.0.6, Apache vn 1.3.20WinNT, MySQL vn
> >3.23.40-nt
--- End Message ---
--- Begin Message ---
Hi !
Did you mean to run the scheduled task as a differnt user (for instance not
as Administrator) ?
By default there are two users under Win2000: Administrator and SYSTEM.
Will setting the scheduled task under SYSTEM will stop this stupid DOS box
from poping-up - how do you think ?
Or it's a must to define a separate "dummy" user with necessary privilidges
to run such scripts withou DOS box ?
Ziggi
-------------------------------------------------
"Dl Neil" <[EMAIL PROTECTED]> wrote in message
009901c1af2b$78cdc3d0$c200a8c0@jrbrown">news:009901c1af2b$78cdc3d0$c200a8c0@jrbrown...
> Thank you Pac mon, the idea of running the scheduled tasks under a
different userId (to the console operator)
> certainly does stop the 'DOS box' (console window) putting in uninvited
appearance. Neat thinking!
>
> Many thanks to all who contributed suggestions.
>
> Mike: if PHP is run directly (as per the Scheduled Task Wizard) a 'DOS
box' still fires up - unless presumably
> one uses Pac mon's technique, ie it is not the batch file that causes the
DOS box/console window to pop up.
> The reason for the batch file is because there is a series of dependent
tasks - the second must not start until
> the first has (successfully) completed, etc - and thus they are in a
single batch/command file, rather than
> (say) a series of scheduled tasks (with individual command lines).
>
> Alan: search.microsoft.com seems packed with helpful advice on programming
such things (MSDN) - which one has to
> wade through before coming across a simple 'how to use from Win Explorer'.
I didn't want to have to write a
> whole routine to use something I figured should be staring me in the face
from the GUI. The whole episode made
> me think in terms of going 'back' to AT and NET commands...
> Per your suggestion - and thoughts of similar switches when preparing .PIF
files to run in the background - I
> was going round and round looking for what I figured would be a simple
check box - but no...
>
>
> So new answer to the FAQ: run PHP scripts from the command line/a batch
file on a regular basis using "Scheduled
> Tasks" AND running under a dedicated background userId!
>
> =dn
>
>
>
> > You could run it as a different user.
> > i.e. Create user tasker. Change the Task to logon to the tasker account.
> > you will no longer see the window.
>
>
> > >Have a 'monitoring' PHP command line script timed to run hourly.
> > >Controlled by the new?IE5.5 Scheduled Tasks facility (as listed in
Windows
> > >Explorer - not quite the same as AT
> > >(which is what I have used previously) )
> > >Script is kicked off by a batch file.
> > >Batch file is object in scheduled tasks entry.
> > >
> > >When it fires, a DOS box opens, the batch file is executed, PHP kicks
in;
> > >and upon completion, breaks down in
> > >the reverse sequence.
> > >Works perfectly but...
> > >
> > >How can one achieve this in the background - without popping up a DOS
box
> > >over the top of whatever else is
> > >happening?
> > >(and annoying the socks off an admin killing a printer/adding new
users,
> > >etc)
> > >
> > >Please advise,
> > >=dn
> > >
> > >WinNT4.0 SP6a, IE5.5 SP2, PHP vn 4.0.6, Apache vn 1.3.20WinNT, MySQL vn
> > >3.23.40-nt
>
>
--- End Message ---
--- Begin Message ---
Hi Ziggi,
> Did you mean to run the scheduled task as a differnt user (for instance not
> as Administrator) ?
>
> By default there are two users under Win2000: Administrator and SYSTEM.
> Will setting the scheduled task under SYSTEM will stop this stupid DOS box
> from poping-up - how do you think ?
>
> Or it's a must to define a separate "dummy" user with necessary privilidges
> to run such scripts withou DOS box ?
Some organisations make a (security) practice out of removing the default accounts
from all systems. Sometimes a
server is left logged in, to either an admin or an 'operator' account all the time.
Sometimes consoles may not
be left logged-in whilst unattended...
The problem arises (as best I can make out) when the script is being run under the
same username as the
currently logged-in user. That's the only relationship that really matters!
Accordingly I set up a script-operator group (as per the printer-operators group), set
up a dummy user and made
it a member of script-operators, banned local and remote log-ins, and then set up
privileges/access to required
resources, eg db.
Then using an admin account, transferred the necessary 'bits', and set up the
scheduled task to run on the
server - using the script-operator account/pswd.
Such a rigmarole, but at least the console ops are not complaining any more (and how
come they only ever seemed
to use the console at the same time after the hour that the script was set to run? I
reckon there was another
'solution' - change the scheduled time/cycle...)
Regards,
=dn
--- End Message ---
--- Begin Message ---
or simply declare your variables:
var $user1, $password1;
>
> > Hello everyone,
> > I have a small question:
> > How can I get rid of "Warning: Undefined variable: user1(&
> > password1) in C:\WebShare\wwwroot\netk\5\login.php on line 4"
> > in that program?
> >
> > <?php
> > include ("config.php");
> > session_register("userpassword");
> > if($user1==$USER && $password1==$PASSWORD) {
> > $userpassword = $user1.$password1;
> > header("Location:index.php");
> > exit();
> > }
> > ?>
>-[snip]-
>
>the proper way of doing this would be
>if (isset($user1) && isset($password1) && $user1==$USER &&
>$password1==$PASSWORD) {
>...
>
>Or you can just turn off warnings in php.ini, as Nicole suggests :)
>
>/Martin
>
>--
>PHP Windows Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
>
_________________________________________________________________
Send and receive Hotmail on your mobile device: http://mobile.msn.com
--- End Message ---
--- Begin Message ---
im having major problems with this combination.
it seems that all other functions are working properly.
when i try to access my mssql DB i get this msg :
"test PHP Fatal error: Call to undefined function: mssql_connect() in
c:\inetpub\wwwroot\testsite\test2.php on line 3 "
any idea? any help is highly apriciated.
Thanks :)
Chris
--- End Message ---
--- Begin Message ---
You probably don't have the MS SQL extension loaded. Uncomment in in the
php.ini file.
Mike
----- Original Message -----
From: "chris" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, February 06, 2002 6:23 AM
Subject: [PHP-WIN] accessing mssql2k from win2k with PHP4.1.1
> im having major problems with this combination.
> it seems that all other functions are working properly.
> when i try to access my mssql DB i get this msg :
> "test PHP Fatal error: Call to undefined function: mssql_connect() in
> c:\inetpub\wwwroot\testsite\test2.php on line 3 "
>
> any idea? any help is highly apriciated.
> Thanks :)
>
> Chris
>
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--- End Message ---
--- Begin Message ---
Im having huge problems with this.
everything else works just fine, i just cant get my mssql functions to work.
all my calendar and mail mailfunctions are working. whats wrong here?
Doesnt php4 support mssql8??? is that my problem? all help will be
apriciated.
--- End Message ---
--- Begin Message ---
be sure to enable the mssql.dll in your php.ini under the extensions
section. And be sure your extensions path is set, which soudn like it is.
Then, be sure you have the appropriate mssql.dll .. the one I have works
fine with mssql 2000. So, if you want me to send you the dll I have, let me
know.
good luck,
nicole amashta
www.aeontrek.com
"Chris" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Im having huge problems with this.
> everything else works just fine, i just cant get my mssql functions to
work.
> all my calendar and mail mailfunctions are working. whats wrong here?
> Doesnt php4 support mssql8??? is that my problem? all help will be
> apriciated.
>
>
--- End Message ---
--- Begin Message ---
Hi !
A good question to PHP gurus:
Platform:
PHP4/Win2k:
How to:
Execute a specific php script on a server side periodically?
For instance - I would like to construct a mailing automaton sending mails
on a basis of specific criteria to the customers of my client. He would like
it to send mails only overnight and no more but a few mails per minute. I
can write a good php script for database connectivity and mailing procedure
itself, but I don't know how to force the server to run it periodically by
itself.
Any ideas ???
Please...
Ziggi
--- End Message ---
--- Begin Message ---
You can run the script from the command line, using php.exe. Wrapping this
inside a .bat file you can schedule this task to run periodically, using
the Windows Task Scheduler.
HTH
Richy
==========================================
Richard Black
Systems Programmer, DataVisibility Ltd - http://www.datavisibility.com
Tel: 0141 435 3504
Email: [EMAIL PROTECTED]
-----Original Message-----
From: Ziggi [SMTP:[EMAIL PROTECTED]]
Sent: 06 February 2002 15:18
To: [EMAIL PROTECTED]
Subject: [PHP-WIN] A good question to PHP gurus...
Hi !
A good question to PHP gurus:
Platform:
PHP4/Win2k:
How to:
Execute a specific php script on a server side periodically?
For instance - I would like to construct a mailing automaton sending mails
on a basis of specific criteria to the customers of my client. He would
like
it to send mails only overnight and no more but a few mails per minute. I
can write a good php script for database connectivity and mailing procedure
itself, but I don't know how to force the server to run it periodically by
itself.
Any ideas ???
Please...
Ziggi
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
ok
Now i (obviously) are in unknown territoies...
***
Using PHPDEV4 from http://www.firepages.com.au/dev4.htm on a NT4.0 SP4.
The package contains PHP4.06 / Apache1.3.20 / ActivePerl5.6 / MySQL3.23
Apache, php, mysql and perl works.
phpinfo(INFO_MODULES); reports:
GD Support enabled
GD Version 2.0 or higher
FreeType Support enabled
FreeType Linkage with freetype
JPG Support enabled
PNG Support enabled
WBMP Support enabled
I have even double checked php.ini
***
GD works as i can drav stuff (rectangles, imagetext and so on) but *how*
or *why* can't i get GD to load .ttf files with imagettftext?
I get 'Could not find/open font in c:\phpdev\www\graph.htm' no matter
how i construct the path to my fontfile.
Tried different fontfiles and even downloaded some that comes with tut's
- with the same result.
My fontfile is currently in the same dir as the script itself - not even
that will work.
Is there any known bug in GD 2.x related to the support of TTF files?
or is it just me that have tested 99 combinations on the
path-to-fontfile parameter, but forgotten about the 100'th?
--
Michel Laine
--- End Message ---
--- Begin Message ---
Hi !
Thank you Richard for your prompt previous answer !
One more question concerning scheduled tasks:
Can you please provide me a right syntax for a .bat file starting particular
PHP script? I don't know how to force php.exe to open the right document ?
And just to confirm: the script is just plain PHP document without any
<HEAD> and <BODY> tags, yes? Only things between <?php ?>.
Thanks,
Ziggi
--- End Message ---
--- Begin Message ---
"Jerry Leonard" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I am relatively new to php and mysql and would appreciate any help you can
> provide. Here is the task:
>
> I need to have a point system added to my site. What I would like is when
a
> user logs in they will get 1000 points. But they only get it once per day.
Seems simple enough; if they have to log in, you obviously already
keep per-user records. Add a field for accumulated points and a
timestamp. Each time a person logs on, check the timestamp; if the
last log-on was not today, increment their points and update the
timestamp.
Note: be careful about how you define 'not today'. Does that mean
roll-over at midnight? But then midnight where? I live on the East coast,
my server is in California, and who knows where my users are. Does
it mean not within the last 24 hours? Then a user who logs on in the
afternoon
and again the next morning will only be credited once. More to the point,
someone who logs on every day at 'about five o'clock' will on average get
chopped half the time, and might get quite peeved about it. I might look
at something like 'not within the last fifteen hours' and accept the slop
just to keep it simple. What about nerds that never log off? Maybe it
should be checked for each page served, rather than just at login. There
are quite a few ways of phrasing it, each with tradeoffs.
--- End Message ---
--- Begin Message ---
In reference to the Tomcat+Apache port 80 issue.. here's the solution:
http://www.jguru.com/faq/view.jsp?EID=415520
_________________________________________________________________
Send and receive Hotmail on your mobile device: http://mobile.msn.com
--- End Message ---
--- Begin Message ---
It seems impossible for me to use file system and directory functions that
attempt to access network drives on another server.
For example, take the dir() example from the manual:
<?php
function getDirList($dirName)
{
$d = dir($dirName);
while($entry = $d->read())
{
if ($entry != "." && $entry != "..")
{
if (is_dir($dirName."/".$entry))
{
getDirList($dirName."/".$entry);
}
else
print("$entry<br>\n");
}
}
}
getDirList("//server/share/dir");
getDirList("S:\\dir");
?>
If S: is mapped to \\server\share then the above will fail with:
Warning OpenDir: Invalid argument (errno 22) in ....
I've tried using '/', '\' (properly escaped) and UNC names.
I've given full control permissions both via the filesystem and the share to
the user.
I'm sure I'm missing something.
-- Mike Fallavollita
[EMAIL PROTECTED]
--- End Message ---