LinuxQuestions.org
Help answer threads with 0 replies.
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 04-28-2008, 07:48 AM   #1
cmnorton
Member
 
Registered: Feb 2005
Distribution: Ubuntu, CentOS
Posts: 585

Rep: Reputation: 35
How To Configure PHP With Apache


I have PHP CLI working.

What do I need to configure in apache to get this to run:

<html>
<title>Test index.html page.</title>
<body>
hello
<?php
phpinfo();
?>
</body>
</html>

Where this is /var/www/index.html
 
Old 04-28-2008, 09:20 AM   #2
datopdog
Member
 
Registered: Feb 2008
Location: JHB South Africa
Distribution: Centos, Kubuntu, Cross LFS, OpenSolaris
Posts: 806

Rep: Reputation: 41
that depends on what distro you are running, in most cases you just have to install the php-mysql module.
 
Old 04-28-2008, 09:21 AM   #3
thejonmoore
LQ Newbie
 
Registered: Jul 2005
Location: Kentucky
Distribution: Debain, Slack, Fedora
Posts: 18

Rep: Reputation: 0
Have you installed the mod_php(4,5) module for your version of Apache?

Is it configured?

... check those things.
 
Old 04-28-2008, 12:13 PM   #4
cmnorton
Member
 
Registered: Feb 2005
Distribution: Ubuntu, CentOS
Posts: 585

Original Poster
Rep: Reputation: 35
Working with one last question

Thank you for the pointers. localhost displays the output from phpinfo();, when index.php is used. I have one more question:

How do I tell apache to execute embedded php in html pages or is that not possible?
 
Old 04-28-2008, 12:18 PM   #5
thejonmoore
LQ Newbie
 
Registered: Jul 2005
Location: Kentucky
Distribution: Debain, Slack, Fedora
Posts: 18

Rep: Reputation: 0
Quote:
Originally Posted by cmnorton View Post
How do I tell apache to execute embedded php in html pages or is that not possible?
I'm not quite sure what you're asking.

If you're wanting files with a .html extension to be parsed by PHP, then I think a short answer is you can't.

You could, in theory, configure you mimetypes to treat HTML files as PHP files, but that might have adverse affects else where...

Maybe someone with more knowledge on this subject will give you a better answer.
 
Old 04-28-2008, 12:31 PM   #6
cmnorton
Member
 
Registered: Feb 2005
Distribution: Ubuntu, CentOS
Posts: 585

Original Poster
Rep: Reputation: 35
php extensions it is

Quote:
Originally Posted by thejonmoore View Post
I'm not quite sure what you're asking.

If you're wanting files with a .html extension to be parsed by PHP, then I think a short answer is you can't.

You could, in theory, configure you mimetypes to treat HTML files as PHP files, but that might have adverse affects else where...

Maybe someone with more knowledge on this subject will give you a better answer.
Thanks. Now, I know to make my html pages with .php extensions.
 
  


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
configure php with apache varunbihani Linux - Software 1 01-13-2005 05:43 AM
Apache + Php . I can not configure it . Help me :( kernelvn Linux - Software 3 09-17-2004 10:02 AM
How do i configure RH-9, apache 2.0, php and mysql rolling_titan Linux - General 4 10-18-2003 06:56 AM
Configure Apache and PHP kaustav Linux - General 11 05-31-2003 11:58 PM
Configure Apache and PHP kaustav Linux - Newbie 1 05-26-2003 06:41 AM

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

All times are GMT -5. The time now is 07:57 AM.

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