I am getting this error in Joomla:
Illegal variable `_files` or `_env` or `_get` or `_post` or `_cookie`
or `_server` or `_session` or `globals` passed to script.
I didn't get much help googling.
I am getting this error in Joomla:
Illegal variable `_files` or `_env` or `_get` or `_post` or `_cookie`
or `_server` or `_session` or `globals` passed to script.
I didn't get much help googling.
I had to fix this for joomla 1.5
Here is how I did it
Find the file /{your_joomla_folder}/libraries/joomla/environment/request.php
And make the error friendlier
In my case an AJAX script was uploading files as
The 0 was causing problems, so because this was a minimal script I could simply transfer the info from
$_FILES
to somewhere else before joomla loadedfor example like this:
Note that you can't use the variable
$files
after including/includes/framework.php
as joomla will unhelpfully overwrite it with nullThe only solution that worked is to commnet out the following line in request.php file
Find the file /{your_joomla_folder}/libraries/joomla/environment/request.php
// $failed |= is_numeric( $key );
You'll see this error if you try to specify a URL parameter whose name consists solely of digits, e.g.
or if you try to use a joomla-reserved variable, e.g.
It's not a great error message. If you have access to a unix terminal, you can debug these kind of problems with some command-line tools, e.g.
This is a fictional joomla installation, assuming a fairly standard
DocumentRoot
. The result immediately confirms this is a Joomla error, and reports which file caused it. Extract from that file:Note that the error message is particularly misleading because, not only is in thrown in the case of a reserved variable name, but also if the parameter name is numeric.
It's not an error PHP generates, it's an error that seems to belong to Joomla!. I found this page after 20 seconds of Googling for "Illegal variable".