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 January 20th, 2002, 02:46 PM
teknoart teknoart is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2002
Posts: 50 teknoart User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Angry Apache and PHP installation onW98

I have installed Apache web server and PHP.
apache runs problem free but I tried a test file including phpinfo() and with IE the page was viewed as a string. After a quick research I learned it means that the file is not interpreted by PHP and it is a server config problem. But I have checked several times my apache config, tried PHP to run as a module and as cgi.
Thanks in advance.

Reply With Quote
  #2  
Old January 20th, 2002, 04:42 PM
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
As module, you have to edit/add in the httpd.conf do follows:

LoadModule php4_module c:/php/sapi/php4apache.dll
AddModule mod_php4.c
AddType application/x-httpd-php .php

OR

As cgi, you have to do follows:

read this first at http://www.cert.org/advisories/CA-1996-11.html and then if you are really sure, insert these lines to your conf file:

ScriptAlias /php/ "c:/php/"
AddType application/x-httpd-php .php
Action application/x-httpd-php "/php/php.exe"


You can learn more about it at http://cvs.php.net/co.php/php4/win32/install.txt ..

Reply With Quote
  #3  
Old January 20th, 2002, 05:28 PM
teknoart teknoart is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2002
Posts: 50 teknoart User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
thanks mezz

LoadModule php4_module c:/php/sapi/php4apache.dll
AddModule mod_php4.c
AddType application/x-httpd-php .php

That's what I have done, but doesn't work. Thatswhy I am wondering, if anything else can cause this problem.

Thaks again for your help.

Reply With Quote
  #4  
Old January 20th, 2002, 06:24 PM
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
All I can think of is did you reboot or restart your Apache server? When you are finishing with those, then clear your cache and test it again.

I would put php4apache.dll in the modules directory in Apache then do the LoadModule php4_module modules/php4apache.dll ..

That's all I can help, so if you still have problem and wait for others.

Reply With Quote
  #5  
Old January 20th, 2002, 07:32 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
First of all, you do not need "AddModule mod_php4.c", LoadModule will do just fine.
>>page was viewed as a string
As who? you mean you got 'phpinfo()' as the output, dont you? Make sure its inside <?php && ?> (duh?), and that your file has extension .php
__________________
And you know I mean that.

Reply With Quote
  #6  
Old January 21st, 2002, 05:34 AM
teknoart teknoart is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2002
Posts: 50 teknoart User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
thanks alcapone

I think I need to use Add Module line, because I tried as first just the Load Module and Apache has shown an error, something like ,can't clear the module php4..., the module is not in the list... And after adding the Add Module line it is ok. Now when I test apache, everything is ok.
I have created a test file with an.php extension like;
<?
phpinfo();
?>
and when I call this page, I see this source code in IE as an output , it is not interpreted.

Thanks alot.

Last edited by teknoart : January 21st, 2002 at 05:37 AM.

Reply With Quote
  #7  
Old January 21st, 2002, 08:30 AM
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
ok, have you copied all needed dll's into you system and win dir? If not do so - read the instal.txt its explained there very well.
Reason why you get source code is because you apache does not know what to do with .php files and displays them as if they were usuall .txt's so make sure your AddTandler is set properly...

Here is general procedure when installing php as apache module on windows:
1) dl and unzip package
2) copy php4ts.dll into c:\windows\system
3) copy php4apache.dll into apache/modules dir (optional_
4) add these lines into httpd.conf (or uncomment old ones for php3 and edit them)
LoadModule php4_module c:/php/sapi/php4apache.dll
AddType application/x-httpd-php .php

That usually does the trick. Of course, dont forget to stop and start apache again.

Reply With Quote
  #8  
Old January 21st, 2002, 10:25 AM
spackbace spackbace is offline
graphics monkey
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2001
Location: Georgia Tech, Atlanta, GA
Posts: 71 spackbace User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 52 m 21 sec
Reputation Power: 8
Send a message via AIM to spackbace
hmm...... you can use "<?" by itself as the opening tag for php statements? I thought you had to use "<? php", because other languages use the "<? language" declaration to start also... or maybe I'm mistaken, who knows.
__________________
Brian

Reply With Quote
  #9  
Old January 21st, 2002, 10:34 AM
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
Yeah you can, its called 'short opening tags' or something like that, can be turned on and off in php.ini, but recommended to have <?php as opening because, like you said, some other languages use <?

Reply With Quote
  #10  
