LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
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 07-18-2006, 07:04 AM   #1
spank
Member
 
Registered: Aug 2003
Location: Romania
Distribution: Ubuntu 6.06
Posts: 278

Rep: Reputation: 30
install apache and php on ubuntu server


I have ubuntu server 6.06. I've installed apache2 with apt-get install apache2*. How can I install php on it?
 
Old 07-18-2006, 11:37 PM   #2
seneschal
LQ Newbie
 
Registered: Jul 2006
Location: Minnesota
Distribution: RHEL, Debian, Ubuntu
Posts: 27

Rep: Reputation: 15
There's an automatic LAMP (Linux, Apache, MySQL, and PHP) installer for Ubuntu Server - I think. I can't seem to find any documentation on it. You might also check out The Perfect Setup for Ubuntu Server.
 
Old 07-20-2006, 07:04 AM   #3
Guttorm
Senior Member
 
Registered: Dec 2003
Location: Trondheim, Norway
Distribution: Debian and Ubuntu
Posts: 1,148

Rep: Reputation: 236Reputation: 236Reputation: 236
Hi

Another way is to use dependency checking in apt-get. If you just do a
apt-get install mysql-server phpmyadmin
You'll get mysql-server, and since phpmyadmin requires PHP on the Apache, it will install and configure it correctly. It will also install the libraries and the mysql module for PHP because its required too.
 
Old 07-20-2006, 07:39 AM   #4
spank
Member
 
Registered: Aug 2003
Location: Romania
Distribution: Ubuntu 6.06
Posts: 278

Original Poster
Rep: Reputation: 30
I just want to install PHP4 or 5 on apache2... and it doesn't seem to work with regular apt-get install comands. I have the server up... the lamp option is during the install i guess.

Please help! I really want to get this thing up and running!

Thank you!
 
Old 07-20-2006, 07:49 AM   #5
Guttorm
Senior Member
 
Registered: Dec 2003
Location: Trondheim, Norway
Distribution: Debian and Ubuntu
Posts: 1,148

Rep: Reputation: 236Reputation: 236Reputation: 236
Hi again

I think you need some package to make the php work on apache2. I think it might be "libapache2-mod-php4" or "libapache2-mod-php5". Then those packages probably need some others.

But I still think the easiest way is to install phpmyadmin - after you have installed it, you can just remove it.

apt-get install phpmyadmin
apt-get remove phpmyadmin

You wont get mysql-server that way, as it's not needed (it could be on another box), but you'll get the mysql module for apache. Just take a note of all the packages you get so you can remove what you dont think you'll need.
 
Old 07-20-2006, 03:27 PM   #6
spank
Member
 
Registered: Aug 2003
Location: Romania
Distribution: Ubuntu 6.06
Posts: 278

Original Poster
Rep: Reputation: 30
nope... that doesn't work for me... if i install phpmyadmin along with libapache2-mod-php it still prompts me to download the php file rather than interpret it.

any other ideeas ? how can i configure apache to work with php on ubuntu ?
 
Old 07-21-2006, 04:21 AM   #7
Guttorm
Senior Member
 
Registered: Dec 2003
Location: Trondheim, Norway
Distribution: Debian and Ubuntu
Posts: 1,148

Rep: Reputation: 236Reputation: 236Reputation: 236
Strange - it worked when i did it.

I dont know what could be wrong, but all the configuration files are in /etc/apache2 and /etc/apache2/README tells a bit on the files in there.

You could also try to restart Apache, and then look in /var/log/apache2/error.log - there might be some clue to what the error is.
 
Old 07-21-2006, 08:25 AM   #8
Zetec
Member
 
Registered: Jul 2006
Distribution: Debian, Ubuntu, W7, openSUSE, Centos
Posts: 152

Rep: Reputation: 25
Ubuntu have a fantastic Wiki.

All the information you will need is here: https://help.ubuntu.com/community/ApacheMySQLPHP

Also replace apt-get with aptitude as it will remove any dependancies.
 
