-
Notifications
You must be signed in to change notification settings - Fork 0
/
Preparando ambiente DEV.txt
executable file
·107 lines (73 loc) · 3.3 KB
/
Preparando ambiente DEV.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
Passo 2: Configurando Xdebug
sudo find /usr -type f -name xdebug.so
/usr/lib/php/20131226/xdebug.so
sudo nano /etc/php/7.>/cli/conf.d/20-xdebug.ini
# Adicionar em 20-xdebug.ini
zend_extension="/usr/lib/php/20190902/xdebug.so"
xdebug.remote_enable=1
xdebug.remote_autostart=1
xdebug.remote_handler=dbgp
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000
xdebug.profiler_enable=1
xdebug.profiler_output_dir="~/"
xdebug.max_nesting_level=250
xdebug.extended_info=1
xdebug.default_enable=true
xdebug.force_display_errors=1
Ativando apache para URL amigável
1 - Ativando modo rewrite sudo a2enmod rewrite
2 - Abra o arquivo sudo nano "/etc/apache2/apache2.conf" procure por as linhas
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
Altere para;
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
3 - Removendo mensagem de erro start do apache adicione ServerName localhost no início do arquivo salve reinicie o apache
sudo nano /etc/apache2/apache2.conf
Abra o arquivo:
sudo nano /etc/apache2/sites-available/000-default.conf ou default.conf
Alterar a linha:
DocumentRoot /var/www/html
para:
DocumentRoot /var/www
sudo service apache2 restart
#Relatório de Erros
O registro de erros pode ser útil para encontrar pontos problemáticos em sua aplicação, mas isso também pode expor informações sobre a estrutura de sua aplicação para o mundo exterior. Para proteger efetivamente sua aplicação dos problemas que poderiam ser causados com a exposição dessas mensagens, você precisa configurar seu servidor de formas diferentes quando em desenvolvimento versus quando em produção (no ar).
Desenvolvimento
Para mostrar erros no seus ambiente de desenvolvimento, configure as definições a seguir no seu php ini:
display_errors = On
display_startup_errors = On
error_reporting = -1
html_errors = On
log_errors = On
Do php.net:
Passar o valor -1 irá mostrar todos os erros possíveis, até mesmo quando novos níveis e constantes forem adicionados em versões futuras do PHP. A constante E_ALL também se comporta desta maneira a partir do PHP 5.4.
O nível de error E_STRICT foi introduzido no 5.3.0 e não faz parte do E_ALL, contudo ele tornou-se parte do E_ALL no 5.4.0. O que isso significa? Que para mostrar todos os erros possíveis na versão 5.3 você precisa usar -1 ou E_ALL | E_STRICT.
Reportando todos os erros possíveis em diferentes versões do PHP
< 5.3 -1 ou E_ALL
5.3 -1 ou E_ALL | E_STRICT
> 5.3 -1 ou E_ALL
Produção
Para esconder os erros no seu ambiente de produção, configure seu php.ini assim:
display_errors = Off
display_startup_errors = Off
error_reporting = E_ALL
log_errors = On
Com essas configurações em produção, os erros continuarão sendo registrados nos logs de erros do servidor web, mas eles não serão mostrados para o usuário. Para mais informações sobre essas configurações, veja o manual do PHP:
error_reporting
display_errors
display_startup_errors
log_errors
Install NPM and nodeJS
curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash -
sudo ln -s /usr/bin/krb5-config.mit /usr/bin/krb5-config
sudo ln -s /usr/lib/x86_64-linux-gnu/libgssapi_krb5.so.2 /usr/lib/libgssapi_krb5.so
sudo apt-get install python-pip libkrb5-dev
sudo pip install gssapi