LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


Reply
  Search this Thread
Old 12-13-2007, 08:26 AM   #1
sklitzz
Member
 
Registered: Feb 2006
Location: Croatia, Split
Distribution: Ubuntu 7.10
Posts: 93

Rep: Reputation: 15
PHP on Ubuntu


I cant get it working. It seems that apache is running but when
I try to run a php script on my localhost it just offers it for
download and it doesnt parse it and compile and so on. What should
I do? Is there something that I need to put in the http.conf?
Is there a good tutorial on this subject?

Thanks in advance
 
Old 12-13-2007, 11:49 AM   #2
dkm999
Member
 
Registered: Nov 2006
Location: Seattle, WA
Distribution: Fedora
Posts: 407

Rep: Reputation: 35
On my Linux systems (Fedora), there is a config directory /etc/httpd/conf.d, which contains the necessary extra lines to make Apache interpret PHP instead of just serving it up as text. The relevant config lines are
Code:
LoadModule php5_module modules/libphp5.so
AddHandler php5-script .php
AddType text/html .php
DirectoryIndex .php
Your file layout may be different on your distribution, but these config lines need to be seen by Apache on startup somehow, either in the main httpd.conf file or in an included config file (on my system, this happens because partway down in the main file there is a line that says
Quote:
Include conf.d/*.conf
Of course, if the PHP stuff is not installed on your system, this configuration stuff won't help, but at least then you will get a complaint from the Apache httpd on startup, saying that it cannot find libphp5.so, or something like that.
 
Old 12-15-2007, 03:29 PM   #3
whk
Member
 
Registered: Jun 2005
Posts: 202

Rep: Reputation: 37
The best one I've seen is here.

you need to know the following:
"sudo nano" at the command line or "gksudo gedit"
or "vi"

Also on your browser use
http://localhost/<name of file>.php


hth & gl
 
Old 12-16-2007, 03:46 AM   #4
sklitzz
Member
 
Registered: Feb 2006
Location: Croatia, Split
Distribution: Ubuntu 7.10
Posts: 93

Original Poster
Rep: Reputation: 15
Thank you both. I got it working
 
  


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
Installing PHP in Ubuntu raghuveerbabu Linux - Newbie 1 10-04-2007 01:05 PM
Ubuntu & Apache php not loading MSCTC Linux - Server 6 07-28-2007 05:09 PM
Programming in C/C++/Java/PHP in Ubuntu 6.10 MistakeInEvolution Ubuntu 4 03-03-2007 12:44 AM
install mysql,php en ubuntu 5.1 htamayo Ubuntu 1 10-22-2006 09:03 PM
install apache and php on ubuntu server spank Ubuntu 15 07-28-2006 01:41 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu

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