Re: Problema com PHP 5.6

2018-03-01 Por tôpico J . S . Júnior

Em 1 de mar de 2018, à(s) 09:01, Leonardo S. S. da Rocha 
mailto:leonardo...@gmail.com>> escreveu:

O que eu estranho Júnior é que a mesma aplicação com o mesmo banco
funciona perfeitamente bem num ambiente de teste com Windows 7 e xampp
instalado! Isso que não faz sentido!


Não é estranho não.


Se o banco na base de teste tem o idPessoa

E o Banco na base de produção não.

Então não é estranho checa a linha 4 veja qual tabela é e compare
A tabela da produção com a de teste.

[]’s

Júnior Santos
ITIL® Foundation Certificate in IT Service Management
Registration number 4365854.1019776
E-mail: j.s.jun...@live.com / 
jsjun...@checkmobi.com.br


Re: Problema com PHP 5.6

2018-03-01 Por tôpico J . S . Júnior

Em 28 de fev de 2018, à(s) 22:45, Leonardo S. S. da Rocha 
mailto:leonardo...@gmail.com>> escreveu:

Wed Feb 28 22:33:13.013875 2018] [:error] [pid 1709] [client
189.149.25.1:50700] PHP Notice:  Undefined index: idPessoa in
/var/www/html/sistema/sessao.php on line 4
[Wed Feb 28 22:33:13.014863 2018] [:error] [pid 1709] [client
189.149.25.1:50700] PHP Notice:  A session had already been started -
ignoring session_start() in /var/www/html/sistema/sessao.php on line
25


E vc também tem um índice indefinido (ou seja uma coluna na tabela não existe)

 Undefined index: idPessoa in

Ou Existe com outro nome na linha 4 dentro da consulta SQL.

Com isso parece que todo o resto da erro, além do detalhes que os colegas 
falaram

[]’s

Júnior Santos
ITIL® Foundation Certificate in IT Service Management
Registration number 4365854.1019776
E-mail: j.s.jun...@live.com / 
jsjun...@checkmobi.com.br



Re: Problema com PHP 5.6

2018-03-01 Por tôpico Leonardo S. S. da Rocha
O que eu estranho Júnior é que a mesma aplicação com o mesmo banco
funciona perfeitamente bem num ambiente de teste com Windows 7 e xampp
instalado! Isso que não faz sentido!

2018-03-01 8:59 GMT-03:00 J. S. Júnior :
>
> Em 28 de fev de 2018, à(s) 22:45, Leonardo S. S. da Rocha
>  escreveu:
>
> Wed Feb 28 22:33:13.013875 2018] [:error] [pid 1709] [client
> 189.149.25.1:50700] PHP Notice:  Undefined index: idPessoa in
> /var/www/html/sistema/sessao.php on line 4
> [Wed Feb 28 22:33:13.014863 2018] [:error] [pid 1709] [client
> 189.149.25.1:50700] PHP Notice:  A session had already been started -
> ignoring session_start() in /var/www/html/sistema/sessao.php on line
> 25
>
>
>
> E vc também tem um índice indefinido (ou seja uma coluna na tabela não
> existe)
>
>  Undefined index: idPessoa in
>
>
> Ou Existe com outro nome na linha 4 dentro da consulta SQL.
>
> Com isso parece que todo o resto da erro, além do detalhes que os colegas
> falaram
>
> []’s
>
> Júnior Santos
> ITIL® Foundation Certificate in IT Service Management
> Registration number 4365854.1019776
> E-mail: j.s.jun...@live.com / jsjun...@checkmobi.com.br
>



Re: Problema com PHP 5.6

2018-03-01 Por tôpico Leonardo S. S. da Rocha
Oi Luiz, obrigado pela sugestão. Na verdade esse IP ai não é válido.
Eu mudei ele! Vou ver se consigo testar a conexão da aplicação ao
banco então!



