PHP, MySQL, Apache2 install HOWTO on Debian

Setting up a PHP/MySQL/Apache2 environment on Debian is really easy, and as a PHP MySQL Developer, it’s kinda important! I’ll walk through a quick Debian lamp install howto and optimization process. I’ve optimized it for a 1.5Gb to 2GB RAM machine with reasonable load.

apt-get install apache2 php5 mysql-server-5.0 mysql-client-5.0 libapache2-mod-php5 php5-mysql php5-curl php5-cli php5-dev make gcc libc6-dev automake

mysqladmin password ‘NEWPASSWORD’

Now download eaccelerator from

tar -xjf eaccelerator.tar.bz2
sudo make install

Edit /etc/php5/apache2/php.ini and add the following at the bottom:


Edit /etc/mysql/my.cnf

# * Fine Tuning
key_buffer = 64M
max_allowed_packet = 16M
thread_stack = 128K
thread_cache_size = 8
#max_connections = 100
#table_cache = 64
#thread_concurrency = 10
# * Query Cache Configuration
query_cache_limit = 4M
query_cache_size = 64M

Restart services:

/etc/init.d/apache2 restart
/etc/init.d/mysql restart
Tagged with: , , , , , , , , , , , , , ,
Posted in Development, Linux, MySQL, News, PHP
4 Comments » for PHP, MySQL, Apache2 install HOWTO on Debian
  1. Biff says:

    Will the eaccelerator work if php/mysql/apache2 are being used by drupal, or in other words, can drupal use eaccelerator in a memory configuration similar to yours?

  2. Adam Palmer says:

    Yes Biff, eaccelerator is a PHP module and will work on anything that uses PHP (such as drupal). However, afaik, drupal has it’s own caching module so you could also use that instead.

  3. Varun says:

    Hey Adam,
    I am using a nslu2 device with debian installed on it. It’s running php, mysql and apache on it.
    I am using this device for my thesis as i was looking to design a web interface.
    The nslu2 will be connect to my microcontroller through a usb to serial converter.
    I was curios on how to send and receive data through the web interface which has to send the information over the usb port of the device.
    Any help on the matter will be useful.
    Thank you

  4. Vekseid says:

    Hello. I wrote a more advanced LAMP Tutorial on my own blog/forum for Debian Lenny specifically. It involves a lot of tweaks.

    The link may be taken as NSFW by some. Enjoy, however : )

Leave a Reply