• Resolved Angelina Belle

    (@angelina-belle)


    As soon as I took the update to version 2.2.4, I started getting this error when attempting to use is_mobile()

    Fatal error: Allowed memory size of 41943040 bytes exhausted (tried to allocate 140 bytes) in …/wp-content/plugins/php-browser-detection/php-browser-detection.php on line 71

    As soon as I rolled back to version 2.2.3, the problem went away.

    https://www.ads-software.com/plugins/php-browser-detection/

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author Mindshare Labs, Inc.

    (@mindshare)

    Please test version 3.0. It’s a major rewrite.

    Thread Starter Angelina Belle

    (@angelina-belle)

    This new version requires php 5.3.

    My host provides 5.2.17, so I get the error:
    Plugin could not be activated because it triggered a fatal error.
    Warning: Unexpected character in input: ‘\’ (ASCII=92) state=1 in …/wp-content/plugins/php-browser-detection/php-browser-detection.php on line 44 Warning: Unexpected character in input: ‘\’ (ASCII=92) state=1 in …/wp-content/plugins/php-browser-detection/php-browser-detection.php on line 44 Parse error: syntax error, unexpected T_STRING in …/wp-content/plugins/php-browser-detection/php-browser-detection.php on line 44

    For the foreseeable future, I see myself using version 2.2.3

    Plugin Author Mindshare Labs, Inc.

    (@mindshare)

    I’d wager that your host can support a higher version of PHP… PHP 5.2 is no longer a recommended version (it’s actually 8 years old!)

    So try asking your host to upgrade your site to 5.3 or 5.4.

    Thread Starter Angelina Belle

    (@angelina-belle)

    I’m sure they can, but they are still worried about breaking legacy code on the shared server. So I guess it could be a while…

    Perhaps you could mention the new php requirements in the upgrade description. You have certainly resolved my initial problem, and the only way to resolve my current problem is to move backwards in time (which I know you don’t want to do).

    So I agree this one is resolved.

    Thanks!

    Plugin Author Mindshare Labs, Inc.

    (@mindshare)

    I’ll make a note about the PHP 5.3 requirements in the description. Thanks!

    Still seeing a weird memory issue on PHP Version 5.3.27.

    Is there some sort of memory leak or something with the plugin? Things are great when I first install it, then after a few days of use, I see the following error messages:

    Warning: stream_socket_client() [function.stream-socket-client]: unable to connect to https://browscap.org/version (Unable to find the socket transport “http” – did you forget to enable it when you configured PHP?) in /…/wp-content/plugins/php-browser-detection/lib/Browscap.php on line 1026

    Warning: stream_socket_client() [function.stream-socket-client]: unable to connect to https://browscap.org/stream?q=Full_PHP_BrowsCapINI (Unable to find the socket transport “http” – did you forget to enable it when you configured PHP?) in /…/wp-content/plugins/php-browser-detection/lib/Browscap.php on line 1026

    Fatal error: Allowed memory size of 103809024 bytes exhausted (tried to allocate 14701002 bytes) in /…/wp-content/plugins/php-browser-detection/lib/Browscap.php on line 875

    I’m on WordPress 3.9.1 with PHP Browser Detection 3.0.

    Plugin Author Mindshare Labs, Inc.

    (@mindshare)

    @spinfly please open a new support thread if you’d like support on this. It looks like your PHP installation does not include all required modules in order for the plugin to work. This doesn’t look like a memory issue.

    I do think it is indeed a memory issue. On another WP site I am developing (PHP 5.3.20 with 128 MB of memory, WordPress 3.9.1, PHP Browser Detection 3.0), I get the following message (this time, without the stream_socket_client warnings):

    Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 71 bytes) in /…/wp-content/plugins/php-browser-detection/lib/Browscap.php on line 864

    On each instance, when I delete the PHP Browser Detection plugin entirely and then reinstall and activate it, everything is fine. At least for a little while. Then, after a few days, the memory errors come back and the site dies.

    It looks like the memory errors seem to crop up in the section of code where the local browscap.ini file is parsed. I notice that the browscap.ini file that comes with the plugin (Version=5027, Released=Thu, 24 Apr 2014 07:41:24 +0000) is 10.4 MB, while a newer one that appeared on my server (Version=5029, Released=Thu, 08 May 2014 07:17:44 +0000) is 13.7 MB. Is it possible that PHP is choking when it tries to explode() and parse files that big? Perhaps it’s too much for PHP with 128 MB of memory to handle?

    Is there something else that’s being cached and growing over time that I am not seeing?

    Plugin Author Mindshare Labs, Inc.

    (@mindshare)

    Those are two separate issues it seems. Open a new thread if you want support.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Memory allocation error’ is closed to new replies.