 | News Feed |
 | Jobs Feed |
Sections
|
| feed this: |  |
Kevin Schroeder: Why you should not use .htaccess (AllowOverride All) in production
by Chris Cornutt February 25, 2013 @ 10:31:09
Kevin Schroeder has posted the results of some research he did around using the "AllowOverride" setting in Apache. He found some interesting differences when it was set to "all".
Commonly known as .htaccess, AllowOverride is a neat little feature that allows you to tweak the server's behavior without modifying the configuration file or restarting the server. [...] Beyond the obvious security problems of allowing configuration modifications in a public document root there is also a performance impact. What happens with AllowOverride is that Apache will do an open() call on each parent directory from the requested file onward.
He includes the output from a strace call in the post - first showing the function calls with it set to "none" then the same request with the setting on "all". More "open" calls are being made in the second run, increasing the execution time by a decent amount.
voice your opinion now!
apache allowoverride all htaccess production setting performance
Kevin Schroeder: Setting max_input_time (with data!)
by Chris Cornutt January 11, 2013 @ 09:20:46
Kevin Schroeder has a new post to his site today wondering about the "max_input_time" setting for PHP and why some recommend it being a large number despite the (usually) fast time PHP has accepting input.
I asked a question on Twitter on why some of the recommend max_input_time settings seem to be ridiculously large. Some of the defaults I've seen have been upwards of 60 seconds. However, after thinking about it I was a little confused as to why a C program (i.e. PHP) would take so long to process string input. The reason I was thinking about this was because I was thinking about ways to protect PHP from denial of service attacks.
So he ran some tests to see just how effective changes in this setting could be and how much time a typical PHP request would need to take in input. Using a Zend Framework 2 HTTP client, he simulated POSTS and tracked the start and end times for a file upload. He includes the timing results in the post based on both this setup and a change to only post regular text-based form data.
voice your opinion now!
maxinputtime zendframework2 setting seconds benchmark
Rob Allen: ZendServiceManager configuration keys
by Chris Cornutt November 12, 2012 @ 11:09:47
Rob Allen has a new post to his site sharing some examples of the configuration possibilities for the ZendServiceManager module of the Zend Framework 2.
ZendServiceManager is usually configured in two places: an array in a config file or a method within your Module class. In either case, you provide a nested array of configuration information. [...] Within the service_manager array, there are a set of nested arrays which are generally used to configure how you want a given class to be instantiated. the names of these sub-arrays are hardcoded, so you just need to learn their names and the difference between them.
He lists out each of the options and includes a brief example and description for each. Values include "invokables", "aliases" and "initializers". He also touches on controllers, view helpers and controller plugins and how they hook into the ServiceManager.
voice your opinion now!
zendframework servicemanager module configuration setting
PHPMaster.com: A Tour of PHP.INI
by Chris Cornutt December 12, 2011 @ 10:42:45
On PHPMaster.com today Callum Hopkins has written up an introduction to the php.ini, the heart and soul of any PHP installation. With configuration options for just about everything, it can be confusing. This tutorial hits some of the highs and most commonly updated settings.
Anyone who has a server using PHP has undoubtedly heard of php.ini - it's the configuration file used to control and customize PHP's run-time behavior. It provides a simple way to configure settings. [...] In this article I'll give an overview of some important settings I believe you should be concerned with when tweaking your own php.ini file.
The tutorial's broken up into a few different topics:
- the PHP engine
- Short tags
- Output buffering
- Automatic headers and footers
- Handling errors
- Time zones
voice your opinion now!
phpini configuration tutorial file setting
Kevin Schroeder's Blog: Pre-caching FTW
by Chris Cornutt January 07, 2011 @ 11:16:57
In this new post to his blog Kevin Schroeder suggests that there's something even better than doing the typical caching inline (request, write to cache) - pre-caching.
I just had an epiphany. I've talked about pre-caching content before and the benefits thereof before. But this is the first time I realized not only that there are benefits, but that doing it is BETTER than caching inline. Let me sum up... no, there is to much. Let me explain.
He gives an example of how a typical application might cache - when it finds a "miss" for the data it's trying to pull. A simple cache is easy, but what happens if it uses a configuration value that could change (like the username/password in his second example). Pre-caching would eliminate the risk since the setting would be known to be valid when the cache is generated.
voice your opinion now!
caching precache inline setting invalid miss
SitePoint PHP Blog: How to Upload Large Files in PHP
by Chris Cornutt August 17, 2010 @ 08:44:18
On the SitePoint PHP blog today Craig Buckler talks about uploading large files in your PHP application. He points to two other resources - this manual page and this introductory tutorial about handling file uploads to get the ball rolling.
One of the most popular uses is image uploads. Your users can submit photographs from a form without resorting to FTP or other convoluted methods. HTML5 and Flash also permit drag and drop, so the operation is likely to become easier as browsers evolve. This is where the problems can begin.
He points out the large size of the images most modern cameras work with and how PHP, with its basic settings, can't handle a lot of the resulting images. He mentions the upload_max_filesize and post_max_size settings you can set in either your php.ini or via an .htaccess (or even in your script). There's also a few helpful comments with more tips on large file handling.
voice your opinion now!
upload large file tutorial phpini setting
Brian Moon's Blog: Using ini files for PHP application settings
by Chris Cornutt January 20, 2010 @ 10:40:39
In a new post to his blog Brian Moon looks at a handy piece of functionality that comes with the default PHP installations (and is used by several major frameworks like this one) - using INI files to store settings for an application.
One of the challenges of this [three tier server setup] is where and how to store the connection information for all these services. We have done several things in the past. The most common thing is to store this information in a PHP file. [...] We have taken [it] one step further using some PHP ini trickeration. We use ini files that are loaded at PHP's startup and therefore the information is kept in PHP's memory at all times.
They use the get_cfg_var function and the "--with-config-file-scan-dir" option to tell PHP to automatically load in the ini files it finds in the named directory. He gives an example of both a simple configuration and a more complex situation where a MySQL instance can read from the ini file containing the username/password/host information.
voice your opinion now!
ini file setting getcfgvar tutorial
|
Community Events
Don't see your event here? Let us know!
|