2018-03-01 8:28 GMT-03:00 Luiz Felipph :
> Bom dia,
>
> É provável que sua aplicação não tenha conseguido se conectar ao banco:
>
> 189.149.25.1:50708] PHP Warning:  mysql_fetch_array() expects
> parameter 1 to be resource, boolean given in (...)
>
>
> Outra coisa, cuidado ao publicar logs com IPs válidos.
>
> faz assim:
>
> mysql_pconnect('host,'login,'pass') or die(mysql_error());
>
>
> Felipph
>
> Em 28 de fevereiro de 2018 22:45, Leonardo S. S. da Rocha
>  escreveu:
>>
>> Eis o que o Log de erro me retornou. Não diz muito pra mim. Pode ser
>> pelo fato de eu não conhecer muito PHP. Alguma coisa está passando
>> neste log que eu não estou vendo e que poderia ser o motivo do meu
>> problema?
>>
>> [Wed Feb 28 22:33:13.013875 2018] [:error] [pid 1709] [client
>> 189.149.25.1:50700] PHP Notice:  Undefined index: idPessoa in
>> /var/www/html/sistema/sessao.php on line 4
>> [Wed Feb 28 22:33:13.014863 2018] [:error] [pid 1709] [client
>> 189.149.25.1:50700] PHP Notice:  A session had already been started -
>> ignoring session_start() in /var/www/html/sistema/sessao.php on line
>> 25
>> [Wed Feb 28 22:33:13.014950 2018] [:error] [pid 1709] [client
>> 189.149.25.1:50700] PHP Notice:  Undefined variable: imagem in
>> /var/www/html/sistema/index.php on line 107
>> [Wed Feb 28 22:33:13.014978 2018] [:error] [pid 1709] [client
>> 189.149.25.1:50700] PHP Notice:  Undefined variable: nivel in
>> /var/www/html/sistema/index.php on line 139
>> [Wed Feb 28 22:33:13.014986 2018] [:error] [pid 1709] [client
>> 189.149.25.1:50700] PHP Notice:  Undefined variable: nivel in
>> /var/www/html/sistema/index.php on line 152
>> [Wed Feb 28 22:33:13.014993 2018] [:error] [pid 1709] [client
>> 189.149.25.1:50700] PHP Notice:  Undefined variable: nivel in
>> /var/www/html/sistema/index.php on line 157
>> [Wed Feb 28 22:33:13.015001 2018] [:error] [pid 1709] [client
>> 189.149.25.1:50700] PHP Notice:  Undefined variable: nivel in
>> /var/www/html/sistema/index.php on line 163
>> [Wed Feb 28 22:33:13.015007 2018] [:error] [pid 1709] [client
>> 189.149.25.1:50700] PHP Notice:  Undefined variable: nivel in
>> /var/www/html/sistema/index.php on line 169
>> [Wed Feb 28 22:33:13.015014 2018] [:error] [pid 1709] [client
>> 189.149.25.1:50700] PHP Notice:  Undefined variable: nivel in
>> /var/www/html/sistema/index.php on line 176
>> [Wed Feb 28 22:33:13.015021 2018] [:error] [pid 1709] [client
>> 189.149.25.1:50700] PHP Notice:  Undefined variable: nivel in
>> /var/www/html/sistema/index.php on line 219
>> [Wed Feb 28 22:33:13.101396 2018] [:error] [pid 1709] [client
>> 189.149.25.1:50700] PHP Warning:  mysql_fetch_array() expects
>> parameter 1 to be resource, boolean given in
>> /var/www/html/sistema/index.php on line 386
>> [Wed Feb 28 22:33:13.105538 2018] [:error] [pid 1709] [client
>> 189.149.25.1:50700] PHP Warning:  mysql_fetch_array() expects
>> parameter 1 to be resource, boolean given in
>> /var/www/html/sistema/index.php on line 538
>> [Wed Feb 28 22:33:13.105682 2018] [:error] [pid 1709] [client
>> 189.149.25.1:50700] PHP Warning:  mysql_num_rows() expects parameter 1
>> to be resource, boolean given in /var/www/html/sistema/index.php on
>> line 630
>> [Wed Feb 28 22:33:13.105694 2018] [:error] [pid 1709] [client
>> 189.149.25.1:50700] PHP Warning:  mysql_fetch_array() expects
>> parameter 1 to be resource, boolean given in
>> /var/www/html/sistema/index.php on line 633
>> [Wed Feb 28 22:33:13.105817 2018] [:error] [pid 1709] [client
>> 189.149.25.1:50700] PHP Warning:  mysql_fetch_array() expects
>> parameter 1 to be resource, boolean given in
>> /var/www/html/sistema/index.php on line 645
>> [Wed Feb 28 22:33:14.021971 2018] [:error] [pid 1709] [client
>> 189.149.25.1:50700] PHP Notice:  Undefined index: msg in
>> /var/www/html/sistema/login.php on line 51, referer:
>> http://gaia.uel.br/sistema/
>> [Wed Feb 28 22:33:14.022006 2018] [:error] [pid 1709] [client
>> 189.149.25.1:50700] PHP Notice:  Undefined index: msg in
>> /var/www/html/sistema/login.php on line 61, referer:
>> http://gaia.uel.br/sistema/
>> [Wed Feb 28 22:33:14.022016 2018] [:error] [pid 1709] [client
>> 189.149.25.1:50700] PHP Notice:  Undefined index: email in
>> /var/www/html/sistema/login.php on line 72, referer:
>> http://gaia.uel.br/sistema/
>> [Wed Feb 28 22:33:14.022024 2018] [:error] [pid 1709] [client
>> 189.149.25.1:50700] PHP Notice:  Undefined index: senha in
>> /var/www/html/sistema/login.php on line 78, referer:
>> http://gaia.uel.br/sistema/
>> [Wed Feb 28 22:33:28.103500 2018] [:error] [pid 2533] [client
>> 189.149.25.1:50708] PHP Notice:  Undefined index: msg in
>> /var/www/html/sistema/index.php on line 221, referer:
>> http://gaia.uel.br/sistema/acessar.php
>> [Wed Feb 28 22:33:28.191985 2018] [:error] [pid 2533] [client
>> 189.149.25.1:50708] PHP Warning:  mysql_fetch_array() expects
>> pa

