Now, last time we were looking at two PHP configuration settings that could be worked around using code, not exclusively via run-time configuration. There are many other settings that can be done exclusively with run-time configuration. Some can't be done in code at all, and needs help from the web server or user...

Now, in some ways, I'd hate it if an application overrode my carefully thought-out setting if I were a systems administrator. But as an application developer at the moment, the system administrator will have to make these changes anyway, and can change them back if they want to, so all I'm doing is making it work for those who needn't know all about that.

I've mentioned what changes I needed in KnowledgeTree in my discussion on modernising KnowledgeTree's code for the 2.0 major version release. For easy reference, here's what I did:

// Default settings differ, we need some of these, so force the matter.
// Can be overridden here if actually necessary.
error_reporting(E_ALL & ~E_NOTICE);
ini_set('display_errors', '1');
ini_set('display_startup_errors', '1');
ini_set('magic_quotes_runtime', '0');

Other settings that can be changed in code include max_execution_time. But, you quickly realise that many things are decided way before your script even starts running, particularly around uploads.

Highly fallible users are now expected to read the documentation to make sure your software works on your system. Since most won't do so, you're going to get lots of support questions. Irritating.

So, stealing some ideas from Mambo, I created a checkup page for KnowledgeTree users to visually ascertain how their environment supports running KnowledgeTree.

RedHat and Gentoo and friends may have garish colour sense and a penchant for inappropriate use for colour, but in this scenario (on the web, not a console), the green/orange/red colouring helps us out.

Behind the scenes, there's actually quite a bit of code. Can't reuse any code from the project, as it may rely on features we're trying to test in the first place.

Next time, I'll look at .htaccess files and how to detect if they're working, and if your users have followed your instructions about moving stuff out of a web root.

0 Responses

Have your say

The text area above accepts Post Markup, a BBCode work-alike.

[b]foo[/b]: foo
[i]foo[/i]: foo
[link]http://nxsy.org/[/link]: http://nxsy.org/ [nxsy.org]
[link http://nxsy.org/]Neil[/link]: Neil [nxsy.org]
        

You can also use:

[code python]
import foo
[/code]