Showing posts with label moodle. Show all posts
Showing posts with label moodle. Show all posts

Tuesday, December 02, 2008

php_flag settings when PHP runs as CGI (.htaccess / register_globals / php.ini)

A lot of people got puzzled because .htaccess does not work when PHP is running as CGI under Apache. Searching on the internet for a potential solution does not give an easy way to solve the problem.

The easiest is to create a php.ini file inside the folder where you want to set the flags in and voila.

For example, to set register_globals off, create a php.ini with the following
register_globals = Off 
Upload this file to that folder and try now phpinfo() to see the local settings for register_globals. Yes it is off.
This setting in important to get rid of the warning you got from Joomla or Moodle.

PHP is really an amazing language.