Apache2 + php5 + MySQL + php admin on Debian 6

Install apache2 (web-server) и php5:
$ sudo apt-get install apache2 php5 libapache2-mod-php5
Config file Apache2 – /etc/apache2/apache2.conf
web folder – /var/www

When checking the connection apache to php following problem arise. Created file test.php will download insted of execute.

solution:
$ vim /etc/apache2/httpd.conf

ServerName localhost
AddType application/x-httpd-php .php
DirectoryIndex index.php index.html

restart apache
$ sudo /etc/init.d/apache2 restart

For check apache2 + php5, puts file test.php to web dirrectory, with text:
# test.php
<?php phpinfo(); ?>

In brouther http://<ip_адрес_сервера>/test.php. You should see a table with the configuration and setup php (do not forget to open access on the firewall).

Now install MYSQL.
$ sudo apt-get install mysql-server mysql-client php5-mysql

Will ask create mysql root password

$ sudo apt-get install phpmyadmin

Restart Apache2:
$ sudo /etc/init.d/apache2 restart

In brouther http://<ip_адрес_сервера>/phpmyadmin
Login with root password (Login – root, password – тот, что указали выше). Now create new user.

P.S.
turn on/off php modules for apache
a2enmod, a2dismod – enable or disable an apache2 module

 

Leave a comment