Installation of LAMP environment and installation of yaf extension under Ubuntu14

WBOY
Release: 2016-08-08 09:23:19
Original
1086 people have browsed it
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
Copy after login

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
Copy after login

③ Install mysql

<span>sudo</span> apt-get <span>install</span> mysql-server
Copy after login

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
Copy after login

Enter

<?<span>php
  </span><span>phpinfo</span><span>();
</span>?>
Copy after login

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
Copy after login

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
Copy after login

RestartapacheLoad mysql support

<span>sudo</span> service  apache2 restart
Copy after login

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
Copy after login

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>
Copy after login

  • 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>
Copy after login

After decompression, it is as shown in the picture below

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

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 
Copy after login

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

Added

Restartapache

<span>sudo</span> service apache2 restart
Copy after login

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.

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!