<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Arquivos PHP 7.0 - Remontti</title>
	<atom:link href="https://blog.remontti.com.br/tag/php-7-0/feed" rel="self" type="application/rss+xml" />
	<link>https://blog.remontti.com.br/tag/php-7-0</link>
	<description>rudimar@remontti</description>
	<lastBuildDate>Tue, 01 Sep 2020 16:54:01 +0000</lastBuildDate>
	<language>pt-BR</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://blog.remontti.com.br/wp-content/uploads/2024/09/icone-rr-80x80.png</url>
	<title>Arquivos PHP 7.0 - Remontti</title>
	<link>https://blog.remontti.com.br/tag/php-7-0</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Passo-a-passo como criar um servidor web Apache2, PHP 7.0, MariaDB, PHPMyAdmin &#8220;LAMP&#8221; no Debian 9 Stretch</title>
		<link>https://blog.remontti.com.br/2024</link>
					<comments>https://blog.remontti.com.br/2024#comments</comments>
		
		<dc:creator><![CDATA[Rudimar Remontti]]></dc:creator>
		<pubDate>Mon, 19 Jun 2017 18:55:38 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tutoriais]]></category>
		<category><![CDATA[apache2]]></category>
		<category><![CDATA[Debian 9]]></category>
		<category><![CDATA[lamp]]></category>
		<category><![CDATA[MariaDB]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP 7.0]]></category>
		<category><![CDATA[phpMyAdmin]]></category>
		<category><![CDATA[Stretch]]></category>
		<category><![CDATA[webserver]]></category>
		<guid isPermaLink="false">http://blog.remontti.com.br/?p=2024</guid>

					<description><![CDATA[<p>Distribuição utilizada: Debian 9 Stretch / Instalação Limpa Com o lançamento do Debian 9 alguns pacotes foram substituído como: PHP5 -> PHP7.0 Mysql -> MariaDB (MariaDB é um banco de dados que surgiu como&#46;&#46;&#46;</p>
<p>O post <a href="https://blog.remontti.com.br/2024">Passo-a-passo como criar um servidor web Apache2, PHP 7.0, MariaDB, PHPMyAdmin &#8220;LAMP&#8221; no Debian 9 Stretch</a> apareceu primeiro em <a href="https://blog.remontti.com.br">Remontti</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p><img fetchpriority="high" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2017/06/webdev-debian9.jpg" alt="" width="800" height="376" class="alignnone size-full wp-image-2046" srcset="https://blog.remontti.com.br/wp-content/uploads/2017/06/webdev-debian9.jpg 800w, https://blog.remontti.com.br/wp-content/uploads/2017/06/webdev-debian9-300x141.jpg 300w, https://blog.remontti.com.br/wp-content/uploads/2017/06/webdev-debian9-768x361.jpg 768w, https://blog.remontti.com.br/wp-content/uploads/2017/06/webdev-debian9-520x245.jpg 520w" sizes="(max-width: 800px) 100vw, 800px" /></p>
<p>Distribuição utilizada: Debian 9 Stretch / <a href="https://blog.remontti.com.br/1152">Instalação Limpa</a></p>
<p>Com o lançamento do Debian 9 alguns pacotes foram substituído como:<br />
<strong>PHP5 -> PHP7.0</strong><br />
<strong>Mysql -> <a href="https://pt.wikipedia.org/wiki/MariaDB" target="_blank" rel="noopener noreferrer">MariaDB</a></strong> (<em>MariaDB é um banco de dados que surgiu como fork do MySQL, criado pelo próprio fundador do projeto após sua aquisição pela Oracle.</em>)</p>
<p>Vamos a instalação</p>
<pre class="remontti-code"># apt update
# apt upgrade
# apt install apache2 libapache2-mod-php7.0 php7.0 mariadb-client mariadb-server phpmyadmin</pre>
<p>Instale todos os pacotes dependentes. (S)</p>
<p><em>OBS: Se você instalar o pacote <strong>mysql-server</strong> ele vai estar instalando o mariadb-client mariadb-server.</em></p>
<p><a href="https://blog.remontti.com.br/wp-content/uploads/2017/06/Screenshot_20170619_143240.png" data-rel="lightbox-gallery-r4awMcQa" data-rl_title="" data-rl_caption="" title=""><img decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2017/06/Screenshot_20170619_143240-300x199.png" alt="" width="300" height="199" class="alignnone size-medium wp-image-2028" srcset="https://blog.remontti.com.br/wp-content/uploads/2017/06/Screenshot_20170619_143240-300x199.png 300w, https://blog.remontti.com.br/wp-content/uploads/2017/06/Screenshot_20170619_143240-768x509.png 768w, https://blog.remontti.com.br/wp-content/uploads/2017/06/Screenshot_20170619_143240-1024x679.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2017/06/Screenshot_20170619_143240.png 1192w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p>Na próxima tela selecione a opção apache2.<br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2017/06/Screenshot_20170619_143756.png" data-rel="lightbox-gallery-r4awMcQa" data-rl_title="" data-rl_caption="" title=""><img decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2017/06/Screenshot_20170619_143756-300x199.png" alt="" width="300" height="199" class="alignnone size-medium wp-image-2029" srcset="https://blog.remontti.com.br/wp-content/uploads/2017/06/Screenshot_20170619_143756-300x199.png 300w, https://blog.remontti.com.br/wp-content/uploads/2017/06/Screenshot_20170619_143756-768x509.png 768w, https://blog.remontti.com.br/wp-content/uploads/2017/06/Screenshot_20170619_143756-1024x679.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2017/06/Screenshot_20170619_143756.png 1192w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p>Configurando o banco do phpmyadmin:<br />
Responda Sim.<br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2017/06/Screenshot_20170619_144016.png" data-rel="lightbox-gallery-r4awMcQa" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2017/06/Screenshot_20170619_144016-300x199.png" alt="" width="300" height="199" class="alignnone size-medium wp-image-2030" srcset="https://blog.remontti.com.br/wp-content/uploads/2017/06/Screenshot_20170619_144016-300x199.png 300w, https://blog.remontti.com.br/wp-content/uploads/2017/06/Screenshot_20170619_144016-768x509.png 768w, https://blog.remontti.com.br/wp-content/uploads/2017/06/Screenshot_20170619_144016-1024x679.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2017/06/Screenshot_20170619_144016.png 1192w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a></p>
<p>Defina uma senha para a base do phpmyadmin:<br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2017/06/Screenshot_20170619_144112.png" data-rel="lightbox-gallery-r4awMcQa" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2017/06/Screenshot_20170619_144112-300x199.png" alt="" width="300" height="199" class="alignnone size-medium wp-image-2031" srcset="https://blog.remontti.com.br/wp-content/uploads/2017/06/Screenshot_20170619_144112-300x199.png 300w, https://blog.remontti.com.br/wp-content/uploads/2017/06/Screenshot_20170619_144112-768x509.png 768w, https://blog.remontti.com.br/wp-content/uploads/2017/06/Screenshot_20170619_144112-1024x679.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2017/06/Screenshot_20170619_144112.png 1192w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a></p>
<p>Repita a senha:<br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2017/06/Screenshot_20170619_144154.png" data-rel="lightbox-gallery-r4awMcQa" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2017/06/Screenshot_20170619_144154-300x199.png" alt="" width="300" height="199" class="alignnone size-medium wp-image-2032" srcset="https://blog.remontti.com.br/wp-content/uploads/2017/06/Screenshot_20170619_144154-300x199.png 300w, https://blog.remontti.com.br/wp-content/uploads/2017/06/Screenshot_20170619_144154-768x509.png 768w, https://blog.remontti.com.br/wp-content/uploads/2017/06/Screenshot_20170619_144154-1024x679.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2017/06/Screenshot_20170619_144154.png 1192w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a><br />
Instalação concluída!<br />
Acesse <strong>http://ip-do-seu-servidor/</strong><br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2017/06/Screenshot_20170619_150403.png" data-rel="lightbox-gallery-r4awMcQa" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2017/06/Screenshot_20170619_150403-300x158.png" alt="" width="300" height="158" class="alignnone size-medium wp-image-2039" srcset="https://blog.remontti.com.br/wp-content/uploads/2017/06/Screenshot_20170619_150403-300x158.png 300w, https://blog.remontti.com.br/wp-content/uploads/2017/06/Screenshot_20170619_150403-768x403.png 768w, https://blog.remontti.com.br/wp-content/uploads/2017/06/Screenshot_20170619_150403-1024x538.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2017/06/Screenshot_20170619_150403.png 1680w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a></p>
<p><strong>Não sentiu que faltou algo nessa instalação?</strong><br />
<strong>Sim!</strong> No MySQL você definia uma senha para para o usuário root do mysql na instalação, com o MariaDB isso não acontece pois ele vem sem senha de root! Como usuário root não tem senha você não vai conseguir logar com ele no PHPMyAdmin.<br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2017/06/Screenshot_20170619_144650.png" data-rel="lightbox-gallery-r4awMcQa" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2017/06/Screenshot_20170619_144650-202x300.png" alt="" width="202" height="300" class="alignnone size-medium wp-image-2034" srcset="https://blog.remontti.com.br/wp-content/uploads/2017/06/Screenshot_20170619_144650-202x300.png 202w, https://blog.remontti.com.br/wp-content/uploads/2017/06/Screenshot_20170619_144650.png 432w" sizes="auto, (max-width: 202px) 100vw, 202px" /></a></p>
<p>Para alterar a senha do usuário root do MariaDB faça:</p>
<pre class="remontti-code"># mariadb -u root</pre>
<pre class="remontti-code">USE mysql;
UPDATE user SET password=PASSWORD(&#039;SUA-SENHA&#039;) WHERE User=&#039;root&#039;;
UPDATE user SET plugin=&quot;mysql_native_password&quot;;
FLUSH PRIVILEGES;
quit;</pre>
<p>Mas não se assuste! MariaDB é praticamente o seu velho MySQL. Para saber mais acesse: <a href="https://mariadb.com/kb/pt-br/mariadb-versus-mysql-compatibility/" target="_blank" rel="noopener noreferrer">MariaDB versus MySQL &#8211; Compatibilidade</a>. Veja pelo lado bom, não permitindo login com root temos mais segurança!<br />
O que fazer então? Simples crie uma base de dados e um usuário para acessa-la. Eu sempre recomendei usar para cada aplicação um usuário com a sua base, assim numa falha você  não deixa exposto o que não deveria!<br />
Acesse via linha de comando nosso o mariadb (o comando mysql -p funciona também) </p>
<pre class="remontti-code"># mariadb -p</pre>
<p>Por padrão vem sem senha.</p>
<pre class="remontti-code">CREATE DATABASE minhabase;
GRANT ALL PRIVILEGES ON minhabase.* TO &#039;meuusuario&#039;@&#039;localhost&#039; IDENTIFIED BY &#039;minhasenha&#039;;
FLUSH PRIVILEGES;
quit;</pre>
<p><a href="https://blog.remontti.com.br/wp-content/uploads/2017/06/Screenshot_20170619_145812.png" data-rel="lightbox-gallery-r4awMcQa" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2017/06/Screenshot_20170619_145812-300x106.png" alt="" width="300" height="106" class="alignnone size-medium wp-image-2035" srcset="https://blog.remontti.com.br/wp-content/uploads/2017/06/Screenshot_20170619_145812-300x106.png 300w, https://blog.remontti.com.br/wp-content/uploads/2017/06/Screenshot_20170619_145812-768x271.png 768w, https://blog.remontti.com.br/wp-content/uploads/2017/06/Screenshot_20170619_145812-1024x362.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2017/06/Screenshot_20170619_145812.png 1157w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a></p>
<p>Agora pode acessar seu PHPMyAdmin com seu seu usuário e senha. <strong>http://ip-do-seu-servidor/phpmyadmin</strong><br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2017/06/Screenshot_20170619_150017.png" data-rel="lightbox-gallery-r4awMcQa" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2017/06/Screenshot_20170619_150017-300x157.png" alt="" width="300" height="157" class="alignnone size-medium wp-image-2036" srcset="https://blog.remontti.com.br/wp-content/uploads/2017/06/Screenshot_20170619_150017-300x157.png 300w, https://blog.remontti.com.br/wp-content/uploads/2017/06/Screenshot_20170619_150017-768x402.png 768w, https://blog.remontti.com.br/wp-content/uploads/2017/06/Screenshot_20170619_150017-1024x536.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2017/06/Screenshot_20170619_150017.png 1680w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a><a href="https://blog.remontti.com.br/wp-content/uploads/2017/06/Screenshot_20170619_150027.png" data-rel="lightbox-gallery-r4awMcQa" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2017/06/Screenshot_20170619_150027-300x158.png" alt="" width="300" height="158" class="alignnone size-medium wp-image-2037" srcset="https://blog.remontti.com.br/wp-content/uploads/2017/06/Screenshot_20170619_150027-300x158.png 300w, https://blog.remontti.com.br/wp-content/uploads/2017/06/Screenshot_20170619_150027-768x404.png 768w, https://blog.remontti.com.br/wp-content/uploads/2017/06/Screenshot_20170619_150027-1024x539.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2017/06/Screenshot_20170619_150027.png 1680w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a></p>
<p>Agora vamos habilitar o <a href="http://httpd.apache.org/docs/current/mod/mod_rewrite.html">mod_rewrite</a> do Apache que é muito utilizado. Este é um módulo do Apache que utiliza um mecanismo baseado em regras de reescrita.</p>
<p>Diretório de configurações do Apache fica em <strong>/etc/apache2/</strong></p>
<p>Vamos ao comando para habilita-lo:</p>
<pre class="remontti-code"># a2enmod rewrite</pre>
<p>A página que vimos ao abri o ip do nosso servidor no navegador fica no diretório /var/www/html, isso está sendo informado no arquivo default do apache que fica em <em>/etc/apache2/sites-enabled/000-default.conf</em>, e para que nosso <a href="http://httpd.apache.org/docs/current/mod/mod_rewrite.html">mod_rewrite</a> funcione corretamente será necessário adicionar alguma linhas.</p>
<p>Edite o arquivo /etc/apache2/sites-enabled/000-default.conf (vou usar o editor vim, que não vem instalado por padrão no sistema, mas se você pode usar qualquer edito ex o nano)</p>
<pre class="remontti-code"># vim /etc/apache2/sites-enabled/000-default.conf</pre>
<p>Adicione abaixo de &#8220;<span style="color: #000080;"><strong>DocumentRoot /var/www/html</strong>&#8220;</span> o seguinte:</p>
<pre class="remontti-code">	
	&lt;Directory /var/www/html/&gt;
    		Options FollowSymLinks
    		AllowOverride All
	&lt;/Directory&gt;
</pre>
<p><a href="https://blog.remontti.com.br/wp-content/uploads/2017/06/Screenshot_20170619_150942.png" data-rel="lightbox-gallery-r4awMcQa" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2017/06/Screenshot_20170619_150942-300x172.png" alt="" width="300" height="172" class="alignnone size-medium wp-image-2042" srcset="https://blog.remontti.com.br/wp-content/uploads/2017/06/Screenshot_20170619_150942-300x172.png 300w, https://blog.remontti.com.br/wp-content/uploads/2017/06/Screenshot_20170619_150942-768x441.png 768w, https://blog.remontti.com.br/wp-content/uploads/2017/06/Screenshot_20170619_150942-1024x588.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2017/06/Screenshot_20170619_150942.png 1192w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a></p>
<p>Por segurança recomendo remover a assinatura do servidor, evitando os &#8220;espertinhos&#8221;</p>
<pre class="remontti-code"># sed -i &#039;s/ServerTokens OS/ServerTokens Prod/&#039; /etc/apache2/conf-available/security.conf
# sed -i &#039;s/ServerSignature On/ServerSignature Off/&#039; /etc/apache2/conf-available/security.conf</pre>
<p>Agora precisamos restartar o apache para que tenha efeito nossas alterações.</p>
<pre class="remontti-code"># /etc/init.d/apache2 restart</pre>
<p>Ou</p>
<pre class="remontti-code"># systemctl restart apache2</pre>
<p>Parabéns seu servidor está &#8220;Pronto&#8221;!</p>
<p>O post <a href="https://blog.remontti.com.br/2024">Passo-a-passo como criar um servidor web Apache2, PHP 7.0, MariaDB, PHPMyAdmin &#8220;LAMP&#8221; no Debian 9 Stretch</a> apareceu primeiro em <a href="https://blog.remontti.com.br">Remontti</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.remontti.com.br/2024/feed</wfw:commentRss>
			<slash:comments>47</slash:comments>
		
		
			</item>
	</channel>
</rss>
