|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Problem running php on Apache server...
Hey all.
![]() I'm trying to test my php script, this php script: http://www.webmasterbase.com/articl...pid=155&aid=525 ... with Apache that i've installed on my WinME system. When i load the script though, i only get the: "Today's Date (according to this Web server) is " and not the date. I ran: http://localhost/today.php in my IE browser. I sent the script to a friend and he says the file worked for him. What am i doing wrong? Thanks. ![]() |
|
#2
|
|||
|
|||
|
Did you configure in the httpd.conf for PHP?? If not, then read in the doc that came with php file or look at php.net.. If you already did, then show us what you had done..
|
|
#3
|
|||
|
|||
|
Okay, i searched the php 'install.txt' and found this:
--- Installing PHP on Windows with Apache 1.3.x There are two ways to set up PHP to work with Apache 1.3.x on Windows. One is to use the CGI binary (php.exe), the other is to use the Apache module dll. In either case you need to stop the Apache server, and edit your srm.conf or httpd.conf to configure Apache to work with PHP. ... If you unzipped the PHP package to C:\PHP\ as desribed above, you need to insert these lines to your Apache conf file to set up the CGI binary: ScriptAlias /php/ "c:/php/" AddType application/x-httpd-php .php Action application/x-httpd-php "/php/php.exe" --- So i put at the end of httpd.conf: ScriptAlias /php/ "d:/webscripting/php/" AddType application/x-httpd-php .php Action application/x-httpd-php "/php/php.exe" Because i installed php in my 'd:/webscripting' folder. I loaded up apache and it still didn't show the date in today.php. ![]() Have i done something wrong? |
|
#4
|
|||
|
|||
|
isin't there a version msinstaller for PHP?
also windows try and not run as CGI i think that can be done go to downloads look for a windows installer and also try and get something that is not CGI yeah go for the dll module and look for an installer |
|
#5
|
||||
|
||||
|
Screw the installers - they tend to get things messed up. What happens when you view source of index.php from ie? can you see php code? Did apache tell you anything while starting? Did you copy all dlls to where they supposed to be? Read man for installation - its pretty much self-explanatory...
edit: wrong url
__________________
And you know I mean that. Last edited by AlCapone : March 1st, 2002 at 05:12 PM. |
|
#6
|
|||
|
|||
|
Bob,
I used the win32.exe version download. AlCopone, Yes, when i view source, i can view all of the code and it's all correct. ![]() |
|
#7
|
||||
|
||||
|
>>Yes, when i view source, i can view all of the code and it's all correct
Now read that over. Do you know what is the difference between php and javascript? php is a server side language - you cannot see it when its done. Therefore, there should be no trace of it in html source. Most likely you're using short opening tags ( <? ) instead of full ones (<?php) I dont remember which one is on by default though. Or you messed up something in your httpd.conf and confused apache. |
|
#8
|
|||
|
|||
|
Okay, this is the code i used:
<html> <head> <title>Today's Date</title> </head> <body> <p>Today's Date (according to this Web server) is <?php echo( date("l, F dS Y.") ); ?></p> </body> </html> I get the same thing that i got when i didn't do anything to the httpd.conf file. ![]() |
|
#9
|
|||
|
|||
|
I mentioned this in the php forum where you posted the same question but make sure you are running your scripts in the right directory. You cannot just put a php script anywhere on your computer and load it up in the browser and run it...
If you are using the htdocs folder as your root directory and if you have not already tried this then put your php script in the htdocs folder and then try to run it and see what happens. If you are using some other folder as your root directory then put your scripts in there and do the same. Last edited by kixx : March 3rd, 2002 at 12:08 AM. |
![]() |
| Viewing: Dev Shed Forums > System Administration > Apache Development > Problem running php on Apache server... |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|