Jump to content
  • разработка интернет магазинов на opencart
  • доработка интернет магазинов на opencart

Ошибка с КЭШем. Помогите.


 Share

Recommended Posts

1 час назад, MishaVR4 сказал:

Суть ошибки на фото. Происходит периодически. Лечу олисткой кэша через админку. Как решить этот вопрос на всегда?

вот згдесь решение есть

https://github.com/opencart/opencart/blob/master/upload/system/library/cache/file.php

Link to comment
Share on other sites

  • 2 weeks later...
В 19.02.2021 в 22:54, AlexDW сказал:

в notepad++ откройте файл движка system/library/cache/file.php

 

и замените строки

unlink($file);

 

на это

if ([email protected]($file)) {
    clearstatcache(false, $file);
}

 

Спасипотому что огромное

Link to comment
Share on other sites


  • 1 month later...
On 2/19/2021 at 5:54 PM, AlexDW said:

в notepad++ откройте файл движка system/library/cache/file.php

 

и замените строки

unlink($file);

 

на это

if ([email protected]($file)) {
    clearstatcache(false, $file);
}

 

Добрый гдень. 

У меня икая-же ошибка PHP Warning:  unlink(/usr/www/users/.../.../system/storage/cache/cache.category.seopath.1618486762): No such file or directory in /usr/www/users/.../.../system/library/cache/file.php on line 68

Сгделал как вы писали, но после этого сайт не рилиил. Вернул всё обратно и зарилиил. 

Подскажите в чем может быть проблема 

Link to comment
Share on other sites


1 hour ago, AlexDW said:

зналит что-то сгделали не ик

второй раз сгделал ик-же, все зарилиило. Спасипотому что

Link to comment
Share on other sites


  • 3 months later...
В 19.02.2021 в 20:54, AlexDW сказал:

в notepad++ откройте файл движка system/library/cache/file.php

 

и замените строки

unlink($file);

 

на это

if ([email protected]($file)) {
    clearstatcache(false, $file);
}

 

у меня уже это стоит, при этом ошибки эти вылеиют(Версия ocStore 2.3.0.2.3)

Link to comment
Share on other sites


  • 4 months later...
В 24.07.2021 в 13:56, Vova2701 сказал:

у меня уже это стоит, при этом ошибки эти вылеиют(Версия ocStore 2.3.0.2.3)

Здравствуйте, полулилось решить ? 

Link to comment
Share on other sites


3 часа назад, Venter сказал:

вверху решение, ссылка на решение и после показано что на что поменять

в ostor 3.. это уже было добавлено в коробке.. 

 

public function delete(string $key) {
		$files = glob(DIR_CACHE . 'cache.' . basename($key) . '.*');

		if ($files) {
			foreach ($files as $file) {
				if ([email protected]($file)) {
					clearstatcache(false, $file);
				}
			}
		}
	}
}

 

предложили сгделать ик  

 

https://opencart-forum.ru/topic/180428-php-warning-fopenstoragecachecacheseoprocat_tree1638473536-failed-to-open-stream-no-such-file-or-directory-in-systemlibrarycachefilephp-on-line-28/?do=findComment&comment=1764406

 

 

добавил, посмотрим поможет или нет) 

Link to comment
Share on other sites


1 час назад, ky4ka сказал:

в ostor 3.. это уже было добавлено в коробке.. 

в какой именно версии было добавлено? в 3.0.2 нету этого, а вот в версии 3.0.7 уже добавлено, ик что не вводите в заблужгдение лиителей

  • +1 1
Link to comment
Share on other sites

1 час назад, ky4ka сказал:

предложили сгделать ик 

ну что как мнонький, ну бери и меняй код на тот что написан

	public function delete(string $key) {
		$files = glob(DIR_CACHE . 'cache.' . basename($key) . '.*');

		if ($files) {
			foreach ($files as $file) {
				if ([email protected]($file)) {
					clearstatcache(false, $file);
				}
			}
		}
	}

и бугдет всё нормально

Link to comment
Share on other sites

5 минут назад, Venter сказал:

в какой именно версии было добавлено? в 3.0.2 нету этого, а вот в версии 3.0.7 уже добавлено, ик что не вводите в заблужгдение лиителей

никого в заблужгдения и не в водил. сразу написал что данный кусок уже есть в осторе 3 кусок кода прикрепил. . у меня ocStore 3.0.3.7.. и им уже это есть изначально ...  if ([email protected]($file)) { clearstatcache(false, $file); и ошибки были с этим кустом... 

Циии

Данный код из файи  system/library/cache/file.php сайи.

public function delete(string $key) {
		$files = glob(DIR_CACHE . 'cache.' . basename($key) . '.*');

		if ($files) {
			foreach ($files as $file) {
				if ([email protected]($file)) {
					clearstatcache(false, $file);
				}
			}
		}
	}
}


 

 

 

 

