I'd like to install a LAMP stack on my laptop in order to be able to locally develop PHP websites. However, since my computer is a laptop, and since I don't always need having apache and MySQL server running, I'd like to setup a simple way to start and stop the LAMP stack when I need it. What method do you suggest to achieve that?

  • Disable apache and mysql daemons and start / stop them when needed?
  • Install LAMP stack on a virtual machine and share the network with the host to access the developed websites?
  • Other suggestions?

A useful tool (answering your first question) is localhost-indicator. With this application you have this functions from a window with buttons:

  • open http://localhost/ and phpMyAdmin in your Web browser,
  • open your Public http documents directory,
  • start/stop the Apache and MySQL services,
  • edit the apache and php configuration.


Also, the must used commands in LAMP are the followings: (always useful)


  • Login: mysql -u <user> -p <db_to_use>

  • Start service: sudo start mysql

  • Restart service: sudo restart mysql

  • Stop service: sudo stop mysql


  • Start service: sudo /usr/sbin/apache2ctl start

  • Restart service: sudo /usr/sbin/apache2ctl restart

  • Stop service: sudo /usr/sbin/apache2ctl stop

  • To test configuration changes: sudo /usr/sbin/apache2ctl configtest

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.