Solucionado (ver solução)
Solucionado
(ver solução)
2
respostas

erro ao inserir e listar temporadas

Boa tarde, estou com um problema na hora de inserir as séries com as temporadas, assim que clico em adicionar ele demora um bom tempo e depois apresenta o seguinte erro:

Symfony \ Component \ Debug \ Exception \ FatalErrorException (E_UNKNOWN)
Maximum execution time of 60 seconds exceeded
C:\xampp4\htdocs\curso php\laravel\controle-series\vendor\laravel\framework\src\Illuminate\Database\Connection.php
     * Execute an SQL statement and return the boolean result.
     *
     * @param  string  $query
     * @param  array   $bindings
     * @return bool
     */
    public function statement($query, $bindings = [])
    {
        return $this->run($query, $bindings, function ($query, $bindings) {
            if ($this->pretending()) {
                return true;
            }

            $statement = $this->getPdo()->prepare($query);

            $this->bindValues($statement, $this->prepareBindings($bindings));

            $this->recordsHaveBeenModified();

            return $statement->execute();
        });
    }

    /**
     * Run an SQL statement and get the number of rows affected.
     *
     * @param  string  $query
     * @param  array   $bindings
     * @return int
     */
    public function affectingStatement($query, $bindings = [])
    {
        return $this->run($query, $bindings, function ($query, $bindings) {
            if ($this->pretending()) {
                return 0;
            }

            // For update or delete statements, we want to get the number of rows affected
            // by the statement and return that back to the developer. We'll first need
            // to execute the statement and then we'll use PDO to fetch the affected.
Arguments
"Maximum execution time of 60 seconds exceeded"
Environment & details:
GET Data empty
POST Data
_token    
"E11keRhSH0EAbz0mkYkcHKcvgoPGODYDlk0bOW0Z"
nome    
"teste"
qtd_temporadas    
"2"
ep_por_temporada    
"5"
Files empty
Cookies
XSRF-TOKEN    
"eyJpdiI6Inc5ZGo1UDlwajVqOUNYTWg5SHJoY2c9PSIsInZhbHVlIjoiNTUweWt1RHN0T0Ntd3NaemJtTXRyYitjMm52SmF5b0RTWGNpOXhcL0Fld0NENTl3MHJseGhxdXlmSjZIcGJueXkiLCJtYWMiOiI0ZmQ0 ▶"
laravel_session    
"eyJpdiI6Ilk5VzRtblRtbXJTaWVndE9zdUlIVFE9PSIsInZhbHVlIjoiUmhIWlZ5WCtCZjBrcUNlZ0VCY1VoeE94ZkM0VXA2XC9FN0pZdWFxN0tKbW5jZTVMaHF1XC93eXJnaTVYendudDlaIiwibWFjIjoiMzNm ▶"
Session empty
Server/Request Data
DOCUMENT_ROOT    
"C:\xampp4\htdocs\curso php\laravel\controle-series\public"
REMOTE_ADDR    
"127.0.0.1"
REMOTE_PORT    
"51953"
SERVER_SOFTWARE    
"PHP 7.4.5 Development Server"
SERVER_PROTOCOL    
"HTTP/1.1"
SERVER_NAME    
"127.0.0.1"
SERVER_PORT    
"8000"
REQUEST_URI    
"/series/criar"
REQUEST_METHOD    
"POST"
SCRIPT_NAME    
"/index.php"
SCRIPT_FILENAME    
"C:\xampp4\htdocs\curso php\laravel\controle-series\public\index.php"
PATH_INFO    
"/series/criar"
PHP_SELF    
"/index.php/series/criar"
HTTP_HOST    
"localhost:8000"
HTTP_CONNECTION    
"keep-alive"
CONTENT_LENGTH    
"94"
HTTP_CONTENT_LENGTH    
"94"
HTTP_CACHE_CONTROL    
"max-age=0"
HTTP_UPGRADE_INSECURE_REQUESTS    
"1"
HTTP_ORIGIN    
"http://localhost:8000"
CONTENT_TYPE    
"application/x-www-form-urlencoded"
HTTP_CONTENT_TYPE    
"application/x-www-form-urlencoded"
HTTP_USER_AGENT    
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.121 Safari/537.36 Edg/85.0.564.68"
HTTP_ACCEPT    
"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9"
HTTP_SEC_FETCH_SITE    
"same-origin"
HTTP_SEC_FETCH_MODE    
"navigate"
HTTP_SEC_FETCH_USER    
"?1"
HTTP_SEC_FETCH_DEST    
"document"
HTTP_REFERER    
"http://localhost:8000/series/criar"
HTTP_ACCEPT_ENCODING    
"gzip, deflate, br"
HTTP_ACCEPT_LANGUAGE    
"pt-PT,pt;q=0.9,pt-BR;q=0.8,en;q=0.7,en-US;q=0.6,en-GB;q=0.5"
HTTP_COOKIE    
"XSRF-TOKEN=eyJpdiI6Inc5ZGo1UDlwajVqOUNYTWg5SHJoY2c9PSIsInZhbHVlIjoiNTUweWt1RHN0T0Ntd3NaemJtTXRyYitjMm52SmF5b0RTWGNpOXhcL0Fld0NENTl3MHJseGhxdXlmSjZIcGJueXkiLCJtY ▶"
REQUEST_TIME_FLOAT    
1601638795.7336
REQUEST_TIME    
1601638795
Environment Variables empty
Registered Handlers
0. Whoops\Handler\PrettyPageHandler

subi o meu repositório no github: https://github.com/marvinoliveiras/controle-series

2 respostas

Boa tarde, estou com o mesmo problema também, quando passo de 10 temporadas e 20 episódios por temporada(algo comum), ele me retorna um erro de que demorou demais para o servidor responder

solução!

boa tarde, no meu caso eu estava causando um loop infinito por isso caía nesse erro

//estava assim no meu arquivo SeriesController
        for($i = 1; $i <= $qtdTemporadas; $qtdTemporadas++)

//o correto era assim
        for($i = 1;$i <= $qtdTemporadas; $i++){

dessa forma o $i era sempre menor que $qtdTemporadas.

põe seu código na dúvida ou então cria um repositório no github