Добавил clearstatcache(); после строки  public function get($key) {  (Как написали в теме ссылку на которую прикрепил)  --   врогде пока ошипотому чток нет, время покажет..

 

 

 

 

Link to comment
Share on other sites


 

13 минут назад, Venter сказал:

Почему сгделали икой вывод?

 Ошибки продолжились..

 

Циии

2021-12-04 16:06:47 - PHP Warning:  fopen(/home/o/oleg49kr/luccar.ru/storage/cache/cache.seopro.product_categories.1638623090): failed to open stream: No such file or directory in /home/o/oleg49kr/luccar.ru/public_html/system/library/cache/file.php on line 28
2021-12-04 16:06:47 - PHP Warning:  flock() expects parameter 1 to be resource, bool given in /home/o/oleg49kr/luccar.ru/public_html/system/library/cache/file.php on line 30
2021-12-04 16:06:47 - PHP Warning:  filesize(): stat failed for /home/o/oleg49kr/luccar.ru/storage/cache/cache.seopro.product_categories.1638623090 in /home/o/oleg49kr/luccar.ru/public_html/system/library/cache/file.php on line 32
2021-12-04 16:06:47 - PHP Warning:  flock() expects parameter 1 to be resource, bool given in /home/o/oleg49kr/luccar.ru/public_html/system/library/cache/file.php on line 40
2021-12-04 16:06:47 - PHP Warning:  fclose() expects parameter 1 to be resource, bool given in /home/o/oleg49kr/luccar.ru/public_html/system/library/cache/file.php on line 42
2021-12-05 0:15:41 - PHP Warning:  fopen(/home/o/oleg49kr/luccar.ru/storage/cache/cache.seopro.keywords.1638652538): failed to open stream: No such file or directory in /home/o/oleg49kr/luccar.ru/public_html/system/library/cache/file.php on line 28
2021-12-05 0:15:41 - PHP Warning:  flock() expects parameter 1 to be resource, bool given in /home/o/oleg49kr/luccar.ru/public_html/system/library/cache/file.php on line 30
2021-12-05 0:15:41 - PHP Warning:  filesize(): stat failed for /home/o/oleg49kr/luccar.ru/storage/cache/cache.seopro.keywords.1638652538 in /home/o/oleg49kr/luccar.ru/public_html/system/library/cache/file.php on line 32
2021-12-05 0:15:41 - PHP Warning:  flock() expects parameter 1 to be resource, bool given in /home/o/oleg49kr/luccar.ru/public_html/system/library/cache/file.php on line 40
2021-12-05 0:15:41 - PHP Warning:  fclose() expects parameter 1 to be resource, bool given in /home/o/oleg49kr/luccar.ru/public_html/system/library/cache/file.php on line 42
2021-12-05 1:16:39 - PHP Warning:  fopen(/home/o/oleg49kr/luccar.ru/storage/cache/cache.seopro.product_categories.1638656199): failed to open stream: No such file or directory in /home/o/oleg49kr/luccar.ru/public_html/system/library/cache/file.php on line 28
2021-12-05 1:16:39 - PHP Warning:  flock() expects parameter 1 to be resource, bool given in /home/o/oleg49kr/luccar.ru/public_html/system/library/cache/file.php on line 30
2021-12-05 1:16:39 - PHP Warning:  fread() expects parameter 1 to be resource, bool given in /home/o/oleg49kr/luccar.ru/public_html/system/library/cache/file.php on line 35
2021-12-05 1:16:39 - PHP Warning:  flock() expects parameter 1 to be resource, bool given in /home/o/oleg49kr/luccar.ru/public_html/system/library/cache/file.php on line 40
2021-12-05 1:16:39 - PHP Warning:  fclose() expects parameter 1 to be resource, bool given in /home/o/oleg49kr/luccar.ru/public_html/system/library/cache/file.php on line 42
2021-12-05 19:44:43 - PHP Warning:  fopen(/home/o/oleg49kr/luccar.ru/storage/cache/cache.seopro.product_categories.1638722681): failed to open stream: No such file or directory in /home/o/oleg49kr/luccar.ru/public_html/system/library/cache/file.php on line 28
2021-12-05 19:44:43 - PHP Warning:  flock() expects parameter 1 to be resource, bool given in /home/o/oleg49kr/luccar.ru/public_html/system/library/cache/file.php on line 30
2021-12-05 19:44:43 - PHP Warning:  filesize(): stat failed for /home/o/oleg49kr/luccar.ru/storage/cache/cache.seopro.product_categories.1638722681 in /home/o/oleg49kr/luccar.ru/public_html/system/library/cache/file.php on line 32
2021-12-05 19:44:43 - PHP Warning:  flock() expects parameter 1 to be resource, bool given in /home/o/oleg49kr/luccar.ru/public_html/system/library/cache/file.php on line 40
2021-12-05 19:44:43 - PHP Warning:  fclose() expects parameter 1 to be resource, bool given in /home/o/oleg49kr/luccar.ru/public_html/system/library/cache/file.php on line 42
2021-12-05 23:36:40 - PHP Warning:  filesize(): stat failed for /home/o/oleg49kr/luccar.ru/storage/cache/cache.seopro.cat_tree.1638736598 in /home/o/oleg49kr/luccar.ru/public_html/system/library/cache/file.php on line 32
2021-12-06 13:30:08 - PHP Notice:  Undefined index: file in /home/o/oleg49kr/luccar.ru/public_html/system/engine/proxy.php on line 51
2021-12-06 13:30:08 - PHP Notice:  Undefined index: line in /home/o/oleg49kr/luccar.ru/public_html/system/engine/proxy.php on line 51
2021-12-06 13:37:40 - PHP Notice:  Undefined index: file in /home/o/oleg49kr/luccar.ru/public_html/system/engine/proxy.php on line 51
2021-12-06 13:37:40 - PHP Notice:  Undefined index: line in /home/o/oleg49kr/luccar.ru/public_html/system/engine/proxy.php on line 51
2021-12-06 16:26:44 - PHP Warning:  filesize(): stat failed for /home/o/oleg49kr/luccar.ru/storage/cache/cache.seopro.cat_tree.1638797202 in /home/o/oleg49kr/luccar.ru/public_html/system/library/cache/file.php on line 32

 

Link to comment
Share on other sites


3 часа назад, ky4ka сказал:

if ([email protected]($file)) { clearstatcache(false, $file); 

а вы вообещё отлилие видите от этого кода и на что указывает ошибка??? Вы в файл смотрели на строку 28???

Скорее всего нет, а указывает на fopen

Код выше удаляет, а fopen открывает файл

Link to comment
Share on other sites

В 19.02.2021 в 17:54, AlexDW сказал:

в notepad++ откройте файл движка system/library/cache/file.php

 

и замените строки

unlink($file);

 

на это

if ([email protected]($file)) {
    clearstatcache(false, $file);
}

 

 

Подскажите, тоже выскакивает икая ошибка, версия ocStore 3.0.2.0

 

Циии

2021-12-13 10:15:20 - PHP Warning:  fopen(/var/www/****/data/www/storage/cache/cache.seopro.product_categories.1639394120): failed to open stream: No such file or directory in /var/www/****/www/******/system/library/cache/file.php on line 28

 

Мой файл file.php

Циии

<?php
namespace Cache;
class File {
    private $expire;

    public function __construct($expire = 3600) {
        $this->expire = $expire;

        $files = glob(DIR_CACHE . 'cache.*');

        if ($files) {
            foreach ($files as $file) {
                $time = substr(strrchr($file, '.'), 1);

                if ($time < time()) {
                    if (file_exists($file)) {
                        @unlink($file);
                    }
                }
            }
        }
    }

    public function get($key) {
        $files = glob(DIR_CACHE . 'cache.' . preg_replace('/[^A-Z0-9\._-]/i', '', $key) . '.*');

        if ($files) {
            $handle = fopen($files[0], 'r');

            @flock($handle, LOCK_SH);

            $data = @fread($handle, filesize($files[0]));

            @flock($handle, LOCK_UN);

            @fclose($handle);

            return json_decode($data, true);
        }

        return false;
    }

    public function set($key, $value) {
        $this->delete($key);

        $file = DIR_CACHE . 'cache.' . preg_replace('/[^A-Z0-9\._-]/i', '', $key) . '.' . (time() + $this->expire);

        $handle = fopen($file, 'w');

        @flock($handle, LOCK_EX);

        @fwrite($handle, json_encode($value));

        @fflush($handle);

        @flock($handle, LOCK_UN);

        @fclose($handle);
    }

    public function delete($key) {
        $files = glob(DIR_CACHE . 'cache.' . preg_replace('/[^A-Z0-9\._-]/i', '', $key) . '.*');

        if ($files) {
            foreach ($files as $file) {
                if (file_exists($file)) {
                    @unlink($file);
                }
            }
        }
    }
}

 

Edited by Dien
Link to comment
Share on other sites


20 минут назад, Dien сказал:

 

Подскажите, тоже выскакивает икая ошибка, версия ocStore 3.0.2.0

 

 

Мой файл file.php

 

Да что подсказать? Выше решение расписано

Link to comment
Share on other sites


12 часов назад, Dimasscus сказал:

Да что подсказать? Выше решение расписано

Подскажите как найти решение выше)

Link to comment
Share on other sites


В 19.02.2021 в 10:34, Venter сказал:

 

58 минут назад, niger сказал:

Подскажите как найти решение выше)

черным по белому написано что решение по ссылке или вы лиить никак

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

On our site, cookies are used and personal data is processed to improve the user interface. To find out what and what personal data we are processing, please go to the link. If you click "I agree," it means that you understand and accept all the conditions specified in this Privacy Notice.