Old 07-24-2006, 03:04 PM   #9
robbbert
Member
 
Registered: Oct 2005
Location: Hannover, Germany
Distribution: Let there be Ubuntu... :o)
Posts: 573

Rep: Reputation: 32
Zetec,

while your link is great (thanks), this one is wrong:
Quote:
Also replace apt-get with aptitude as it will remove any dependancies.
Correct is that Aptitude is just a viewer upon APT, and actually, doesn't add functionality. - While Synaptic and Adept are graphical interfaces to APT, Aptitude is a text-(curses-)based interface to it. - APT itself is the pure command-line interface, that will care for dependencies as well.

Anyways, cheers & have fun

Last edited by robbbert; 07-24-2006 at 03:09 PM.
 
Old 07-24-2006, 04:22 PM   #10
Zetec
Member
 
Registered: Jul 2006
Distribution: Debian, Ubuntu, W7, openSUSE, Centos
Posts: 152

Rep: Reputation: 25
Arh thanks for putting that right robbert. Im new to the game but like to try and help out.

Regards,

Jon
 
Old 07-28-2006, 09:25 AM   #11
sparton
Member
 
Registered: Nov 2003
Location: Cincinnati, Ohio
Distribution: Ubuntu 6.06 /SLED10
Posts: 45

Rep: Reputation: 15
http://howtoforge.com/lamp_installation_ubuntu6.06
 
Old 07-28-2006, 01:08 PM   #12
spank
Member
 
Registered: Aug 2003
Location: Romania
Distribution: Ubuntu 6.06
Posts: 278

Original Poster
Rep: Reputation: 30
i have installed as LAMP. But it still doesn't work. it prompts me to download the php files. But if i install phpmyadmin it works. i guess i have to make some adjustemnts to apache2.conf. what could those be?

thankyou!
 
Old 07-28-2006, 01:27 PM   #13
sparton
Member
 
Registered: Nov 2003
Location: Cincinnati, Ohio
Distribution: Ubuntu 6.06 /SLED10
Posts: 45

Rep: Reputation: 15
Quote:
apt-get install autoconf automake1.4 autotools-dev libapache2-mod-php5 php5 php5-common php5-curl php5-dev php5-gd php-pear php5-ldap php5-mhash php5-mysql php5-mysqli php5-snmp php5-sqlite php5-xmlrpc php5-xsl php5-imap php5-mcrypt php5-pspell
Run that to install all the php you should need.

edit
Quote:
/etc/apache2/apache2.conf
(either gedit or vi)

find the
Quote:
DirectoryIndex
line

add
Quote:
index.php index.php3
to that line.

and of course run a /etc/init.d/apache2 restart
 
Old 07-28-2006, 01:32 PM   #14
spank
Member
 
Registered: Aug 2003
Location: Romania
Distribution: Ubuntu 6.06
Posts: 278

Original Poster
Rep: Reputation: 30
i know how to make a directory index. the problem is that i want for example a http://localhost/test.php and it prompts me to download it.
 
Old 07-28-2006, 01:35 PM   #15
sparton
Member
 
Registered: Nov 2003
Location: Cincinnati, Ohio
Distribution: Ubuntu 6.06 /SLED10
Posts: 45

Rep: Reputation: 15
assuming its stored in /var/www/

verify its set to atleast 775 (chmod 775)

I've had that problem before ill look into how i fixed it.
 
  


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 not working on apache server Beck24 Linux - Software 3 01-19-2006 01:12 AM
MYSQL Server + Apache Server + PHP gabriellai Linux - Networking 7 05-26-2005 12:03 PM
apache server with php djgerbavore Linux - Networking 2 11-13-2004 01:07 PM
setting up a slack, apache server with php and a sql server. caged Slackware 1 10-25-2004 04:45 AM
Apache+php on one server and MySQL on onother server? goe Linux - Newbie 3 08-19-2004 04:25 PM


All times are GMT -5. The time now is 03:37 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration