Skip to main content.

Monday, August 02, 2004

In order to make sure Nucleus runs on as much servers as possible, my PHP setup (php.ini) is set up in a way to make the environment as hard as possible to work with. TeRanEX requested an overview, so here it is:

  1. short_open_tag = Off - This forces PHP code to only work when enclosed by <?php ... ?>. It allows to discover accidental occurrences of <?...?> quite fast.
  2. asp_tags = On - This allows to use the ASP style <%...%> code delimiters next to the ordinary ones. With this option enabled, occurrences of <% in code comments will cause parse errors. Thus, you should never describe the use of skinvars/templatevars in code comments
  3. allow_call_time_pass_reference = Off - It's deprecated, and should hence not be used. (when On, this option allows calls like myMethod(&$myVar))
  4. error_reporting = E_ALL - Nucleus will override this (hides notices), but I generally use E_ALL in a testing environment
  5. register_globals = Off - No code should rely on this option.
  6. magic_quotes_gpc = On - When On, the values in the GET/POST/COOKIE arrays are escaped automatically (slashes are added in front of characters like quotes and such). Nucleus undoes this magic in the postVar/getVar/... methods.
  7. magic_quotes_runtime = On - A similar option: all runtime generated data is automatically escaped. This is quite annoying, so Nucleus uses set_magic_quotes_runtime(0) in globalfunctions.php

I'm having safe_mode set to Off. Nucleus requires this (sort of), since safe_mode adds restrictions that make certain actions (file upload related) impossible.

PHP5 also has an option register_long_arrays. It controls "whether or not to register the old-style input arrays, HTTP_GET_VARS and friends.". At the moment, I have it set to On but would like Nucleus to become fully independent of these arrays (when run on PHP 4.1.0+). At that time, I'll set this option to Off (one of the areas still using these long arrays is file upload, which uses HTTP_POST_FILES)

Comments

Cool! and thx! :-)

Posted by TeRanEX at Monday, August 02, 2004 15:08:38

> I'm having safe_mode set to Off.
> Nucleus requires this (sort of),
> since safe_mode adds restrictions
> that make certain actions (file upload
> related) impossible.

Actually, my host has some safe mode settings on, and file uploads works for me. (Initially, I had to create numbered folders for each user. But I'm not sure that's even necessary anymore.)

Posted by Roel at Monday, August 02, 2004 21:31:33

Add Comment

This item is closed, it's not possible to add new comments to it or to vote on it