Title: Memory allocation error
Last modified: August 21, 2016

---

# Memory allocation error

 *  Resolved [Angelina Belle](https://wordpress.org/support/users/angelina-belle/)
 * (@angelina-belle)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/memory-allocation-error-1/)
 * 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://wordpress.org/plugins/php-browser-detection/](https://wordpress.org/plugins/php-browser-detection/)

Viewing 9 replies - 1 through 9 (of 9 total)

 *  Plugin Author [Mindshare Labs, Inc.](https://wordpress.org/support/users/mindshare/)
 * (@mindshare)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/memory-allocation-error-1/#post-4865711)
 * Please test version 3.0. It’s a major rewrite.
 *  Thread Starter [Angelina Belle](https://wordpress.org/support/users/angelina-belle/)
 * (@angelina-belle)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/memory-allocation-error-1/#post-4865739)
 * 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.](https://wordpress.org/support/users/mindshare/)
 * (@mindshare)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/memory-allocation-error-1/#post-4865822)
 * 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](https://wordpress.org/support/users/angelina-belle/)
 * (@angelina-belle)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/memory-allocation-error-1/#post-4865829)
 * 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.](https://wordpress.org/support/users/mindshare/)
 * (@mindshare)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/memory-allocation-error-1/#post-4865830)
 * I’ll make a note about the PHP 5.3 requirements in the description. Thanks!
 *  [spinfly](https://wordpress.org/support/users/spinfly/)
 * (@spinfly)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/memory-allocation-error-1/#post-4866002)
 * 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 [http://browscap.org/version](http://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 [http://browscap.org/stream?q=Full_PHP_BrowsCapINI](http://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.](https://wordpress.org/support/users/mindshare/)
 * (@mindshare)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/memory-allocation-error-1/#post-4866003)
 * [@spinfly](https://wordpress.org/support/users/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.
 *  [spinfly](https://wordpress.org/support/users/spinfly/)
 * (@spinfly)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/memory-allocation-error-1/#post-4866005)
 * 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.](https://wordpress.org/support/users/mindshare/)
 * (@mindshare)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/memory-allocation-error-1/#post-4866006)
 * 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.

 * ![](https://ps.w.org/php-browser-detection/assets/icon-256x256.png?rev=999338)
 * [PHP Browser Detection](https://wordpress.org/plugins/php-browser-detection/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/php-browser-detection/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/php-browser-detection/)
 * [Active Topics](https://wordpress.org/support/plugin/php-browser-detection/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/php-browser-detection/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/php-browser-detection/reviews/)

## Tags

 * [memory error](https://wordpress.org/support/topic-tag/memory-error/)

 * 9 replies
 * 3 participants
 * Last reply from: [Mindshare Labs, Inc.](https://wordpress.org/support/users/mindshare/)
 * Last activity: [11 years, 9 months ago](https://wordpress.org/support/topic/memory-allocation-error-1/#post-4866006)
 * Status: resolved