Install Apache2 + PHP + Mysql in ubuntu

Source: Internet
Author: User
Tags php software
1. Example of installing Apache 2 In Debian
# apt-get install libapache2-mod-php5

APT will automatically install and activate the PHP 5 module of Apache 2 and all dependent libraries. If you are not required to restart Apache during installation, you must manually:

2. stop and start Apache after installing PHP 5
# /etc/init.d/apache2 stop# /etc/init.d/apache2 start
 

The above PHP only installs the core module. But it may not be enough. Users will soon find more activation modules, such as MySQL, cURL, and GD.

When you compile PHP from the source code, you needConfigureCommand to activate the module. With APT, you only need to install the additional software package. These packages are named "php4-*" (or "php5-*", if a third-party PHP 5 is installed ).

 

3. Obtain the list of additional PHP software packages.
# dpkg -l 'php5-*'

As you can see from the output above, there are also many PHP modules that can be installed (except for php5-cgi, php5-cli, or php5-pear, these special software packages ). Carefully check and install what you need. If a module is selected without a corresponding library, APT will automatically install all dependent libraries.

If you choose to add MySQL, cURL, and gd to PHP, the command is similar:

4. Install MySQL, cURL, and gd support for PHP.
# apt-get install php5-mysql php5-curl php5-gd

APT automatically adds the appropriate rows to differentPhp. ini(/Etc/php5/apache2/php. ini,/Etc/php5/cgi/php. ini.

5. Activate MySQL, cURL, and gd configuration lines in PHP.
extension=mysql.soextension=curl.soextension=gd.so

Restart Apache to activate these modules as before.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.