vhost configuration (register globals & magic quotes)

Hi everyone,

I need to turno off register globals and magic quotes on 1 site on my server. I’m using PHP as CGI/phpsuexec so I need to make this adjustment on my vhost_mydomain.com.conf file

Will someone please share with me which commands I need to adjust register globals and magic quotes value?

Thanks in advance for your help

My client needs this because he’s installing moodle on their server

PHP versions later than 4.2.0 disable register_globals in php.ini by default. magic_quotes has always been disabled by default.
Both register_globals and magic_quotes have been deprecated since PHP 5.3.0, and will be removed in PHP 6.0.0.

If you’ve deliberately enabled register_globals in php.ini, you might want to get your sanity checked :stuck_out_tongue:
Enabling magic_quotes server-wide is also a bit silly (though unlike register_globals, it’s not a massive security risk).

And to answer your question:

php_flag register_globals off
php_flag magic_quotes_gpc off

The above entries can also be used in a .htaccess file.

In Jesus’ case, he’s using suphp, not mod_php, so he needed to do it via a user-specific php.ini file.

To do this in InterWorx, you need to create a folder, etc, in the user’s home directory (so /home/username/etc) and create a php.ini file in that directory. Both need to be owned by the user.

The syntax in that case is:

register_globals = Off
magic_quotes_gpc = Off

The custom php.ini is appended to the main one, and overrides those values, so you only need to specify what’s changing.

We’re working on an interface for this, if you have suggestions for what SiteWorx users should be allowed to change themselves (versus NodeWorx users, who presumably have more control over the box) feel free to let us know!


Thank you Tim.

I think an option for the server admin to change this by users will be better than just give them access to this to everyone. Or probably we can have something like we do for the Scripts (Available (yes/no)) per domain.

Thanks again for all your help on this matter.


Good point - I’ll add that note to the feature request.