Home > Backend Development > PHP Tutorial > Install Apache/PHP7/MariaDB website environment in Debian8 environment

Install Apache/PHP7/MariaDB website environment in Debian8 environment

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-07-29 08:59:52
Original
1380 people have browsed it

1. Add PHP7 data source and update the system

  • You cannot use sudo after installing Debian. You need to log in with the root user and install the sudo command
<code>apt-get install <span>sudo</span></code>
Copy after login
  • Add PHP7 data source and update the system
<code><span>echo</span><span>"deb http://repos.zend.com/zend-server/early-access/php7/repos ubuntu/"</span> >> /etc/apt/sources.<span>list</span></code>
Copy after login
  • Update the PHP7 source and system
<code><span>sudo</span> apt-get update && <span>sudo</span> apt-get upgrade</code>
Copy after login

Install Apache/PHP7/MariaDB website environment in Debian8 environment
When you encounter this prompt, just press Q to exit and continue

2. Install Apache and verify whether it is successful

<code><span>sudo</span> apt-get install apache2</code>
Copy after login

3. Install the MariaDB database

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

Enter the command and press Enter. When you see if you want to continue, type Y and press Enter. During the installation process, you will see the following window. Let us enter the ROOT password. You need to enter it twice before the installation will continue.
Install Apache/PHP7/MariaDB website environment in Debian8 environment

4. Set the security options of the database

<code>mysql_secure_installation</code>
Copy after login

Install Apache/PHP7/MariaDB website environment in Debian8 environment
This setting is much safer, and then we check the status of the database

<code>service mysql status</code>
Copy after login

Install Apache/PHP7/MariaDB website environment in Debian8 environment

5. Install PHP7

<code>sudo apt<span>-get</span> install php7<span>-nightly</span></code>
Copy after login

6. Set PHP7 to apply to APACHE

<code><span>cp</span> /usr/local/php7/libphp7<span>.so</span> /usr/lib/apache2/modules/

<span>cp</span> /usr/local/php7/php7<span>.load</span> /etc/apache2/mods-available/</code>
Copy after login

After executing the two-line file move, then edit the file:

<code>/etc/apache2/apache2<span>.conf</span></code>
Copy after login

Add the script below.

<code>SetHandler application/x<span>-httpd</span><span>-php</span></code>
Copy after login

Add the same at the end of the above file.

<code>a2dismod mpm_event && a2enmod mpm_prefork && a2enmod php7</code>
Copy after login

Execute the command to take effect, and then restart APACHE.

<code>service apache2 restart</code>
Copy after login

7. Check whether the PHP7 link is normal

Create a PHP file in the current directory of /var/www/html/, for example, create an info.php, and then add the script:

Then we open it with the IP address to see if You can see the successful PHP7 version.

Refer to the original text

').addClass('pre-numbering').hide(); $(this).addClass('has-numbering').parent().append($numbering); for (i = 1; i ').text(i)); }; $numbering.fadeIn(1700); }); });

The above introduces the installation of Apache/PHP7/MariaDB website environment in Debian8 environment, including the relevant content. I hope it will be helpful to friends who are interested in PHP tutorials.

Related labels:
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
Latest Issues
Apache automatically stops
From 1970-01-01 08:00:00
0
0
0
apache restart failed
From 1970-01-01 08:00:00
0
0
0
apache error
From 1970-01-01 08:00:00
0
0
0
How apache logs
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template