This morning, when helping a friend solve a small VPS host environment and build a PHP environment, he was supposed to consider using panels or one click packages. But this friend only needs PHP functions, and even does not need to bind domain names. So we are ready to install a simple PHP version and MYSQL data through the direct apt get method in the debian system, and can simply run the general PHP script environment.
First, one command to install LAMP
apt-get install mysql-server mysql-client apache2 php5 php5-cli libapache2-mod-php5 php5-mysql php5-curl php5-gd php-pear php5-imagick php5-mcrypt php5-memcache php5-mhash php5-sqlite php5-xmlrpc php5-xsl php5-json php5-dev libpcre3-dev
Here, Lao Zuo runs the above command directly in the Debian7 environment. If you need to enter Y further, you can press Enter.

The interface for setting MYSQL management password will pop up here, and you need to enter it twice. The installation will continue after entering.

We will finish the installation here, won't we? It took less than one minute to finish all the work.
Second, check whether the PHP environment is normal
/var/www
At present, we directly enter the IP address. The root directory is in the above directory. We can throw a phpinfo file and check the current PHP version.

If we need to bind the domain name, we can manually add the bound domain name separately. Please refer to“ Complete Debian7 configuration, LAMP (Apache/MySQL/PHP) environment, and station building "This tutorial was the LAMP process compiled and installed manually by Lao Zuo at that time. You can add the bound domain name according to the prompts.
Third, add other component support
1. Install OpCode and APCu cache
pecl install ZendOpcache-beta
pecl install apcu-beta
Add the following script to "/etc/php5/apache2/php. ini"
zend_extension=opcache.so
extension=apcu.so
opcache.max_accelerated_files=30000
opcache.memory_consumption=160
opcache.revalidate_freq=0
2. Tools that may be required for installation
apt-get install htop vim
To sum up, the above rapid installation LAMP environment is suitable for our simple needs of PHP environment or MYSQL environment. For the formal site building environment, we still use the one button package or other environments with more functions and users.