LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-02-2007, 12:22 PM   #1
taher84
LQ Newbie
 
Registered: Jun 2006
Posts: 21

Rep: Reputation: 0
php not showing output on browser


<html>
<head>
<title>PHP Test</title>
</head>
<body>
<? php
echo 'Hello World';
?>

</body>
</html>

this was a small test page that i ran..however i recieved a blank output. i even tried with
echo "hello world"; and simply echo hello world;
but same results;
my apache was working
distro fc5
php 5.21 n 4.46 was tried
no error logs
on running the php interpretor..it showed the output on the konsole
most browsers have been tried
 
Old 03-02-2007, 02:10 PM   #2
asommer
Member
 
Registered: Mar 2003
Location: North Carolina
Distribution: Gentoo
Posts: 168

Rep: Reputation: 30
Have you configured Apache to use PHP?

Should have something like this in your apache config:
Quote:
# Load the module first
<IfModule !mod_php5.c>
LoadModule php5_module modules/libphp5.so
</IfModule>

# Set it to handle the files
<IfModule mod_mime.c>
AddType application/x-httpd-php .php
AddType application/x-httpd-php .phtml
AddType application/x-httpd-php .php3
AddType application/x-httpd-php .php4
AddType application/x-httpd-php .php5
AddType application/x-httpd-php-source .phps
</IfModule>

AddDirectoryIndex index.php index.phtml
 
Old 03-02-2007, 02:48 PM   #3
taher84
LQ Newbie
 
Registered: Jun 2006
Posts: 21

Original Poster
Rep: Reputation: 0
this is the a part of the httpd.conf file which i edited..(the bold font is the edited part). after that i stopped my daemon n restarted it...igot the error

Syntax error on line 97 of /etc/httpd/conf/httpd.conf: Ca nnot load /etc/httpd/modules/libphp5.so into server: /etc/httpd/modules/libphp5. so: cannot open shared object file: No such file or directory

HTTPD.CONF

Don't give away too much information about all the subcomponents
# we are running. Comment out this line if you don't mind remote sites
# finding out what major optional modules you are running
ServerTokens OS

#
# ServerRoot: The top of the directory tree under which the server's
# configuration, error, and log files are kept.
#
# NOTE! If you intend to place this on an NFS (or otherwise network)
# mounted filesystem then please read the LockFile documentation
# (available at <URL:http://httpd.apache.org/docs/2.2/mod/mpm_common.html#lockfile>);
# you will save yourself a lot of trouble.
#
# Do NOT add a slash at the end of the directory path.
#
ServerRoot "/etc/httpd"

#
# PidFile: The file in which the server should record its process
# identification number when it starts.
#
PidFile run/httpd.pid

#
# Timeout: The number of seconds before receives and sends time out.
#
Timeout 120

#
# KeepAlive: Whether or not to allow persistent connections (more than
# one request per connection). Set to "Off" to deactivate.
#
KeepAlive Off

#
# MaxKeepAliveRequests: The maximum number of requests to allow
# during a persistent connection. Set to 0 to allow an unlimited amount.
# We recommend you leave this number high, for maximum performance.
#
MaxKeepAliveRequests 100

#
# KeepAliveTimeout: Number of seconds to wait for the next request from the
# same client on the same connection.
#
KeepAliveTimeout 15

##
## Server-Pool Size Regulation (MPM specific)
##



# Load the module first
<IfModule !mod_php5.c>
LoadModule php5_module modules/libphp5.so
</IfModule>



# Set it to handle the files
<IfModule mod_mime.c>
AddType application/x-httpd-php .php
AddType application/x-httpd-php .phtml
AddType application/x-httpd-php .php3
AddType application/x-httpd-php .php4
AddType application/x-httpd-php .php5
AddType application/x-httpd-php-source .phps
</IfModule>



# prefork MPM
# StartServers: number of ser....
 
Old 03-02-2007, 03:02 PM   #4
asommer
Member
 
Registered: Mar 2003
Location: North Carolina
Distribution: Gentoo
Posts: 168

Rep: Reputation: 30
Sorry should have warned you that my configuration might not work for you. Which distro are you using? Did you compile PHP or install from your distro's package management system?
 
Old 03-02-2007, 03:13 PM   #5
taher84
LQ Newbie
 
Registered: Jun 2006
Posts: 21

Original Poster
Rep: Reputation: 0
i am using fc5 as my distro
no i hadnt downloaded it from the package management system but from the source

what di i do now
 
Old 03-02-2007, 03:24 PM   #6
asommer
Member
 
Registered: Mar 2003
Location: North Carolina
Distribution: Gentoo
Posts: 168

Rep: Reputation: 30
Did you compile Apache or are you using the version that came with FC5? If you're using the FC5 version you could install php by doing:

Quote:
yum install php
That should place a config file for PHP in your /etc/httpd/conf.d directory. What were the steps you used to compile PHP?
 
Old 03-02-2007, 03:27 PM   #7
taher84
LQ Newbie
 
Registered: Jun 2006
Posts: 21

Original Poster
Rep: Reputation: 0
simply
./configure
make
make install
 
Old 03-02-2007, 03:31 PM   #8
taher84
LQ Newbie
 
Registered: Jun 2006
Posts: 21

Original Poster
Rep: Reputation: 0
and yes i installed the apache version that came with fc5
 
  


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
Lan Browser not showing in Konqueror RonV Debian 3 05-02-2006 08:13 AM
PHP redirection after showing a message vharishankar Programming 8 07-12-2005 06:17 PM
Unknown computer showing up in Gnome Net Browser gandalf2041 Linux - Wireless Networking 0 12-23-2004 07:36 AM
df showing wrong output samac Slackware 9 12-08-2004 02:38 PM
browser not showing pictures digsby0007 Linux - Software 6 06-02-2003 03:10 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04: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