LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 08-19-2009, 07:13 AM   #1
Arjun123
LQ Newbie
 
Registered: Jun 2009
Distribution: fedora 10
Posts: 5

Rep: Reputation: 0
Unhappy php file not run


i want to run phpinfo.php file

<html>
<body>
<?php
phpinfo();
?>
</body>
</html>

and save this file to location "/var/www/html"

and i also edit the httpd.conf file
and add the module
LoadModule php5_module modules/libphp5.so

AddType application/x-httpd-php-source .phps
AddType application/x-httpd-php .php
AddType text/html .php

and when type
http://localhost/phpinfo.php ,i shows nothing on the browser

and i got following log

127.0.0.1 - - [19/Aug/2009:16:55:00 +0530] "GET /phpinfo.php HTTP/1.1" 200 - "-" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2"
127.0.0.1 - - [19/Aug/2009:16:55:00 +0530] "GET /phpinfo.php HTTP/1.1" 200 - "-" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2"

thanks
 
Old 08-19-2009, 07:21 AM   #2
ThinkFree
Member
 
Registered: Jan 2009
Location: India
Distribution: Fedora, Arch, OpenSolaris
Posts: 112

Rep: Reputation: 20
Are your sure apache is running? What happens if you open http://localhost ?
 
Old 08-19-2009, 07:39 AM   #3
Arjun123
LQ Newbie
 
Registered: Jun 2009
Distribution: fedora 10
Posts: 5

Original Poster
Rep: Reputation: 0
yes it is running
 
Old 08-19-2009, 07:48 AM   #4
ThinkFree
Member
 
Registered: Jan 2009
Location: India
Distribution: Fedora, Arch, OpenSolaris
Posts: 112

Rep: Reputation: 20
What's the output of
Quote:
ps aux|grep apache
http://localhost opens apache default page?
 
Old 08-19-2009, 08:32 AM   #5
abefroman
Senior Member
 
Registered: Feb 2004
Location: lost+found
Distribution: CentOS
Posts: 1,430

Rep: Reputation: 55
What is the output of:
Code:
php -v
And why don't you change your HTML code to this to rule out apache problems:
Code:
<html>
<body>
<h1>hello wurld</h1>
<?php
phpinfo();
?>
</body>
</html>

Last edited by abefroman; 08-19-2009 at 08:33 AM.
 
Old 08-19-2009, 08:36 AM   #6
abefroman
Senior Member
 
Registered: Feb 2004
Location: lost+found
Distribution: CentOS
Posts: 1,430

Rep: Reputation: 55
Quote:
Originally Posted by ThinkFree View Post
http://localhost opens apache default page?
That doesn't sound right, if you put an index.html page in /var/www/html does it load that?

Paste your virtual host entry from httpd.conf please.
 
Old 08-20-2009, 01:03 AM   #7
Arjun123
LQ Newbie
 
Registered: Jun 2009
Distribution: fedora 10
Posts: 5

Original Poster
Rep: Reputation: 0
Unhappy

yes index.html file load
virtual host entry in httpd.conf file


### Section 3: Virtual Hosts
#
# VirtualHost: If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
#
# Please see the documentation at
# <URL:http://httpd.apache.org/docs/2.2/vhosts/>
# for further details before you try to setup virtual hosts.
#
# You may use the command line option '-S' to verify your virtual host
# configuration.

#
# Use name-based virtual hosting.
#
#NameVirtualHost *:80
#
# NOTE: NameVirtualHost cannot be used without a port specifier
# (e.g. :80) if mod_ssl is being used, due to the nature of the
# SSL protocol.
#

#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for requests without a known
# server name.
#
#<VirtualHost *:80>
# ServerAdmin webmaster@dummy-host.example.com
# DocumentRoot /www/docs/dummy-host.example.com
# ServerName dummy-host.example.com
# ErrorLog logs/dummy-host.example.com-error_log
# CustomLog logs/dummy-host.example.com-access_log common
#</VirtualHost>

Last edited by Arjun123; 08-20-2009 at 01:04 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
php cli can't run php file outside its path asiandude Programming 4 12-11-2008 02:50 PM
not able to run php cammand. Not able to find php novinjaiswal Linux - Newbie 4 10-31-2008 01:28 PM
Apache 2, PHP 5, SuSE 9.2 - cannot run php files dickohead Linux - Networking 6 06-28-2006 10:25 AM
Can I run localhost/file.php with CRON function kondor5 Linux - General 1 03-28-2004 06:44 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 - Software

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