Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PHP installation woes

Status
Not open for further replies.

frozenpeas

Technical User
Sep 13, 2001
893
CA
I thought I installed PHP4 on my RH7/Apache 1.3 box. But the PHP files aren't being processed when accessed via the web.

Any idea where I can go from here? How can I trouble shoot this? Everything looks good in my httpd.conf file.
 
What happens when you try the phpinfo() function? Does it display the status page? Did you install via RPM or from source?

It is likely that your httpd.conf file needs adjustment regardless.

Gary
gwinn7
A+, Network+

 
What happens when you try to run anything, even a "hello world" app? Do you get a server error, or does the server send you the source code?

And also, did you install PHP as an Apache module or as a standalone interpreter?
 
I installed via source. I tried a simple "Hello world" or something and the served page is blank. Of course, the source code is in plain text.

Um, I think I installed it as an Apache module. I'm a noob.
 
Nothing is being sent? Did you do a "view source" on the page returned in your browser?

 
Yeah, the "view source" is where I can see the plain code.
 
I had a lengthy exchange about a problem similar (same?) to yours. I also installed from source and had trouble.

It turns out it the installation from source failed to update the httpd.conf properly. I edited the MIME type section and it was fixed. This is also documented in the book "Linux Apache Web Server Administration". It has a complete section devoted to installing PHP that is very helpful.

If you want more information, check my thread on this subject. Just look up messages with my handle "gwinn7" or try "PHP Install" in the search criteria. That should help you.


Gary
gwinn7
A+, Network+
 
I'm sorry, I wasn't explicit enough. What do you see when you do a "view source"?
 
I see this:

Code:
<html>

<body>



<?php

$myvar = &quot;Hello&quot;;

echo $myvar;

?>



</body>

</html>
 
Then it must be the MIME type that is incorrect. Check your httpd.conf for these lines
LoadModule php4_module modules/libphp4.so
AddModule mod_php4.c
AddType application/x-httpd-php .php
This is if you installed PHP as a module. //Daniel
 
Here's what's in there:

Code:
<IfDefine HAVE_PHP>
LoadModule php_module         modules/mod_php.so
</IfDefine>
<IfDefine HAVE_PHP3>
LoadModule php3_module        modules/libphp3.so
</IfDefine>
<IfDefine HAVE_PHP4>
LoadModule php4_module        modules/libphp4.so 
</IfDefine>

<IfDefine HAVE_PHP>
AddModule mod_php.c
</IfDefine>
<IfDefine HAVE_PHP3>
AddModule mod_php3.c
</IfDefine>
<IfDefine HAVE_PHP4>
AddModule mod_php4.c
</IfDefine>

<IfModule mod_php4.c>
  AddType application/x-httpd-php .php4 .php3 .phtml .php
  AddType application/x-httpd-php-source .phps
</IfModule>

# The following is for PHP3:
<IfModule mod_php3.c>
  AddType application/x-httpd-php3 .php3
  AddType application/x-httpd-php3-source .phps
</IfModule>

# The following is for PHP/FI (PHP2):
<IfModule mod_php.c>
  AddType application/x-httpd-php .phtml
</IfModule>

How does that look? Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top