A LAMP (Linux, Apache, MySQL, PHP) server is a popular stack of open-source software used to run dynamic web applications. Here is how you can set up a LAMP server on Debian Linux 8 (Jessie):
To install the Apache web server on Debian, run the following command:
sudo apt-get install apache2Sou:ecrwww.lautturi.com
This will install Apache and start the Apache service.
To install the MySQL database server on Debian, run the following command:
sudo apt-get install mysql-server
During the installation, you will be prompted to set a password for the MySQL root user.
To install PHP on Debian, run the following command:
sudo apt-get install php5 libapache2-mod-php5
This will install PHP and the Apache PHP module, which allows Apache to process PHP scripts.
To configure PHP, you need to edit the PHP configuration file php.ini
. You can find the configuration file in the /etc/php5/apache2
directory.
Open the php.ini
file in a text editor and make any necessary changes. For example, you can increase the memory_limit
or upload_max_filesize
values to allow PHP to handle larger files.
After you have installed and configured PHP, you need to restart Apache to apply the changes. Run the following command to restart Apache:
sudo service apache2 restart
To test the LAMP server, create a PHP script and place it in the /var/www/html
directory. For example, you can create a script called info.php
with the following contents:
<?php phpinfo(); ?>
Then, open a web browser and visit http://localhost/info.php
. You should see a page displaying the PHP information and configuration details.