PHP Fatal error: Allowed memory size of xxx bytes exhausted

PHP          Trackback

Familiar with this error code? I was working on some PHP code that is doing bunch of data analysis and I got that error. There is one line of code that can help you to fix this problem. Just put this line at the top of the script:

ini_set('memory_limit', '16M');

This will set memory limit to 16MB. If this is not helping, try to increase memory limit even more.
If you have access to php.ini and you would like to increase memory limit for all your scripts you could add this line to the server’s php.ini file:

memory_limit = 16M

If you see this message when you are running your script that is frequently executed, I would recommend you to check your code first, because most common case when you are going to see this message is whan your code is poorly written and is needlessly eating too much memory.


CSS rounded corners without javascript and without images

CSS          Trackback

One more text in “CSS only” series. This time I present you CSS rounded corners without javascript and without images. You can create rounded corners in few ways, but almost they are all using images or javascript. I don’t have anything against images or javascript, I just wanted to show you that you can do “wonders” with CSS only.

I have created two versions of rounded corners, with and without borders:

CSS Rounded Corners Example

Idea behind this project is very simple: create 4 lines that will “emulate” our rounded corners. You can see how it looks on this magnified corner image:

CSS Rounded Corners, magnified corner