Re: Problema com PHP 5.6

2018-03-01 Por tôpico Leonardo S. S. da Rocha
Oi Paulino, muito obrigado por suas contribuições!

respondendo às suas perguntas:
sim
sim
não (o banco de dados existe)
sim
sim

Eu vou encontrar como habilitar o log de erros do mysql pra verificar
ele. No novo S.O. que foi instalado algumas coisas foram
descontinuadas sabe. A versão padrão do php agora é a 7. Eu instalei a
versão 5.6 por meio não oficial, disponóvel pela distribuição. Ocorre
que outras aplicações PHP estão funcionamento perfeitamente bem. Tô
achando isso estranho!

2018-03-01 8:27 GMT-03:00 Paulino Kenji Sato :
> Bom dia.
>
> 2018-02-28 22:45 GMT-03:00 Leonardo S. S. da Rocha :
>>
>> Eis o que o Log de erro me retornou. Não diz muito pra mim. Pode ser
>> pelo fato de eu não conhecer muito PHP. Alguma coisa está passando
>> neste log que eu não estou vendo e que poderia ser o motivo do meu
>> problema?
>>
>
> Como disse no email anterior, não há nenhuma tratamento de erro, pelo menos
> no que tange a comunicação com o mysql.
> Essa linha do log por exemplo, não sei qual o código de fato, mas posso
> deduzir que e algo como mostrado logo abaixo,
> [Wed Feb 28 22:33:13.101396 2018] [:error] [pid 1709] [client
> 189.149.25.1:50700] PHP Warning:  mysql_fetch_array() expects
> parameter 1 to be resource, boolean given in
> /var/www/html/sistema/index.php on line 386
>
>
>  ...
> $consulta=mysql_query("select coluna from tabela"); // Essa query retornou
> um erro.
> $resultado=mysql_fetch_array($consulta); // $consulta, devido ao erro e do
> tipo boolean, falso.
> echo $resultado['coluna']; // $resultado, devido a erros anteriores, não
> possui nenhuma informação, gerando um erro de índice não existente.
> ?>
>
> Mas, não existe no log menção ao erro do mysql. Suspeito que tenham usando o
> operador @ para suprimir o erro (@mysql_query).
>
> Em resumo, o log somente mostra as consequências de algum erro, não o erro
> em si.
>
> O endereço do servidor mysql esta correto?
> Usuário e senha do mysql estão corretas?
> Esta acessando um banco de dados que não existe?
> A tabela existe?
> A coluna existe?
>
> --
> Paulino Kenji Sato



