Ubuntu Server Installation PHP5

Source: Internet
Author: User
Tags phpinfo

Ubuntu Server Installation PHP5

1: If your server already has the Apache2 component installed, you can install the PHP5 component corresponding to apache2 when installing PHP5

sudo Install php5 libapache2-mod-php5

After the installation is successful, you can see that, by default, modules such as Json,opcache,pdo,readline are installed

2: If a command line is required to run the PHP5 script needs to be installed PHP5-CLI

From there, you can see that the PHP5-CLI module is already installed by default

You can use PHP5-V to test whether you have installed

If not installed, use the following installation PHP5-CLI

sudo Install PHP5-CLI

3: If you do not need to run PHP scripts under the Apache2 component, you need to install the PHP5-CGI module to execute the PHP5 program

sudo Install php5-cgi

4: If you need a php5 MySQL connection using the driver, install

sudo Install Php5-mysql

5: Simple Configuration

Check the apache2/modes-enable directory, whether the PHP5 module is loaded, see php5.conf php5.load Two files exist, if not present using the A2ENMOD command to load

Restarting the APACHE2 service

sudo service apache2 restart

6: Test PHP5 operating Environment

Create a new test.php file in the Web directory and output a simple phpinfo () message

<? PHP   Phpinfo ();? >

7: Run the browser, test test.php, the details of the PHP information, can indicate the PHP5 environment simple configuration success

Reference: https://help.ubuntu.com/14.04/serverguide/php5.html

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.