How to install and configure Apache and PHP on ubuntu
2013-01-27 12:17
681 查看
How to install and configure Apache and PHP on ubuntu
Step 1:
Installing apache
Open Terminal. To open terminal click the Dash home from unity launcher. And type terminal
in the search field.And click Terminal .And type the below code in terminal and hit enter.
sudo apt-get install apache2
Type your ubuntu password and press enter.
Type y and hit enter to confirm apache installation.
After the successful installation , open your favorite browser and type
http://localhost/
in the address bar and press enter. If you will see ‘It works!’ , then your apache works fine.
Step 2:
Installing PHP
Open Terminal. And type the below code in terminal and hit enter.
sudo apt-get install php5
Type your ubuntu password if needed.
Type y and hit enter to confirm PHP installation.
After the successful installation restart Apache using the below code
sudo /etc/init.d/apache2 restart
Test PHP installation
To test PHP is installed, Type
sudo gedit /var/www/text.php
in the terminal and type your ubuntu password if needed.
It will open the text.php file in gedit.Type below code in the text.php file, save and exit it .
Step 1:
Installing apache
Open Terminal. To open terminal click the Dash home from unity launcher. And type terminal
in the search field.And click Terminal .And type the below code in terminal and hit enter.
sudo apt-get install apache2
Type your ubuntu password and press enter.
Type y and hit enter to confirm apache installation.
After the successful installation , open your favorite browser and type
http://localhost/
in the address bar and press enter. If you will see ‘It works!’ , then your apache works fine.
Step 2:
Installing PHP
Open Terminal. And type the below code in terminal and hit enter.
sudo apt-get install php5
Type your ubuntu password if needed.
Type y and hit enter to confirm PHP installation.
After the successful installation restart Apache using the below code
sudo /etc/init.d/apache2 restart
Test PHP installation
To test PHP is installed, Type
sudo gedit /var/www/text.php
in the terminal and type your ubuntu password if needed.
It will open the text.php file in gedit.Type below code in the text.php file, save and exit it .
相关文章推荐
- How to install and configure Apache, PHP, MySql and phpMyadmin on ubuntu
- How to install and configure Apache, PHP, MySql and phpMyadmin on ubuntu
- How to Install And Configure Apache In Ubuntu
- Howto Install and Configure Chinese Input Methods on Ubuntu
- How to Install and Configure VNC on Ubuntu 14.04
- 【转】How to build and install PHP 5.6.9 from source on Ubuntu 14.04 VPS
- How to install Apache, PHP 7.1 and MySQL on CentOS 7.3 (LAMP)
- How to Install Apache Tomcat 8 (on Windows, Mac OS X, Ubuntu) and Get Started with Java Servlet Prog
- How To Configure Logging And Log Rotation In Apache On An Ubuntu VPS
- Howto Install and Configure Doxygen for QtCreator on Ubuntu
- How to Install Apache, MySQL, PHP, and phpMyAdmin on FreeBSD
- Howto Install and Configure VTK on Ubuntu
- Howto Install and Configure QtCreator on Ubuntu
- How To Install an Apache, MySQL, and PHP (FAMP) Stack on FreeBSD 10.1
- How To Install LAMP (Linux, Apache, MySQL, PHP) On Ubuntu 11.04/11.10/12.04
- how to install apache, PHP and MySQL on Linux
- How to Configure and Install ownCloud on Ubuntu 16.04
- Howto Install and Configure PCL on Ubuntu