Re: Problema com PHP 5.6

2018-03-01 Por tôpico Luiz Felipph
Bom dia,

É provável que sua aplicação não tenha conseguido se conectar ao banco:

189.149.25.1:50708] PHP Warning:  mysql_fetch_array() expects
parameter 1 to be resource, boolean given in (...)


Outra coisa, cuidado ao publicar logs com IPs válidos.

faz assim:

mysql_pconnect('host,'login,'pass') or die(mysql_error());


Felipph

Em 28 de fevereiro de 2018 22:45, Leonardo S. S. da Rocha <
leonardo...@gmail.com> escreveu:

> Eis o que o Log de erro me retornou. Não diz muito pra mim. Pode ser
> pelo fato de eu não conhecer muito PHP. Alguma coisa está passando
> neste log que eu não estou vendo e que poderia ser o motivo do meu
> problema?
>
> [Wed Feb 28 22:33:13.013875 2018] [:error] [pid 1709] [client
> 189.149.25.1:50700] PHP Notice:  Undefined index: idPessoa in
> /var/www/html/sistema/sessao.php on line 4
> [Wed Feb 28 22:33:13.014863 2018] [:error] [pid 1709] [client
> 189.149.25.1:50700] PHP Notice:  A session had already been started -
> ignoring session_start() in /var/www/html/sistema/sessao.php on line
> 25
> [Wed Feb 28 22:33:13.014950 2018] [:error] [pid 1709] [client
> 189.149.25.1:50700] PHP Notice:  Undefined variable: imagem in
> /var/www/html/sistema/index.php on line 107
> [Wed Feb 28 22:33:13.014978 2018] [:error] [pid 1709] [client
> 189.149.25.1:50700] PHP Notice:  Undefined variable: nivel in
> /var/www/html/sistema/index.php on line 139
> [Wed Feb 28 22:33:13.014986 2018] [:error] [pid 1709] [client
> 189.149.25.1:50700] PHP Notice:  Undefined variable: nivel in
> /var/www/html/sistema/index.php on line 152
> [Wed Feb 28 22:33:13.014993 2018] [:error] [pid 1709] [client
> 189.149.25.1:50700] PHP Notice:  Undefined variable: nivel in
> /var/www/html/sistema/index.php on line 157
> [Wed Feb 28 22:33:13.015001 2018] [:error] [pid 1709] [client
> 189.149.25.1:50700] PHP Notice:  Undefined variable: nivel in
> /var/www/html/sistema/index.php on line 163
> [Wed Feb 28 22:33:13.015007 2018] [:error] [pid 1709] [client
> 189.149.25.1:50700] PHP Notice:  Undefined variable: nivel in
> /var/www/html/sistema/index.php on line 169
> [Wed Feb 28 22:33:13.015014 2018] [:error] [pid 1709] [client
> 189.149.25.1:50700] PHP Notice:  Undefined variable: nivel in
> /var/www/html/sistema/index.php on line 176
> [Wed Feb 28 22:33:13.015021 2018] [:error] [pid 1709] [client
> 189.149.25.1:50700] PHP Notice:  Undefined variable: nivel in
> /var/www/html/sistema/index.php on line 219
> [Wed Feb 28 22:33:13.101396 2018] [:error] [pid 1709] [client
> 189.149.25.1:50700] PHP Warning:  mysql_fetch_array() expects
> parameter 1 to be resource, boolean given in
> /var/www/html/sistema/index.php on line 386
> [Wed Feb 28 22:33:13.105538 2018] [:error] [pid 1709] [client
> 189.149.25.1:50700] PHP Warning:  mysql_fetch_array() expects
> parameter 1 to be resource, boolean given in
> /var/www/html/sistema/index.php on line 538
> [Wed Feb 28 22:33:13.105682 2018] [:error] [pid 1709] [client
> 189.149.25.1:50700] PHP Warning:  mysql_num_rows() expects parameter 1
> to be resource, boolean given in /var/www/html/sistema/index.php on
> line 630
> [Wed Feb 28 22:33:13.105694 2018] [:error] [pid 1709] [client
> 189.149.25.1:50700] PHP Warning:  mysql_fetch_array() expects
> parameter 1 to be resource, boolean given in
> /var/www/html/sistema/index.php on line 633
> [Wed Feb 28 22:33:13.105817 2018] [:error] [pid 1709] [client
> 189.149.25.1:50700] PHP Warning:  mysql_fetch_array() expects
> parameter 1 to be resource, boolean given in
> /var/www/html/sistema/index.php on line 645
> [Wed Feb 28 22:33:14.021971 2018] [:error] [pid 1709] [client
> 189.149.25.1:50700] PHP Notice:  Undefined index: msg in
> /var/www/html/sistema/login.php on line 51, referer:
> http://gaia.uel.br/sistema/
> [Wed Feb 28 22:33:14.022006 2018] [:error] [pid 1709] [client
> 189.149.25.1:50700] PHP Notice:  Undefined index: msg in
> /var/www/html/sistema/login.php on line 61, referer:
> http://gaia.uel.br/sistema/
> [Wed Feb 28 22:33:14.022016 2018] [:error] [pid 1709] [client
> 189.149.25.1:50700] PHP Notice:  Undefined index: email in
> /var/www/html/sistema/login.php on line 72, referer:
> http://gaia.uel.br/sistema/
> [Wed Feb 28 22:33:14.022024 2018] [:error] [pid 1709] [client
> 189.149.25.1:50700] PHP Notice:  Undefined index: senha in
> /var/www/html/sistema/login.php on line 78, referer:
> http://gaia.uel.br/sistema/
> [Wed Feb 28 22:33:28.103500 2018] [:error] [pid 2533] [client
> 189.149.25.1:50708] PHP Notice:  Undefined index: msg in
> /var/www/html/sistema/index.php on line 221, referer:
> http://gaia.uel.br/sistema/acessar.php
> [Wed Feb 28 22:33:28.191985 2018] [:error] [pid 2533] [client
> 189.149.25.1:50708] PHP Warning:  mysql_fetch_array() expects
> parameter 1 to be resource, boolean given in
> /var/www/html/sistema/index.php on line 386, referer:
> http://gaia.uel.br/sistema/acessar.php
> [Wed Feb 28 22:33:28.196796 2018] [:error] [pid 2533] [client
> 189.149.25.1:50708] PHP Warning:  mysql_fetch_array() expects
> paramete

