: This article describes how to install the LAMP environment and yaf extension in Ubuntu14. For more information about PHP tutorials, see. Some time ago, the lamp environment was installed in ubuntu. record the installation process for future reference.
Install the lamp environment
① Install apache
sudo apt-get install apache2
The system prompts you to enter your password for installation. for other installation operations, you need to enter the password, which is the same every time.
Enter localhost in the browser. the following interface is displayed, indicating that the installation is successful.
② Install php
sudo apt-get install php5
③ Install mysql
sudo apt-get install mysql-server
The installation of the lamp environment is complete. Check whether it is correct.
After Apache is installed, the root directory is in/var/www/html
cd /var/www/htmlsudovi phpinfo.php
Input
Open the browser and enter localhost/phpinfo. php. the following page appears, indicating that the installation is successful.
Install php Development Kit
Extensions can be installed only when the development kit is installed.
sudo apt-get install php5-dev
Install php extensions
A) install php-mysql
This installation is included in the system library and can be directly installed.
sudo apt-get install php5-mysql
Restart apache to load mysql
sudo service apache2 restart
B) install yaf
Install the pcre library before installing yaf. Otherwise, an error is reported.
sudo apt-get install libpcre3 libpcre3-dev
Download the latest yaf file
cd /usr/local/src/sudowget https://github.com/laruence/php-yaf/archive/master.zip
- The name of the file to be downloaded is different from that of the file to be downloaded.
Extract
sudounzip yaf.zip
As shown in figure
cd php-yaf-mastersudo /usr/bin/phpize
Configuration
Compile
Compile and install
The yaf. so file is generated in the following Directory.
Modify the configuration of php. ini and load yaf
sudovi php.ini
Change the extended directory to the directory where the so file is stored.
New
Restart apache
sudo service apache2 restart
Refresh the page and find that yaf is correctly installed.
If you need other installation steps similar to yaf.
The above introduces the installation of LAMP environment and yaf extension in Ubuntu14, including some content, and hope to help those who are interested in PHP tutorials.