freepbx 2.5 just got this message after an upgrade. how can i take care of this:
You have magic_quotes_gpc enabled in your php.ini, http or .htaccess file which will cause errors in some modules. FreePBX expects this to be off and runs under that assumption
it’s always been on, we just started checking and reporting on the issue in 2.5. You need to edit /etc/php.ini and if it is not in there, then put it in there and set it off. Unfortunately, the php default is to actually be on which is not a good thing.
My server has multiple copies of php.ini, perhaps your server does, too. Make sure you change the file that is actually being used by apache2. Also, have you checked the http.conf and .htaccess files on your system? A local file could override the global settings in php.ini.
I searched the entire system. The .htaccess files just say “Deny from All” and the http and httpd.conf files are just telling me that magic gpc is OFF and I still have the message on freepbx. Note that it says Added 0 minutes ago. Is this a bug or is the message supposed to go away?
Thanks
I have checked this over and over and still have the message coming up. It also came up on one of my client’s systems. I just took over his system remotely and as soon as I got on to Free PBX I got the magic quotes message. Is there anything else I can do here? This is getting me very concerned.
Is there any shortcut, such as to search for “magic quotes gpc= on” within the entire system?
Which common applications or freepbx features will not work for me if I just ignore this magic quotes message, even though i have it turned off and this box had been running for 2 years without that message?
it’s worth knowing why you can’t turn it off, or in other words, what is setting it when you think you have unset it because it could lead to issues down the road. The simple answer is that FreePBX expects it to be off, and does all it’s own ‘escaping’ of various fields when they are needed. If php turns around and tries to be ‘smart’ (which is what magic quotes does) then you can end up with strange data being inserted in database fields sometimes.
You can read the docs as to what it does, but the bottom line, it is a settable parameter in php and unfortunately happens to be the default value which means, not being able to find it doesn’t mean it isn’t there. You really do want to know which php config file is being used by your system…
Ok it actually just happened to me right this second on another box!
I had the “memory limit changed” message, so I went into both php.ini files and changed the memory limit from 64M to 100M and the second I restarted httpd I got this magic quotes message even though quotes are turned off.
I changed the memory limit back to 64M and I still have the magic quotes message on.
Can you duplicate this issue? Or any solution to this?
Thanks
; Magic quotes
;
; Magic quotes for incoming GET/POST/Cookie data.
magic_quotes_gpc = Off
; Magic quotes for runtime-generated data, e.g. data from SQL, from exec(), etc.
magic_quotes_runtime = Off
; Use Sybase-style magic quotes (escape ' with '' instead of \').
magic_quotes_sybase = Off
; Automatically add files before or after any PHP document.
auto_prepend_file =
auto_append_file =
In FreePBX Tools tab, there is a menu, PHP Info (if installed). Click on that and search for magic in your browser to see if it is Off or not.
If you don’t have that menu you can create an info.php file with the following:
<?php
phpinfo();
?>
Place that file in /var/www/html and run it from your browser.
When I run it I have this entries for magic:
magic_quotes_gpc Off Off
magic_quotes_runtime Off Off
magic_quotes_sybase Off Off
If your’s are Off then we have to look elsewhere, but to be sure that your php is correct we need this info.