Re: Problema com PHP 5.6

2018-03-01 Por tôpico Paulino Kenji Sato
Bom dia.

2018-02-28 22:45 GMT-03:00 Leonardo S. S. da Rocha :

> Eis o que o Log de erro me retornou. Não diz muito pra mim. Pode ser
> pelo fato de eu não conhecer muito PHP. Alguma coisa está passando
> neste log que eu não estou vendo e que poderia ser o motivo do meu
> problema?
>
>
Como disse no email anterior, não há nenhuma tratamento de erro, pelo menos
no que tange a comunicação com o mysql.
Essa linha do log por exemplo, não sei qual o código de fato, mas posso
deduzir que e algo como mostrado logo abaixo,
[Wed Feb 28 22:33:13.101396 2018] [:error] [pid 1709] [client
189.149.25.1:50700] PHP Warning:  mysql_fetch_array() expects
parameter 1 to be resource, boolean given in
/var/www/html/sistema/index.php on line 386




Mas, não existe no log menção ao erro do mysql. Suspeito que tenham usando
o operador @ para suprimir o erro (@mysql_query).

Em resumo, o log somente mostra as consequências de algum erro, não o erro
em si.

O endereço do servidor mysql esta correto?
Usuário e senha do mysql estão corretas?
Esta acessando um banco de dados que não existe?
A tabela existe?
A coluna existe?

