I am trying to move a huge number of sites from an old Apache (Windows) installation to our Virtualmin site, but we have encountered a problem doing this.
On the old setup we allow for GET variables in the URL, so if you used the following URL
In the test.php file our users normally read the URL just by referring directly to the variable $id and $type.
But when we moves the sites to Virtualmin the variables are not available because they doesn’t use the method $get_[‘id’] and $get_[‘type’] to get access to them.
Is it possible to active this within the actual virtual site so that we doesn’t have to edit / change millions of lines of code for our users???
Looking forward to hear from anyone how can help me regarding this.
Well, that’s an old-style way of accessing variables in PHP. The ability to do that is no longer something PHP enables by default, and is considered a bit of a security risk.
However, if you’d like to enable that, what you can do is edit the php.ini file, and set “register_globals” to “On”.
Yes, I know that it may be a security risk but I can’t demand the users to change it before moving it to the new server
Is it possible to activate this for the specific sites needed, so that it won’t be a global setting like on the old server?
I found this in the Virtualmin -> Services -> PHP 5 Configuration -> PHP Variables
Turn all input into global variables?
Turn command-line parameters into global variables?
Have this anything to do with the “register_globals” option?
You can enable that per-domain, if your domains are using the default FCGID or CGI PHP Execution Mode. If you’re using “mod_php”, you’d have to enable it server-wide.
I think the variable you’re seeing there is what you’d want. Alternatively, you could edit $HOME/etc/php.ini, and enable register_globals there.