Difference between revisions of "LAMP"

From Ilianko
Line 11: Line 11:
 
== Инсталиране PHP ==
 
== Инсталиране PHP ==
 
   
 
   
Install PHP
+
sudo apt-get install php5 libapache2-mod-php5
  
In this part we will install PHP 5.  
+
рестартиране Apache
 +
sudo /etc/init.d/apache2 restart
  
Step 1. Again open up the Terminal (Applications > Accessories > Terminal).
+
Тестване
 
 
Step 2. Copy/Paste the following line into Terminal and press enter:
 
 
 
sudo apt-get install php5 libapache2-mod-php5
 
 
 
Step 3. In order for PHP to work and be compatible with Apache we must restart it. Type the following code in Terminal to do this:
 
 
 
sudo /etc/init.d/apache2 restart
 
 
 
 
 
Test PHP
 
Test PHP
  

Revision as of 09:50, 26 December 2011

Инсталиране Apache

sudo apt-get install apache2

За да се уверим, че работи през браузъра може да подадем заявка към новия web server:

http://Web-server-IP/

Трябва да видите следното съобщение "It works!"

Инсталиране PHP

sudo apt-get install php5 libapache2-mod-php5

рестартиране Apache

sudo /etc/init.d/apache2 restart

Тестване Test PHP

To ensure there are no issues with PHP let's give it a quick test run.

Step 1. In the terminal copy/paste the following line:

sudo gedit /var/www/testphp.php

This will open up a file called phptest.php.

Step 2. Copy/Paste this line into the phptest file:

<?php phpinfo(); ?>

Step 3. Save and close the file.

Step 4. Now open you're web browser and type the following into the web address:

http://localhost/testphp.php

The page should look like this:

.