LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Ubuntu (https://www.linuxquestions.org/questions/ubuntu-63/)
-   -   install apache and php on ubuntu server (https://www.linuxquestions.org/questions/ubuntu-63/install-apache-and-php-on-ubuntu-server-465172/)

spank 07-18-2006 07:04 AM

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?

seneschal 07-18-2006 11:37 PM

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.

Guttorm 07-20-2006 07:04 AM

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.

spank 07-20-2006 07:39 AM

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!

Guttorm 07-20-2006 07:49 AM

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.

spank 07-20-2006 03:27 PM

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 ?

Guttorm 07-21-2006 04:21 AM

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.

Zetec 07-21-2006 08:25 AM

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.

robbbert 07-24-2006 03:04 PM

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

Zetec 07-24-2006 04:22 PM

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

Regards,

Jon

sparton 07-28-2006 09:25 AM

http://howtoforge.com/lamp_installation_ubuntu6.06

spank 07-28-2006 01:08 PM

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!

sparton 07-28-2006 01:27 PM

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

spank 07-28-2006 01:32 PM

:) 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.

sparton 07-28-2006 01:35 PM

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.


All times are GMT -5. The time now is 03:05 PM.