Авторизация
 Регистрация   Войти   Забыли пароль? 

Почему созданная мной php-страница очень медленно грузится или грузится не до конца?

Обновлённый PHP-Fusion Bogatyr / Free CMS PHP-Fusion 7 Bogatyr / Creating your php-pages and plug-ins for PHP Fusion 7 Bogatyr / Почему созданная мной php-страница очень медленно грузится или грузится не до конца?


 Russian

Если вы используете php-страницу в стандартном дизайне PHP-Fusion-7, то у вас обязательно есть строка в середине файла:

require_once THEMES."templates/header.php";

или

require_once THEMES."templates/admin_header.php";

или

require_once THEMES."templates/admin_header_mce.php";

И в самом конце php-страницы есть строка:

require_once THEMES."templates/footer.php";

 

Файлы "header.php", "admin_header.php", "admin_header_mce.php" инклюдят панели "/themes/templates/panels.php" и файл дизайна темы, например, "/themes/Omni/theme.php". А также начинают вывод всех echo в буфер.

Файл "/themes/templates/footer.php" заканчивает вывод в буфер и выводит всё содержимое страницы.

 

Поэтому, если не нужен дизайн темы или отображение панелей, достаточно сделать инклюд только одного файла "maincore.php", чтобы работали все встроенные функции ядра PHP-Fusion-7:

require_once "maincore.php";

Однако это не всё.

Если же вы не используете php-страницу в стандартном дизайне, то вы должны в самом конце php-страницы дописать строку:

mysql_close();

Пример: новый "login.php" в Bogatyr.

Иначе сервер не закрывает обращение к БД. Обращения накапливаются и сервер в итоге сильно тормозит. 

Hosting:

"На вашем тарифе установлено ограничение в 32 подключения к базе данных.

Вам нужно либо оптимизировать работу скриптов, чтобы число подключений было меньше, либо попробовать перейти на более дорогой тариф, где лимит подключений больше."

Это пишут о незакрытых базах. это 32 формирования страниц одновременно.

я думал что страница сгенерировалась и БД сама автоматом закрывается. Однако автоматом она закрывается по истечение сессии, это уже десятки минут. а может быть часы.

в footer.php БД закрывается строкой:

mysql_close();

Why is the php page created by me very slowly loading or loading up to the end?

Обновлённый PHP-Fusion Bogatyr / Free CMS PHP-Fusion 7 Bogatyr / Creating your php-pages and plug-ins for PHP Fusion 7 Bogatyr / Why is the php page created by me very slowly loading or loading up to the end?


 English

If you use the php page in the standard PHP-Fusion-7 design, then you definitely have a line in the middle of the file:

require_once THEMES. "templates/header.php";

or

require_once THEMES. "templates/admin_header.php";

or

require_once THEMES. "templates/admin_header_mce.php";

And at the very end of the php page there is a line:

require_once THEMES. "templates/footer.php";

 

The files "header.php", "admin_header.php", "admin_header_mce.php" include panels "/themes/templates/panels.php" and a theme design file, for example, "/themes/Omni/theme.php". And also start outputting all echo to the buffer.

The file "/themes/templates/footer.php" ends the output to the buffer and displays the entire contents of the page.

 

Therefore, if you do not need a theme design or display of panels, it is enough to make the inclusion of only one "maincore.php" file, so that all of the built-in PHP-Fusion-7 core functions work:

require_once "maincore.php";

However, this is not all.

If you are not using a php page in a standard design, then you should add a line at the very end of the php page:

mysql_close();

Example: new "login.php" in Bogatyr.

Otherwise, the server does not close the call to the database. Calls accumulate and the server eventually slows down.

Hosting:

"Your tariff has a limit of 32 connections to the database.

You need to either optimize the operation of the scripts so that the number of connections is less, or try switching to a more expensive tariff, where the limit of connections is greater. "

This is written about unclosed bases. these are 32 page formations at the same time.

  I thought that the page was generated and the database itself automatically closes. However, it automatically closes after the session, it is already tens of minutes. or maybe a watch.

in footer.php the database is closed with the line:

mysql_close();

Добавить комментарий

Добавить комментарий
Пожалуйста, залогиньтесь для добавления комментария.
Рейтинги
HTML-code and BB-code for blogs and forums

<a href="https://php-fusion.vveb.ws/php-fusion.php?id=21">Почему созданная мной php-страница очень медленно грузится или грузится не до конца?</a>


[url=https://php-fusion.vveb.ws/php-fusion.php?id=21]Почему созданная мной php-страница очень медленно грузится или грузится не до конца?[/url]

Language: Default
 
Код для PHP-Fusion