-- 
Paulino Kenji Sato


Re: Problema com PHP 5.6

2018-02-28 Por tôpico Leonardo S. S. da Rocha
Eis o que o Log de erro me retornou. Não diz muito pra mim. Pode ser
pelo fato de eu não conhecer muito PHP. Alguma coisa está passando
neste log que eu não estou vendo e que poderia ser o motivo do meu
problema?

[Wed Feb 28 22:33:13.013875 2018] [:error] [pid 1709] [client
189.149.25.1:50700] PHP Notice:  Undefined index: idPessoa in
/var/www/html/sistema/sessao.php on line 4
[Wed Feb 28 22:33:13.014863 2018] [:error] [pid 1709] [client
189.149.25.1:50700] PHP Notice:  A session had already been started -
ignoring session_start() in /var/www/html/sistema/sessao.php on line
25
[Wed Feb 28 22:33:13.014950 2018] [:error] [pid 1709] [client
189.149.25.1:50700] PHP Notice:  Undefined variable: imagem in
/var/www/html/sistema/index.php on line 107
[Wed Feb 28 22:33:13.014978 2018] [:error] [pid 1709] [client
189.149.25.1:50700] PHP Notice:  Undefined variable: nivel in
/var/www/html/sistema/index.php on line 139
[Wed Feb 28 22:33:13.014986 2018] [:error] [pid 1709] [client
189.149.25.1:50700] PHP Notice:  Undefined variable: nivel in
/var/www/html/sistema/index.php on line 152
[Wed Feb 28 22:33:13.014993 2018] [:error] [pid 1709] [client
189.149.25.1:50700] PHP Notice:  Undefined variable: nivel in
/var/www/html/sistema/index.php on line 157
[Wed Feb 28 22:33:13.015001 2018] [:error] [pid 1709] [client
189.149.25.1:50700] PHP Notice:  Undefined variable: nivel in
/var/www/html/sistema/index.php on line 163
[Wed Feb 28 22:33:13.015007 2018] [:error] [pid 1709] [client
189.149.25.1:50700] PHP Notice:  Undefined variable: nivel in
/var/www/html/sistema/index.php on line 169
[Wed Feb 28 22:33:13.015014 2018] [:error] [pid 1709] [client
189.149.25.1:50700] PHP Notice:  Undefined variable: nivel in
/var/www/html/sistema/index.php on line 176
[Wed Feb 28 22:33:13.015021 2018] [:error] [pid 1709] [client
189.149.25.1:50700] PHP Notice:  Undefined variable: nivel in
/var/www/html/sistema/index.php on line 219
[Wed Feb 28 22:33:13.101396 2018] [:error] [pid 1709] [client
189.149.25.1:50700] PHP Warning:  mysql_fetch_array() expects
parameter 1 to be resource, boolean given in
/var/www/html/sistema/index.php on line 386
[Wed Feb 28 22:33:13.105538 2018] [:error] [pid 1709] [client
189.149.25.1:50700] PHP Warning:  mysql_fetch_array() expects
parameter 1 to be resource, boolean given in
/var/www/html/sistema/index.php on line 538
[Wed Feb 28 22:33:13.105682 2018] [:error] [pid 1709] [client
189.149.25.1:50700] PHP Warning:  mysql_num_rows() expects parameter 1
to be resource, boolean given in /var/www/html/sistema/index.php on
line 630
[Wed Feb 28 22:33:13.105694 2018] [:error] [pid 1709] [client
189.149.25.1:50700] PHP Warning:  mysql_fetch_array() expects
parameter 1 to be resource, boolean given in
/var/www/html/sistema/index.php on line 633
[Wed Feb 28 22:33:13.105817 2018] [:error] [pid 1709] [client
189.149.25.1:50700] PHP Warning:  mysql_fetch_array() expects
parameter 1 to be resource, boolean given in
/var/www/html/sistema/index.php on line 645
[Wed Feb 28 22:33:14.021971 2018] [:error] [pid 1709] [client
189.149.25.1:50700] PHP Notice:  Undefined index: msg in
/var/www/html/sistema/login.php on line 51, referer:
http://gaia.uel.br/sistema/
[Wed Feb 28 22:33:14.022006 2018] [:error] [pid 1709] [client
189.149.25.1:50700] PHP Notice:  Undefined index: msg in
/var/www/html/sistema/login.php on line 61, referer:
http://gaia.uel.br/sistema/
[Wed Feb 28 22:33:14.022016 2018] [:error] [pid 1709] [client
189.149.25.1:50700] PHP Notice:  Undefined index: email in
/var/www/html/sistema/login.php on line 72, referer:
http://gaia.uel.br/sistema/
[Wed Feb 28 22:33:14.022024 2018] [:error] [pid 1709] [client
189.149.25.1:50700] PHP Notice:  Undefined index: senha in
/var/www/html/sistema/login.php on line 78, referer:
http://gaia.uel.br/sistema/
[Wed Feb 28 22:33:28.103500 2018] [:error] [pid 2533] [client
189.149.25.1:50708] PHP Notice:  Undefined index: msg in
/var/www/html/sistema/index.php on line 221, referer:
http://gaia.uel.br/sistema/acessar.php
[Wed Feb 28 22:33:28.191985 2018] [:error] [pid 2533] [client
189.149.25.1:50708] PHP Warning:  mysql_fetch_array() expects
parameter 1 to be resource, boolean given in
/var/www/html/sistema/index.php on line 386, referer:
http://gaia.uel.br/sistema/acessar.php
[Wed Feb 28 22:33:28.196796 2018] [:error] [pid 2533] [client
189.149.25.1:50708] PHP Warning:  mysql_fetch_array() expects
parameter 1 to be resource, boolean given in
/var/www/html/sistema/index.php on line 538, referer:
http://gaia.uel.br/sistema/acessar.php
[Wed Feb 28 22:33:28.196954 2018] [:error] [pid 2533] [client
189.149.25.1:50708] PHP Warning:  mysql_num_rows() expects parameter 1
to be resource, boolean given in /var/www/html/sistema/index.php on
line 630, referer: http://gaia.uel.br/sistema/acessar.php
[Wed Feb 28 22:33:28.196981 2018] [:error] [pid 2533] [client
189.149.25.1:50708] PHP Warning:  mysql_fetch_array() expects
parameter 1 to be resource, boolean given in
/var/www/html/sistema/index.php on line

