An unexpected error occurred. Only variables should be passed by reference
Permalink 1 user found helpful
Hopefully this helps someone else because I lost a few hours trying to figure out what was wrong.
After migrating a client's 5.7 site from our development server to their production server, I got the following error when going to the file manager:
An unexpected error occurred. Only variables should be passed by reference
Turning on debug error output revealed that the error was being caused by /concrete/elements/files/search.php on line 94, which looked fine to me.
After digging through the forums and coming up empty, I discovered that the asp_tags directive was set to "On" in php.ini. I changed it to "Off" and all is well.
After migrating a client's 5.7 site from our development server to their production server, I got the following error when going to the file manager:
An unexpected error occurred. Only variables should be passed by reference
Turning on debug error output revealed that the error was being caused by /concrete/elements/files/search.php on line 94, which looked fine to me.
After digging through the forums and coming up empty, I discovered that the asp_tags directive was set to "On" in php.ini. I changed it to "Off" and all is well.
Please explain how this is done, where do I go to make this change? Struggled for months to gt his fixed.
How this is done depends on your hosting provider and plan. Are you able to edit your php.ini file? If so, find the asp_tags directive and change it to "Off".
If your hosting environment has cPanel, you should be able to use the MultiPHP INI Editor to disable the asp_tags directive. Other hosting environments may have a similar option.
If the above didn't work, you may be able to add the following to the .htaccess file in your site's root directory: php_flag asp_tags Off
That said, as far as I know, the asp_tags directive was removed in PHP 7.
If your hosting environment has cPanel, you should be able to use the MultiPHP INI Editor to disable the asp_tags directive. Other hosting environments may have a similar option.
If the above didn't work, you may be able to add the following to the .htaccess file in your site's root directory: php_flag asp_tags Off
That said, as far as I know, the asp_tags directive was removed in PHP 7.