Old January 21st, 2002, 02:50 PM
teknoart teknoart is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2002
Posts: 50 teknoart User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Unhappy hi everyone

I tried everything you wrote again and again. <?php has not another effect. Just the output is<?php....

I've copied the dlls into Apache module directory also. Stopped, started again, rebooted....

No change no change..

I know,it is not a php problem but I have deleted all php files of version 4.1.1 and installed 4.1.0

I don't know what to do else.
Do you suggest that I reinstall Apache?

--
In my apache configuration any module is loaded by default, I've added LoadModule php4 at the end of the group,
add type line was there

Any other suggestion? Thanks alot.

Reply With Quote
  #11  
Old January 21st, 2002, 03:46 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
My advice forget everything you've been doing with apache/php and start over. Clean install both apache and php, then go and read step-by-step instruction on php.net about installation on apache on windows. try both, cgi and module, btw, dlls should be in system dir, not apache/modules

Reply With Quote
  #12  
Old January 21st, 2002, 10:18 PM
jdk's Avatar
jdk jdk is offline
phpkid ~~~~~~ :o)
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Nov 2000
Location: NJ, USA
Posts: 2,535 jdk User rank is Lance Corporal (50 - 100 Reputation Level)jdk User rank is Lance Corporal (50 - 100 Reputation Level)jdk User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 11 m 11 sec
Reputation Power: 10
Send a message via Yahoo to jdk
Or you can get Nusphere

JD
__________________
_____________________________
d.k.jariwala (JD)
~ simple thought, simple act ~
I blog @ http://jdk.phpkid.org

Reply With Quote
  #13  
Old January 28th, 2002, 04:56 PM
scary_jeff scary_jeff is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2001
Location: UK
Posts: 10 scary_jeff User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Might it be easier to just download and install php triad? It sets everything up for you, and for me, PHP and MySQL worked first time!

http://sourceforge.net/projects/phptriad/

Reply With Quote
  #14  
Old February 4th, 2002, 07:39 AM
silvah silvah is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2002
Posts: 3 silvah User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
eek @
Quote:
ScriptAlias /php/ "c:/php/"
AddType application/x-httpd-php .php
Action application/x-httpd-php "/php/php.exe"
if you know what this does you won't want to do it!

what is the name of the file you have made which contains the call to phpinfo() ?

make a file - call it myphpinfo.php

in there put the lines

Code:
<?php
phpinfo();
?>


put the file into your htdocs dir - so it's accessible via the webserver.

make sure that any referance in your httpd.conf actually maps the 'dot php' format to see this as a php file (I think this is your problem).

Look through your httpd.conf at all the AddType calls and make sure you have one line that looks like this

Code:
    AddType application/x-httpd-php .php


That I think is the problem, php file isn't being seen by apache as a php file,. restart apache after making changes to httpd.conf

Then open IE (or another web browser) and point it to your webserver,, the line in the URL window will look something like URL - unless you know differently

Read the install.txt file that comes with PHP

I wrote this down to remind me how to do it my way - but the install file is what you want..

Quote:
to install php onto apache (in windoz)

This is using the php SAPI module

unzip the php zip for windoz (URL)

copy the php.ini-dist
to the apache root folder - eg F:\apache\Apache
and rename it to php.ini

(you could use the php.ini-recommended - but I found it too strict for some 3rd party scripts to run, upto you)

then put the SAPI module and the main php dll file into the modules directory under apache

e.g.
copy F:\php\sapi\php4apache.dll F:\apache\Apache\modules
and
copy F:\php\php4ts.dll F:\apache\Apache\modules

now edit http.conf to pull in the modules (add the following 2 lines)

add (underneath the rest of the LoadModule stuff in the conf)
LoadModule php4_module modules/php4apache.dll

add (near the example php stuff in the conf)
AddType application/x-httpd-php .php

--

If you want php built in email to work - u'll need to set the SMTP
search php.ini for
SMTP

and put the IP addr of your SMTP server

--

image support from php
GD (image stuff for php)
edit php.ini and uncomment the line

extension=php_gd.dll

then copy the modules/php_gd.dll into the root apache folder - it'll then do png jpeg etc
no gif support - cos of the compression - unless you want to really fiddle to make it
work

--

thats it!
simple huh, the readme.txt that comes with php says to do it differently,, but....


Sil
URL

PS, check the apache access and error logs - and copy anything relevant from there to here...

Reply With Quote
  #15  
Old April 1st, 2002, 02:51 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
>>if you know what this does you won't want to do it!
huh?

Reply With Quote