Re: Problema com PHP 5.6

2018-02-28 Por tôpico Paulino Kenji Sato
Ola,
Isso me parece uma falta de tratamento de erros por parte de quem fez a
aplicação.

Existem dois "driver" de acesso ao mysql no php, o original, mysql  e o
melhorado o mysqli.
O mysql original esta em desuso, não sendo mais suportando no php7.
Tem também o PDO_MYSQL, orientado a objeto.
O mysqli tanto pode ser orientando a objeto como procedural.
Não e complicado migrar do mysql para o mysqli procedural, muitas vezes
bastando somente trocar o mysql_ pelo mysqli e incluir o "link" de conexão
com o bando de dados.

Verifique o log de erro do servidor.
Não existe erro? o log deve estar desligado no php.ini

Servidores de produção costumam suprimir as mensagens de erros produzidos
pelo php. Dificultando a identificação de que esta ocorrendo erros de
execução. Muitas vezes apresentando um resultado aparentemente normal ,
caso o programador não tenha feito as rotinas de tratamento de erro.
As mensagens de erros podem ser habilitados no php.ini, o .htaccess e o
próprio .php
Busque no google por: php error reporting




2018-02-28 13:56 GMT-03:00 Leonardo S. S. da Rocha :

> Olá pessoal, boa tarde!
>
> estou com uma aplicação que gerencia o conteúdo de um site da
> universidade onde estudo (gaia.uel.br). Esta aplicação, escrita em php
> 5.6, não está funcionando corretamente no servidor de produção. Ao
> tentar inserir um novo artigo, por exemplo, recebemos a mensagem de
> que o artigo foi inserido corretamente. No entanto algo acontece pois
> o artigo não foi inserido de fato. Já testei, via phpmyadmin, a
> inserção de um artigo e funciona perfeitamente. Isso me faz pensar que
> não estou com problemas no Mysql.
> Como a versão stretch atualizou a versão do php pra 7, penso que tenha
> alguma coisa a ver com isso!
>
> Eu tentei este material:
>
> https://stackoverflow.com/questions/46378017/install-php5-6-in-debian-9
>
> Mesmo assim a coisa não funciona. Eu simulei um cenário com máquina
> virtual com Windows 7 e xampp instalado (ambiente usado pelo
> desenvolvedor) pra testar e a aplicação funciona perfeitamente bem.
> Não sei se está me escapando algo que o xampp trata. Enfim, gostaria
> de um ajuda pra me dar uma luz por onde começar pra encontrar o
> problema e resolve-lo.
>
> Esta é a versão do ambiente de produção:
>
> PHP Version 5.6.33-1+0~20180105151408.9+stretch~1.gbp0deeda
>
> Esta é a versão do PHP do ambiente de teste
>
> PHP Version 5.6.33
>
> Alguém saberia me orientar em como proceder pra achar esse problema?
>
> Agradeço.
>
>


