Home  >  Article  >  Backend Development  >  Installation of LAMP environment and installation of yaf extension under Ubuntu14

Installation of LAMP environment and installation of yaf extension under Ubuntu14

WBOY
WBOYOriginal
2016-08-08 09:23:191087browse
I installed the lamp environment under Ubuntu some time ago. Record the installation process for future reference.

InstalllampEnvironment

① Install apache

<span>sudo</span> apt-get <span>install</span> apache2

The system will pop up the prompt as shown in the picture. At this time, you need to enter the user's password to install. All other installation operations below need to be entered. The password is the same every time.

Open the browser and enter localhost. If the following interface is displayed, the installation is successful.

② Install php

<span>sudo</span> apt-get <span>install</span> php5

③ Install mysql

<span>sudo</span> apt-get <span>install</span> mysql-server

At this time, the environment installation of lamp is completed. Check if it is correct.

ApacheAfter the installation is complete, the root directory of is in /var/www/html

cd  /var/www/<span>html
</span><span>sudo</span><span>vi</span> phpinfo.php

Enter

<?<span>php
  </span><span>phpinfo</span><span>();
</span>?>

Then open the browser and enter localhost/ phpinfo.php, if the following page appears, the installation is successful.

Install the development package of php

Only after installing the development package can you install the extension

<span>sudo</span> apt-get <span>install</span> php5-dev

Install the extension of php

a) Installation php-mysql

This installation comes with the system library, you can install it directly.

<span>sudo</span> apt-get <span>install</span> php5-mysql

RestartapacheLoad mysql support

<span>sudo</span> service  apache2 restart

b) Installyaf

Installyaf You need to install the pcre library first, otherwise Installing yaf will report an error

<span>sudo</span> apt-get <span>install</span> libpcre3 libpcre3-dev

Download the latest yaf file

cd  /usr/local/src/
<span>sudo</span><span>wget</span> https:<span>//</span><span>github.com/laruence/php-yaf/archive/master.zip</span>

  • to prevent it from having the same name as the file downloaded later, so change it Let’s distinguish by name.

Unzip

<span>sudo</span><span>unzip</span> yaf.<span>zip</span>

After decompression, it is as shown in the picture below

cd php-yaf-<span>master
</span><span>sudo</span> /usr/bin/phpize

Configuration

Compile

Compile and install

After completion, the yaf.so file is generated in the following directory

Modify the configuration of php.ini and load yaf

<span>sudo</span><span>vi</span> php.ini 

Change the expansion directory to survival The directory where the so file is located

Added

Restartapache

<span>sudo</span> service apache2 restart

Refresh at this time to findyaf Has been installed correctly

If you need other extensions like yaf installation steps.

The above introduces the installation of the LAMP environment and the installation of the yaf extension under Ubuntu14, including the relevant content. I hope it will be helpful to friends who are interested in PHP tutorials.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn