Ошибка maximum execution time of 60 seconds exceeded in

I’m getting the following error message:

Warning: file_get_contents(http://localhost/sample_pie.php) [function.file-get-contents]: failed to open stream: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. in C:xampphtdocsEXACTreport.php on line 206

Fatal error: Maximum execution time of 60 seconds exceeded in C:xampphtdocsEXACTreport.php on line 206

Here is the line 206:

$url = 'http://localhost/sample_pie.php';
$img = 'C:xampphtdocspiechart.jpg';
file_put_contents($img, file_get_contents($url));

What do I have to do to fix this?

random's user avatar

random

9,75710 gold badges66 silver badges83 bronze badges

asked Sep 14, 2009 at 8:08

noob's user avatar

1

Your script executed for more then 60 seconds and was terminated. There is a value in php.ini defining maximum time PHP script can run. The purpose of this is to prevent scripts from hanging. You could try to optimize your script but if it’s intended to run for so long you can just update the value (it’s called max_execution_time).

You can also try changing this value for particular script by running set_time_limit() function, docs here

answered Sep 14, 2009 at 8:12

RaYell's user avatar

RaYellRaYell

69.5k20 gold badges125 silver badges152 bronze badges

0

max_input_time can also cause the same error.

answered Jul 19, 2016 at 9:53

user2129024's user avatar

user2129024user2129024

4114 silver badges8 bronze badges

2

Just increase the max_execution_time in php.ini. Set it to 1800 and restart your apache or any other server you are using.

answered Sep 14, 2013 at 17:18

Ramesh Yadav's user avatar

Ramesh YadavRamesh Yadav

1451 gold badge2 silver badges9 bronze badges

It means PHP was unable to access the resource http://localhost/sample_pie.php, and thus the operation timed out. Try to access it through the browser.

answered Sep 14, 2009 at 8:14

João Silva's user avatar

João SilvaJoão Silva

88.9k29 gold badges150 silver badges158 bronze badges

I was using ffmpeg and there is video uploading and ffmpeg copies some files on temp and my anti virus program blocks that copying and there is Maximum execution time of 60 seconds exceeded

I REMOVED ANTİVİRUS PROGRAM I SAW PROBLEM GONE OFF

answered Aug 6, 2018 at 22:09

user10189012's user avatar

При обновлении OpenCart 3.0.3.2 до версии 3.0.3.7 на Open Server, получил ошибку при попытке выполнить обновление:

Fatal error: Maximum execution time of 60 seconds exceeded

Данная ошибка означает, что выполнение определенной операции, привело к превышению временного лимита, указанного в конфигурации PHP. Вы можете изменить значение этого параметра, который указывается в секундах. По умолчанию в Open Server выставлен лимит в 60 секунд, для параметра «max_execution_time» в настройках PHP. Зачастую, выполнение скрипта не превышает 30 сек и данного лимита в 60 секунд, должно вполне хватать.

Если данная ошибка, возникает у вас на хостинге, настоятельно рекомендую обратиться к вашему хостинг-провайдеру для решения данной проблемы. На некоторых виртуальных хостингах (shared-хостинг), может стоять лимит на 30 секунд и нет возможности изменить его через админку.

Если у вас возникает ошибка «Fatal error: Maximum execution time of 60 seconds exceeded» при работе с Open Server, необходимо изменить время для выполнения скрипта в конфигурации PHP. Рассмотрим два способа, как это сделать.

На заметку.
Не пытайтесь вносить правки в файл конфигурации PHP по пути: «C:OpenServermodulesphpPHP-ваша_версия». Файл «php.ini» находящийся по данному пути, является временным и его бесполезно править. При перезапуске Open Server, файл перезаписывается с настройками по умолчанию. Ниже, описаны рабочие способы, которые помогут произвести нужные манипуляции с параметрами PHP.

Способ 1.

Увеличить лимит времени «max_execution_time», через интерфейс Open Server.

Открываем системный трей (1.) и щелкаем правой кнопкой мыши по флажку (2.) Open Server. Переходим по пути:

«Дополнительно» (3.) -> «Конфигурация» (4.) -> «PHP_7.3» (5.)

Обратите
внимание, что у вас, может отличатся версия PHP, в зависимости от того, какую версию вы выбрали. В моем примере, это PHP 7.3.

В открывшемся окне

ищем:

max_execution_time

Чтобы найти быстро нужный параметр, можно воспользоваться поиском. Выберите «Поиск» -> «Найти»:

В открывшемся поле поиска (1.), вставляем «max_execution_time» (без кавычек) и получаем результат (2.):

Теперь, меняем лимит «60», на «6000» к примеру. Или, на любой другой показатель. В своем примере, изменю лимит «max_execution_time» на «6000»:

Сохраняем изменения. Для этого, нажимаем: «Файл» -> «Сохранить».


Закрываем окно и перезапускаем сервер Open Server. Для этого, открываем системный трей (1.) и щелкаем по флажку (2.) правой кнопкой мыши, выбираем «Перезапустить» (3.):

После этого, все должно работать.

Стабильный и доступный виртуальный хостинг и VPS для сайтов любой любой сложности и нагруженности. Защита от DDoS и качественное администрирование. Хостинг-провайдер для тех, кто ценит стабильность и безопасность.

Способ 2. 

Увеличить лимит времени «max_execution_time», через сторонний редактор кода в Open Server.

Идем по пути:

C:OpenServeruserdataconfigваша_версия_PHP

В папке config, необходимо найти файл «PHP_ваша_версия_php.ini».

В моем примере, выберу файл «PHP_7.3_php.ini»:

Чтобы открыть файл и раскомментировать «ionCube» в конфигурации PHP, используйте Notepad++ или любой другой редактор.

Для правки файлов, есть удобный редактор Visual Studio Code: https://code.visualstudio.c…
Есть русский язык: https://marketplace.visuals…

Открываем файл «PHP_ваша_версия_php.ini» и ищем

max_execution_time

 В своем примере, воспользуюсь редактором Visual Studio Code и открою в нем файл «PHP_7.3_php.ini»:

Теперь, чтобы быстро найти расширение «max_execution_time», открываем «Правка» -> «Найти»:

В поле поиска (1.), вставляем «max_execution_time» (без кавычек) и получаем результат (2.):


Теперь, меняем лимит «60», на любой другой
показатель который нужен. В своем примере, изменю лимит «max_execution_time» на
«6000»:

Сохраняем изменения. Для этого, нажимаем: «Файл» -> «Сохранить».


Закрываем окно и перезапускаем сервер Open Server (смотрим скрины выше из Способ 1).

Таким образом, мы изменили с вами лимит «max_execution_time».

После этого, все должно работать. 

По теме: «Как включить ionCube в шаблоне конфигурации PHP на Open Server?»

Надеюсь, данная заметка, будет вам полезной. Успехов.

Всем привет! Сделал бесконечный цикл, чтобы держать связь с сервером в реальном времени. Но когда достигается лимит выполнения, вместо ошибки 504, приходит ошибка 500. В логе php это:
PHP Fatal error: Maximum execution time of 60 seconds exceeded in …
Почему вместо 504 такая ошибка?


  • Вопрос задан

    более двух лет назад

  • 796 просмотров

504 Gateway Timeout — сервер в роли шлюза или прокси-сервера не дождался ответа от вышестоящего сервера для завершения текущего запроса.

Ваш сервер не является ни шлюзом, ни прокси. Поэтому он просто возвращает ошибку 500.

Пригласить эксперта


  • Показать ещё
    Загружается…

13 июн. 2023, в 15:58

400 руб./за проект

13 июн. 2023, в 15:58

400 руб./за проект

13 июн. 2023, в 15:58

400 руб./за проект

Минуточку внимания

@Dartui

Today, after composer update laravel-debugbar has updated from 2.3.2 to 2.4.0 and laravel/framework from 5.4.24 to 5.4.25. After that I am getting error like this with debug mode on:

PHP Fatal error:  Maximum execution time of 60 seconds exceeded in /var/www/html/portal/vendor/barryvdh/laravel-debugbar/src/DataCollector/QueryCollector.php on line 223
PHP Fatal error:  Maximum execution time of 60 seconds exceeded in /var/www/html/portal/vendor/barryvdh/laravel-debugbar/src/DataCollector/QueryCollector.php on line 193
PHP Fatal error:  Maximum execution time of 60 seconds exceeded in /var/www/html/portal/vendor/barryvdh/laravel-debugbar/src/DataCollector/QueryCollector.php on line 188
PHP Fatal error:  Maximum execution time of 60 seconds exceeded in /var/www/html/portal/vendor/barryvdh/laravel-debugbar/src/DataCollector/QueryCollector.php on line 212

After disabling debug mode, site works good.

Whole list of updated packages:

  - Removing symfony/finder (v3.3.0)
  - Installing symfony/finder (v3.3.2)
    Downloading: 100%         

  - Removing symfony/var-dumper (v3.3.0)
  - Installing symfony/var-dumper (v3.3.2)
    Downloading: 100%         

  - Removing symfony/routing (v3.3.0)
  - Installing symfony/routing (v3.3.2)
    Downloading: 100%         

  - Removing symfony/process (v3.3.0)
  - Installing symfony/process (v3.3.2)
    Loading from cache

  - Removing symfony/http-foundation (v3.3.0)
  - Installing symfony/http-foundation (v3.3.2)
    Downloading: 100%         

  - Removing symfony/event-dispatcher (v3.3.0)
  - Installing symfony/event-dispatcher (v3.3.2)
    Downloading: 100%         

  - Removing symfony/debug (v3.3.0)
  - Installing symfony/debug (v3.3.2)
    Downloading: 100%         

  - Removing symfony/http-kernel (v3.3.0)
  - Installing symfony/http-kernel (v3.3.2)
    Downloading: 100%         

  - Removing symfony/console (v3.3.0)
  - Installing symfony/console (v3.3.2)
    Downloading: 100%         

  - Removing symfony/translation (v3.3.0)
  - Installing symfony/translation (v3.3.2)
    Loading from cache

  - Removing laravel/framework (v5.4.24)
  - Installing laravel/framework (v5.4.25)
    Downloading: 100%         

  - Removing barryvdh/laravel-debugbar (v2.3.2)
  - Installing barryvdh/laravel-debugbar (v2.4.0)
    Downloading: 100%         

  - Removing devpark/laravel-przelewy24 (v1.0.2)
  - Installing devpark/laravel-przelewy24 (v1.0.3)
    Downloading: 100%         

  - Removing symfony/yaml (v3.3.0)
  - Installing symfony/yaml (v3.3.2)
    Downloading: 100%    

@Dartui

After enabling and disabling collectors one by one, I have seen that auth collector is causing this

@ilgala

The same problem is happening to me as well when the user logs in… I have a UserObserver that performs some actions on update (and when the user logs in the last_login column is updated).

If i «disable» the observer everything works fine as well as when I set the APP_DEBUG to false.

@dubaaron

The APP_DEBUG setting must be doing an ini_set('max_exectuion_time') somewhere ….

@VarunAnandK

change the controller.php like below

`class Controller extends BaseController
{

public function __construct()
{
    ini_set('max_execution_time', 300);
}


use AuthorizesRequests, DispatchesJobs, ValidatesRequests;

}`

chane in above code

public function __construct()
{
ini_set(‘max_execution_time’, 300);
}

Thanks!.

@stale

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If this issue is still present on the latest version of this library on supported Laravel versions, please let us know by replying to this issue so we can investigate further.
Thank you for your contribution! Apologies for any delayed response on our side.

@Oswaldgerald

I also get this error when i perform some quering that i have implement to do reconciliation and am using Laravel 8.

So, you have developed your WordPress site via the localhost and then, now you want to move it to your site live via the domain name. So, the question may arise in your head that, is it really possible and can be done easily? And the answer for this question would be yes, it is easy and can be done easily. First of all, you can export the data of your localhost via the WordPress Export feature and then import it via the WordPress Importer plugin, which is available via the WordPress plugin directory. This plugin will help you in importing the WordPress post and pages data in the new site, from the existing site. But, due to some reason, you could not import it properly, and then displays the error like Maximum execution time of 60 seconds exceeded in C:xampphtdocsdemo-importwp-includeswp-db.php on line 1811 again and again while you try to import it. Here, we can see the same issue while we were importing the demo data of WordPress in our local development environment:

maximum-execution-time-exceeded

After this error is displayed in your site, while you import the exported data in your WordPress site, then, this screen comes up while you see the front-end of your site:

import-failed

So, now you have no clue on about this issue about how to solve it, right? So, here we will describe about how to solve this issue in your site.

WordPress has restricted the maximum execution time of the import to 60 seconds. No, matter which way you try to solve this issue in your site, like via the .htaccess file change, or, while in your local development environment, change in the php.ini file. It will not solve your issue at all. We had already checked out on those many times and no success on every time. So, we got fed up and then searched on many site and finally could find the solution on this issue. Hence, we thought out that you might have been facing the same issue in your site too while importing the WordPress export file in your site. So, here we will provide the solution on it.

In order to solve this issue in your site, since it is being controlled via the WordPress file, so, you need to edit the WordPress file while you import and then edit it back as it was before. The file which need to be changed while doing the importing work in your site is in wp-includes/deprecated.php file. Here, in this file, you can find the code as:

@set_time_limit( 60 );

Here, this code need to be either commented out, or deleted. You can find the tutorial on commenting out that code from this link. And after doing that, you can import the exported xml data of WordPress via the WordPress Importer plugin easily in your site. And you will also not see this error Maximum Execution Time Of 60 Seconds Exceeded at all, since this error is only shown if the import fails.  This error especially occurs, if you have a lot of images and downloadable files in your site, with big sizes of each of those files. So, after doing that change, here, below is the import screen from our development site:

import-success

Now, here below is the screenshot of our local development site while we have successfully imported the WordPress exported data xml file in our site:

import-success-front-end

Now, since you know how to solve this error in your site, now, we hope that you will import each of your exported xml WordPress file uccessfully in your site again and again without seeing the error as Maximum Execution Time Of 60 Seconds Exceeded.

Понравилась статья? Поделить с друзьями:
  • Ошибка maximum execution time of 300 seconds
  • Ошибка max payne exception in engineinit
  • Ошибка max payne 3 запустите игру
  • Ошибка max payne 3 the dynamic library
  • Ошибка max payne 3 gsrld dll failed to load