0

this is Opencart shop website. My website link is : boxingstuff.ru

when i view my site then this error is show "(Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 109 bytes) in /var/www/u0514007/public_html/vqmod/vqmod.php on line 168")

Vqmod.php on line 168 code

,,,,

public static function path($path, $skip_real = false) {
        $tmp = self::$_cwd . $path;
        $realpath = $skip_real ? $tmp : self::_realpath($tmp);
        if(!$realpath) {
            return false;
        }
        return $realpath;
    }

,,,,,

I want to fix this error and want my site show as before normally please help me.

  • You have a memory leak somewhere or, you actually need to increase your memory limit, is there any queries, intensive code, or potentially recursive functions in your code? – Script47 Mar 25 '19 at 12:27
  • Instead of interpreting this as "you need more memory" (PHP beginners do that) you should interpret this as "your script eats more memory than it should and you should optimize your script to eat less ressources". – Daniel W. Mar 25 '19 at 13:21
  • Comments are not for extended discussion or debugging sessions; this conversation has been [moved to chat](https://chat.stackoverflow.com/rooms/190644/discussion-on-question-by-raheel-ahmed-how-fix-fatal-error-allowed-memory-size). When you are asked for additional information, please [edit] your question to include it. Don't post it in the comments. – Cody Gray - on strike Mar 25 '19 at 17:21

1 Answers1

-1

put this at the top of the file where you are getting error: ini_set('memory_limit','512M'); Just right underneath of

with this change website working cool.

  • 1
    Half a GB per script call? Really? Bad advice here. – Daniel W. Mar 25 '19 at 13:19
  • Some scripts do require this amount of memory, what would you recommend instead? – Paul Feakins Mar 26 '19 at 11:01
  • @PaulFeakins Cronjobs and batch jobs need that amount, but not a website. Look how slow his page is. Someone with a decent internet connection can DoS his server easily. The way to go would be to pre-aggregate the stuff that needs memory and then use caching. – Daniel W. Mar 26 '19 at 11:21
  • It only takes 40 concurrent requests, each request taking 400MB memory and your 16GB memory server is done. – Daniel W. Mar 26 '19 at 11:30
  • "Cronjobs and batch jobs need that amount" How do you know this isn't one of those? Or one-off caching? – Paul Feakins Mar 29 '19 at 10:31