This is part of a write-up of an attempt to use Linux as a "Small Business Server", and describes how to add support for php and mysql to this basic Apache configuration.
We will build on the configuration described here.
We will build on the configuration described here.
make sure that you have a working configuration of apache and mysql and that you don't have left-over configuration changes that you want to implement. If so, take care of that before you proceed.
check for available php5 packages : apt-cache policy php5
## install php5 on Debian 'stable'
# php5 is available in 'testing' but shows unmet dependencies
# install the following in the given order,
# to handle dependencies an provide support for apache and mysql
#
# pin these to 'testing'
libdb4.3
libkrb53
libxml2
#install php with apache module
apt-get install libapache2-mod-php5.
apt-get install php5
#install php mysql module
apt-get install php5-mysql
ln -s /var/www/phpmyadmin /srv/http/phpmyadmin
# optional : install php-based mysql admin
# and create a symbolic link so that it appears in web root
apt-get install phpMyAdmin
ln -s /var/www/phpmyadmin /srv/http/phpmyadmin
to see if php is working and can be used by apache, create a file test.php in /srv/http/. Its contents should just be
<?php phpinfo(); ?>
create a hyperlink in index.html so you can call test.php from a browser. If all is well, it will report your php configuration, which shows that php is working, otherwise it wouldn't be able to generate this output in the browser.
you can also create a hyperlink to /srv/http/phpmyadmin so that it can be called from th intranet index page