0
update: actually my problem had nothing to do with this snippet from
blockquote
down there. I learned how to debug PHP, and I found several errors, but I’m not even going to enter here in each of them because it’s not the case... So even though I solved it differently, Guilherme’s comments and response helped me to understand some concepts, and how I think it can help other users, I decided not to remove the question and accept the answer.
-.-
Update: I found the problem, which is in this excerpt:
<blockquote>
<strong> <em>RECURSO DE REVISTA. [...] RESCISÃO DO CONTRATO DE TRABALHO - NULIDADE - AUSÊNCIA DE ASSISTÊNCIA SINDICAL.
O objetivo da assistência sindical no pedido de demissão decorre da consagração do princípio da
irrenunciabilidade dos direitos trabalhistas. Retrata o art. 477, § 1º, da CLT, norma cogente, que condiciona
o pedido de demissão e a quitação do contrato de trabalho firmado pelo empregado cuja relação jurídica vigorou
por mais de um ano, à assistência perante o Sindicato. Nesse sentido, a formalidade determinada pela norma, se
não cumprida, torna nulo o ato. Incumbe ao empregador o cumprimento da formalidade prevista no art. 477, § 1º,
da CLT, sob pena de não se convalidar o pedido de demissão, quando não houver a homologação, nos
termos previstos na norma. Precedentes. Recurso de revista conhecido e provido. [...]</em></strong> (TST PROCESSO Nº
TST-RR-256-42.2010.5.02.0088, 6ª Turma, Relatora Desembargadora Convocada CILENE FERREIRA AMARO SANTOS,
Data de Julgamento: 10/12/2014 - grifos nossos)
</blockquote>
And the problem seems to be inside the text itself, I thought it was the use of brackets, but I think it’s not even, I tried to escape with \
and it didn’t work.
In fact, this other part is also giving the same problem (I have tested only one part, without the other, and gives the same problem):
<p>
<?php echo $motivdesligjust; ?>
<?php echo "<br>"; ?>
</p>
<p>
<?php echo $motivdesligind; ?>
</p>
I can’t call variables inside tags <p></p>
?
/update
I’m having a problem here in running a php file, which uses include
to include other files, and I can’t figure out the cause. It seems to be an infinite loop, but I’m not using for
, while
, nothing, just call the variables escaping the html, and use a if
or another...
The file keeps running in the browser and not for more, there is the message "Waiting for localhost", and after that no other php file can run before I reset phpstorm.
So I was wondering if you have any commands for me to follow the execution, and why it keeps running in this infinite loop.
It is a strange mistake because are several files included by include
, and if I remove the first 3 for example, it works, and the same happens if I leave only the first three, but I’ve already reviewed the files and I can’t find the problem.
Instead of
include
tryinclude_once
and see if it solves– Guilherme Nascimento
I’ve tried, and with require tbm :/ @Guilhermenascimento
– gustavox
require only change the type of error issued, the
_once
prevents adding more than once. If it is not theinclude
then it can be a recursive function– Guilherme Nascimento
I think it is some problem with the included files, in these files I do not put header anything, already starts with
<p>Título</p>
... you think it might be like a tag without closure, or it might have something to do with the php I’m escaping into HTML... You know if there’s a way to access a log..?– gustavox
Gustavo usually when entering an infinite loop is not generated log until the process is finished, the only types of errors that I believe are possible to capture are the markup error and the end of execution. This is due to the synchronous and non-synchronically occurring process of PHP. However maybe there is a debugging structure similar to C/C++ compilers like GCC for example, that when run in DEBUG it is possible to do a "backtrace" and if the application is terminated prematurely then you would have the log (however it would not be something easy to read). I’ll look into
– Guilherme Nascimento
Okay, thanks! I was thinking about trying debug-backtrace, but I don’t even know how to...
– gustavox
Gustavo debug_backtrace is more for use inside the execution, which may work, but will have to an autoload method maybe, because if not the whole process will be manual, before you can get any relevant result.
– Guilherme Nascimento
@Guilhermenascimento, I installed Composer, but I couldn’t install the monolog (today it’s complicated pqp :/), but I decided to put everything in one file and found where the error was. I edited the question, take a look... Thanks, hug.
– gustavox