: This article describes how to install the ApachePHP7MariaDB website environment in the Debian 8 environment. if you are interested in the PHP Tutorial, refer to it. 1. add the PHP7 data source and update the system
- After Debian is installed, you cannot use sudo. you need to use the root user to log in and install the sudo command.
apt-get install sudo
- Add a PHP 7 data source and update the system
echo"deb http://repos.zend.com/zend-server/early-access/php7/repos ubuntu/" >> /etc/apt/sources.list
- Update PHP 7 source and system
sudo apt-get update && sudo apt-get upgrade
If this prompt is displayed, Press Q to exit and continue.
II. install Apache and verify whether the installation is successful
sudo apt-get install apache2
3. install the MariaDB database
sudo apt-get install mariadb-server
Enter the command and press enter to see whether to continue. Type Y and press enter. The following window is displayed during installation. enter the ROOT password twice to continue installation.
IV. Set Database security options
mysql_secure_installation
In this way, the settings are much safer, and then we check the database status.
service mysql status
5. install PHP7
sudo apt-get install php7-nightly
6. set PHP7 to apply to APACHE
cp /usr/local/php7/libphp7.so /usr/lib/apache2/modules/cp /usr/local/php7/php7.load /etc/apache2/mods-available/
After moving the two lines of files, edit the file:
/etc/apache2/apache2.conf
Add the following script.
SetHandler application/x-httpd-php
Add the file above.
a2dismod mpm_event && a2enmod mpm_prefork && a2enmod php7
Run the command to take effect and restart APACHE.
service apache2 restart
7. check whether PHP 7 is normal
Here, create a php file in the/var/www/html/current directory, for example, create info. php, and add the script:
Then we can use the IP address to check whether the successful PHP7 version is available.
Reference original
'). AddClass ('pre-numbering '). hide (); $ (this ). addClass ('Has-numbering '). parent (). append ($ numbering); for (I = 1; I <= lines; I ++) {$ numbering. append ($ ('
'). Text (I) ;}; $ numbering. fadeIn (1700) ;}) ;}; script
The preceding section describes how to install Apache, PHP7, and MariaDB in the Debian8 environment, including related content. if you are interested in the PHP Tutorial.