ispCP - Board - Support
Per-domain properties (php version, variables etc) - Printable Version

+- ispCP - Board - Support (http://www.isp-control.net/forum)
+-- Forum: ispCP Omega Development Area (/forum-1.html)
+--- Forum: General discussion (/forum-11.html)
+--- Thread: Per-domain properties (php version, variables etc) (/thread-3448.html)



Per-domain properties (php version, variables etc) - ispcomm - 06-04-2008 06:14 PM

I need to implement per-domain properties for simple things like:
-) php version (4/5)
-) php customizations of php.ini (i.e. global_vars and url fopen base)
-) other fastcgi's (like ruby etc)

I'm looking for advice on what's the best place to put such custimizations (i.e. what table of the database) and whether such type of change is likely to be accepted in the main trunk code (I will not do it if it won't...).

What I have in mind is this:
-) Change some of the php.ini etc templates to accept more variables for the se parameters.
-) Add defaults to database of ispcp.conf (which is better?)
-) Change the daemons if needed (i.e. for creating the appropriate fastcgi stuff).
-) Change the web interface and templates so that the tunables can be tuned via web.

Thanks,
ispcomm

PS: I don't want to start an argument on global_vars and similar because it's not the point (I don't like global_vars, but I need to support sites that use it and that have been around for a decade now and have withstand most global_vars exploiting worms).


RE: Per-domain properties (php version, variables etc) - kilburn - 06-29-2008 06:12 AM

ispcomm, you may exploit the fact that the last declaration of the same key in php.ini is what php will use. Given this, you may:

-) Add a "domain_hosting_props" table (domain_id, scope, key, value) so ie the "register_globals" setting would end up here as (XX, 'php', 'register_globals', 'On').
-) Modify the engine to add all the defined 'php' domain props at the end of the generated php.ini (simply appending them would work)
-) Modify the GUI so admins (maybe resellers) can set up any php configuration key
-) Allow the user to change some keys, like 'display_errors' or 'register_globals' maybe.