October 3rd, 1999, 09:51 PM
I'm new to the whole php/database server thing. I have a WinNT machine with Apache for NT running on it. The tut here shows how you do it for Unix/Linux boxes, I'd like to stick w/ NT for now. When I went to mysql.net, they had a ver. for windows but one that was only a demo. The Linux ver. is free of course. I don't want to have to pay so I can run a few php scripts. I mean Apache for Windows is free. Is there some other way? Also, the php downlaod that I saw for Windows is designed for the MS IIS server. I definitely don't want to run that, cuz Apache is far better, where can I get php for Apache on an NT machine? Maybe I'm misunderstanding something. Thanks for the info.
October 4th, 1999, 04:43 PM
PHP's own manual covers installation with Apache under Windows 95/NT.
See here: http://www.php.net/manual/install-windows95-nt.php3
You don't need MySQL for PHP scripts to use a database. You can connect it to an MSAccess database using ODBC, or you can connect it to SQL server (if you have BackOffice), or Sybase or Oracle, etc, etc. Check out PHP's list of supported DBs.
(On a side note - Be careful with the MySQL licensing - the current version isn't totally free, even under Linux. It's free for internal use, but if you sell it as part of a product or charge for installing and maintaining it, you gotta pay the license fee (which is very reasonable)).
October 4th, 1999, 05:19 PM
Thanks. That helped, but now I don't seem to be able to run scripts. However there are no errors at all int he apache error log. When I insert this:<br>
"<? today = date("Y-m-d");<br>
PRINT "<CENTER>Today is:$today.</CENTER>";<br>
into my index.htm file, nothing happens at all. It's as if nothing was there, but if you look at the source the php code is there. Could it be b/c I have apache under a long directory name? It's in
<br>"crogram filesapachehtdocs" which is exactly how I pointed to the document root dir in my php3.ini file. I did not uncomment any modules in the php3.ini file, I think these modules are only for accessing databases and stuff. Is there another way to find out if php is set up on my server? What could be wrong? Thanks again...
October 4th, 1999, 06:49 PM
You've got some errors in your PHP code,
What you did is, you put HTML tags within a server-side section, this is not allowed, only when you print them to the page.
You did this :
<? ... print".....";<BR>?>
What you want to do is this :
<? ... print".... <BR>"; ?>
<? print "...."; ?> <BR>
To see if PHP3 is setup on your server, there is a PHP command to do this.
Just put this line in your PHP file :
<? echo phpinfo() ?>
and put this one in there :
<? echo phpversion() ?>
October 4th, 1999, 08:53 PM
Actually there was no <br> in there originally. I tried using that in this message box thinking it would format my message.Anyway, I tried inserting
<BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">code:</font><HR><pre><? echo phpinfo() ?>[/quote]
into my html document, but nothing happened again.
I also tried inserting
<BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">code:</font><HR><pre><? print "....uhdfh <BR>" ?>[/quote]
in there and nothing happened. Am I supposed to put the php code in another file and link to it in the html page or something. I thought I could write all the php code write in the html page if I wanted.
If you go to 126.96.36.199
you will see what I'm doing. You can see the php line in the source. Any ideas?
October 5th, 1999, 05:40 PM
I haven't done PHP on NT before, but there are a couple things I remember reading as common pitfalls:
1) You should rewrite the paths without long filenames (e.g "crogra~1apachehtdocs")
2) Since you're putting the PHP code on your "index.htm" file, make sure Apache is configured to send all *.htm files through the PHP parser. Otherwise you'll get exactly what you're getting now (code printed instead of executed). Or rename the page to index.php3 (or whatever you configured as your PHP extension in Apache).
October 5th, 1999, 07:48 PM
Thanks guys it worked!!
All I needed to do was add a line in Apache's
srm.conf file so that .htm files would go
through php. The default is only .php or .phtml
For my setup, I didn't have to change the long
filename to anything, it works fine; i guess it's
different for each machine sometimes.
Thanks a lot for your help guys.
October 11th, 1999, 02:01 PM
Could you tell me where you added that line ?? I get a file download window when i try to view a php3 document....maybe that will help me.