Apache Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsSystem AdministrationApache Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old March 1st, 2002, 06:50 AM
Fuente Fuente is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2002
Posts: 193 Fuente User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 h 37 m 37 sec
Reputation Power: 7
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.

Reply With Quote
  #2  
Old March 1st, 2002, 10:44 AM
mezz mezz is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2001
Posts: 310 mezz User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
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..

Reply With Quote
  #3  
Old March 1st, 2002, 02:56 PM
Fuente Fuente is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2002
Posts: 193 Fuente User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 h 37 m 37 sec
Reputation Power: 7
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?

Reply With Quote
  #4  
Old March 1st, 2002, 04:26 PM
Bob Loblaw Bob Loblaw is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2001
Posts: 174 Bob Loblaw User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
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

Reply With Quote
  #5  
Old March 1st, 2002, 05:09 PM
AlCapone's Avatar
AlCapone AlCapone is offline
Mobbing Gangster
Dev Shed Demi-God (4500 - 4999 posts)
 
Join Date: Sep 2001
Location: "Best City" 2002 and 2003- Melbourne, Australia
Posts: 4,913 AlCapone User rank is Sergeant (500 - 2000 Reputation Level)AlCapone User rank is Sergeant (500 - 2000 Reputation Level)AlCapone User rank is Sergeant (500 - 2000 Reputation Level)AlCapone User rank is Sergeant (500 - 2000 Reputation Level)AlCapone User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 5 h 36 m 31 sec
Reputation Power: 18
Send a message via ICQ to AlCapone Send a message via AIM to AlCapone Send a message via Yahoo to AlCapone
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.

Reply With Quote
  #6  
Old March 1st, 2002, 05:37 PM
Fuente Fuente is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2002
Posts: 193 Fuente User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 h 37 m 37 sec
Reputation Power: 7
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.

Reply With Quote
  #7  
Old March 1st, 2002, 05:47 PM
AlCapone's Avatar
AlCapone AlCapone is offline
Mobbing Gangster
Dev Shed Demi-God (4500 - 4999 posts)
 
Join Date: Sep 2001
Location: "Best City" 2002 and 2003- Melbourne, Australia
Posts: 4,913 AlCapone User rank is Sergeant (500 - 2000 Reputation Level)AlCapone User rank is Sergeant (500 - 2000 Reputation Level)AlCapone User rank is Sergeant (500 - 2000 Reputation Level)AlCapone User rank is Sergeant (500 - 2000 Reputation Level)AlCapone User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 5 h 36 m 31 sec
Reputation Power: 18
Send a message via ICQ to AlCapone Send a message via AIM to AlCapone Send a message via Yahoo to AlCapone
>>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.

Reply With Quote
  #8  
Old March 1st, 2002, 07:04 PM
Fuente Fuente is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2002
Posts: 193 Fuente User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 h 37 m 37 sec
Reputation Power: 7
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.



Reply With Quote
  #9  
Old March 2nd, 2002, 07:18 PM
kixx kixx is offline
comfortably numb
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2002
Posts: 10 kixx User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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.

Reply With Quote
Reply

Viewing: Dev Shed ForumsSystem AdministrationApache Development > Problem running php on Apache server...


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway