Linux Ask!

Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.

Jan 012010
 

Increase PHP memory limit

Answer:

If you experienced error such as "Fatal error: Allowed memory size of 16777216 bytes exhausted ", you would need to increase the memory limit of your PHP, by editing the php.ini

vi /etc/php.ini

Locate and set

memory_limit = 32M ;

Try it with the number you need.

Jan 012010
 

Turn off PHP error messages?

Answer:

In a production server, you should always turn off PHP error messages to be displayed for public, to do so, edit the php.ini

E.g.

vi /etc/php.ini

And turn off display_errors

display_errors = Off

Oct 092009
 

Should I always use single-quotes for PHP strings?

Answer:

Some people say single-quotes string is faster than double-quotes string in PHP. But this have been rejected by the PHP's developer

Benchmarks run against PHP 5.2 and 5.3 show that parsing double-quoted 
strings with interpolation is no slower (and often faster) than single- 
quoted strings using concatenation. When simple strings with no 
variables in them are used, the performance is clearly better with 
double-quoted strings due to implementation details in the engine. See 
the benchmark posted at . 

Reference: http://groups.google.com/group/make-the-web-faster/browse_thread/thread/ddfbe82dd80408cc?pli=1