LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-19-2004, 12:58 PM   #1
Ham1am
LQ Newbie
 
Registered: Jun 2004
Distribution: Redhat 9.0
Posts: 5

Rep: Reputation: 0
Can't get PHP to run


Hi folks. here.. :/

I've installed RH 9.0.. struggled like mad to get my network card running.. and then I read the docs..

I've got apache running, but PHP doesn't seem to be working. I found a page on google where if PHP is working, it should pass the info to the browser, and it's not.

Code:
<html>
<head>
	<title>PHP Test</title>
	<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
</head>
<body>
	<h1>PHP Test</h1>
	<p>
	<b>An Example of PHP in Action</b><br />
		<?php echo "The Current Date and Time is: <br>";
			echo date("g:i A l, F j Y.");?>
	</p>

	<h2>PHP Information</h2>
	<p>
		<?php phpinfo(); ?>
	</p>
</body>
</html>
What my browser returns is this:

PHP Test
An Example of PHP in Action
PHP Information


I've searched high and low for a FAQ or doc, but having no luck. What'd I forget or miss?

Thanks for the help.
 
Old 06-19-2004, 01:34 PM   #2
Seventh
Member
 
Registered: Dec 2003
Location: Boston, MA
Distribution: Redhat / Debian
Posts: 269

Rep: Reputation: 30
What does php -v from a terminal get you?
 
Old 06-19-2004, 03:17 PM   #3
Ham1am
LQ Newbie
 
Registered: Jun 2004
Distribution: Redhat 9.0
Posts: 5

Original Poster
Rep: Reputation: 0
Quote:
Originally posted by Seventh
What does php -v from a terminal get you?
Hello Seventh, thanks for the reply

Version 4.2.2
 
Old 06-19-2004, 03:24 PM   #4
Seventh
Member
 
Registered: Dec 2003
Location: Boston, MA
Distribution: Redhat / Debian
Posts: 269

Rep: Reputation: 30
Been a bit since I've messed with this, but in httpd.conf, you should have:

AddType application/x-httpd-php .php

and a LoadModule line.

Can you post your httpd.conf?

I'm by no means an expert, but I'll help as much as I can.
 
Old 06-19-2004, 03:28 PM   #5
Seventh
Member
 
Registered: Dec 2003
Location: Boston, MA
Distribution: Redhat / Debian
Posts: 269

Rep: Reputation: 30
Also, I'm pretty sure the following needs to be in http.conf:

Code:
<Files *.php>
     SetOutputFilter PHP
     SetInputFilter PHP
</Files>
 
Old 06-19-2004, 05:16 PM   #6
Ham1am
LQ Newbie
 
Registered: Jun 2004
Distribution: Redhat 9.0
Posts: 5

Original Poster
Rep: Reputation: 0
Quote:
Originally posted by Seventh
Also, I'm pretty sure the following needs to be in http.conf:

Code:
<Files *.php>
     SetOutputFilter PHP
     SetInputFilter PHP
</Files>
Hello again Seventh

I didn't have any of the lines.. I added AddType, and tried to do the AddModule.. but I'm not sure what needs to be in there.. so I did some searching and some guessing, however I didn't have much luck. I did manage to get httpd started again (with a warning message) but php still doesn't seem to work.
Code:
[root@localhost conf]# service httpd start
Starting httpd: [Sat Jun 19 18:05:22 2004] [warn] module php4_module is already
loaded, skipping
I'd attach my httpd.conf file, but it's 3 meg.. and I can't seem to find the attach button anyway.. Here's the things that might be of interest though:

Code:
LoadModule access_module modules/mod_access.so
LoadModule auth_module modules/mod_auth.so
LoadModule auth_anon_module modules/mod_auth_anon.so
LoadModule auth_dbm_module modules/mod_auth_dbm.so
LoadModule auth_digest_module modules/mod_auth_digest.so
LoadModule include_module modules/mod_include.so
LoadModule log_config_module modules/mod_log_config.so
LoadModule env_module modules/mod_env.so
LoadModule mime_magic_module modules/mod_mime_magic.so
LoadModule cern_meta_module modules/mod_cern_meta.so
LoadModule expires_module modules/mod_expires.so
LoadModule headers_module modules/mod_headers.so
LoadModule usertrack_module modules/mod_usertrack.so
LoadModule unique_id_module modules/mod_unique_id.so
LoadModule setenvif_module modules/mod_setenvif.so
LoadModule mime_module modules/mod_mime.so
LoadModule dav_module modules/mod_dav.so
LoadModule status_module modules/mod_status.so
LoadModule autoindex_module modules/mod_autoindex.so
LoadModule asis_module modules/mod_asis.so
LoadModule info_module modules/mod_info.so
LoadModule cgi_module modules/mod_cgi.so
LoadModule dav_fs_module modules/mod_dav_fs.so
LoadModule vhost_alias_module modules/mod_vhost_alias.so
LoadModule negotiation_module modules/mod_negotiation.so
LoadModule dir_module modules/mod_dir.so
LoadModule imap_module modules/mod_imap.so
LoadModule actions_module modules/mod_actions.so
LoadModule speling_module modules/mod_speling.so
LoadModule userdir_module modules/mod_userdir.so
LoadModule alias_module modules/mod_alias.so
LoadModule rewrite_module modules/mod_rewrite.so
LoadModule php4_module modules/libphp4.so (not sure this is correct)

<Files ~ "^\.ht">
    Order allow,deny
    Deny from all
</Files>
What else might be of interest?

Thanks a bunch Seventh!!
 
  


Reply



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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Apache 2, PHP 5, SuSE 9.2 - cannot run php files dickohead Linux - Networking 6 06-28-2006 10:25 AM
Help to run the PHP program I installed Gins Linux - General 7 09-09-2005 04:01 PM
Getting the ssh2_* functions to run in PHP didi86 Linux - Software 1 03-03-2005 01:46 PM
How to run php as root user ??? taqs Programming 2 09-01-2004 05:11 AM
help getting pptp-php-gtk.php to run as root mrtwice Linux - Software 0 11-21-2003 12:49 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:52 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration