PDA

View Full Version : how to install an apache server with php and mysql (lamp)?



Josh83
04-14-2005, 08:44 AM
hi all

i'd like to do some php work on a hd install of knoppix, so i need a working apache server with php support and a mysql database.
i know, i simply could install xampp or something similar, but i'm interested how i could configure the system on my own (if it is not too hard).
do you have any suggestions for me where to start? i'm an absolute newbie, on windows i used xampp...

thank you for help. :)
josh

Josh83
04-14-2005, 03:19 PM
nobody any idea? :(

fingers99
04-14-2005, 05:52 PM
Josh, it's all there already.

As root do:

/usr/sbin/apache

in an editor create this file:

<?php phpinfo(); ?>

save it as

phpinfo.php

and copy it to /www/var/

pop open a web browser and enter:

http://localhost/phpinfo.php

and there you have it: php and Apache working in perfect harmony.

I'll leave you to sort out MySQL yourself (it's already in Knoppix) , but there is an excellent manual and plenty of tutorials on line.

Josh83
04-15-2005, 07:36 AM
oh man i'm so intelligent! ;)

ok, already found it out with my knoppix book... but i can't connect to mysql... i'll search for some tutorials first before asking other stupid questions. ;) thank you.

Josh83
04-15-2005, 07:46 AM
hrm ok i think i don't get it on my own...

when i enter "mysql" in a command line it tells me

Can't connect to local MySQL Server through socket '/var/run/mysqld/mysqld.sock' (2)

i have no idea what this mysqld.sock is, but i created such a file in /var/.... and retried:

Can't connect to local MySQL Server through socked '/var/run/mysqld/mysqld.sock' (111)

so only the number in the end has changed at all...

what can i do? apache is running, and php is working, too... :-/

thanks for help! :)
Josh

fingers99
04-15-2005, 08:14 PM
su to root and do

/usr/bin/mysqld_safe &

to start mysql

from there, go here (http://dev.mysql.com/doc/mysql/en/connecting-disconnecting.html) for the tutorial -- there are plenty more, but I'd recommend the one from the horses' mouth, so to speak, first.

The full manual is on-line here (http://dev.mysql.com/doc/mysql/en/index.html) and can be downloaded as pdf or html.