-- 
Paulino Kenji Sato


Problema com PHP 5.6

2018-02-28 Por tôpico Leonardo S. S. da Rocha
Olá pessoal, boa tarde!

estou com uma aplicação que gerencia o conteúdo de um site da
universidade onde estudo (gaia.uel.br). Esta aplicação, escrita em php
5.6, não está funcionando corretamente no servidor de produção. Ao
tentar inserir um novo artigo, por exemplo, recebemos a mensagem de
que o artigo foi inserido corretamente. No entanto algo acontece pois
o artigo não foi inserido de fato. Já testei, via phpmyadmin, a
inserção de um artigo e funciona perfeitamente. Isso me faz pensar que
não estou com problemas no Mysql.
Como a versão stretch atualizou a versão do php pra 7, penso que tenha
alguma coisa a ver com isso!

Eu tentei este material:

https://stackoverflow.com/questions/46378017/install-php5-6-in-debian-9

Mesmo assim a coisa não funciona. Eu simulei um cenário com máquina
virtual com Windows 7 e xampp instalado (ambiente usado pelo
desenvolvedor) pra testar e a aplicação funciona perfeitamente bem.
Não sei se está me escapando algo que o xampp trata. Enfim, gostaria
de um ajuda pra me dar uma luz por onde começar pra encontrar o
problema e resolve-lo.

Esta é a versão do ambiente de produção:

PHP Version 5.6.33-1+0~20180105151408.9+stretch~1.gbp0deeda

Esta é a versão do PHP do ambiente de teste

PHP Version 5.6.33

Alguém saberia me orientar em como proceder pra achar esse problema?

Agradeço.