Thursday, January 8, 2009

PHP Get User Information

Class features:
* Get User Browser.
* Get User Operating System.
* Get User IP.
* Get User Country.
* Get User Referral + Search Engine.
* Get User Language.
* Check if Flash enabled.
* Check if JavaScript enabled.
* Check user speed (bandwidth).

Download the file.

Reference: here

Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 134 bytes)

When you received this kind of error in PHP

Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 134 bytes) in /home/www/domains/www.salzwimmer.at/html/gb/PYG.php on line 181


Here's how to resolve in xampp:
1. Enable the Rewrite module.
Open %XAMPP%\apache\conf\httpd.conf in notepad and search for mod_rewrite. You will find a line like:
#LoadModule rewrite_module modules/mod_rewrite.so

Remove the # from the beginning. It will now look:
LoadModule rewrite_module modules/mod_rewrite.so

Restart the Apache web server through XAMPP control panel.

2. Find php.ini in your folder
Change the memory_limit to 64M
Here are the files that I changed:
%XAMPP%\php\php.ini
and
%XAMPP%\apache\bin\php.ini

Find a line like:
memory_limit = 32M ; Maximum amount of memory a script may consume (16MB)

Change to
memory_limit = 64M ; Maximum amount of memory a script may consume (16MB)


Save the file and restart the Apache web server.
You should be able to resolve this error.

To check on the configuration:
1. Go to localhost/xampp
2. Click on the phpinfo()
3. Find for memory_limit
4. See if it's 64M instead of 32M