Cannot save article in Joomla 3.0 Magic Quotes issue - php

I am unable to save any article / module etc in Joomla 3.0. When I try to save the " " is replaced by "\"\"". This messes up all my code. I tried turning off the magic_quotes_gpc in php.ini but that did not help.
How do I fix this?

I presume you did the Joomla! 3 installation by adding the .htaccess with magic_quotes_gpc = off inside the install directory, to successfully install the platform, correct?
If your server is running php 5.3+ you need to set the server php configuration to magic_quotes_gpc = off. It should be configured as so since magic_quotes_gpc is deprecated in php 5.3 and will be removed in 5.4.
In summary, you can only overcome this issue by configuring the php on the server. No .htaccess will solve your problem, unless you place an .htaccess inside each and every directory on your Joomla! installation - which is unthinkable imo.

fixing the issue where adding \" during article posts in administrator panel:
magic_quotes_gpc = Off
magic_quotes_runtime = Off
magic_quotes_sybase = Off
Disable these options from your php.ini file.
You can also overwrite the php.ini.
Please check the link for overwriting the php.ini using .htaccess
How to turn off magic quotes on shared hosting?

Related

Deprecated: Directive 'allow_url_include' is deprecated in Unknown on line 0

I upload my Laravel project on shared hosting. When I upload my project on the server it throws an exception then switched my PHP version 5.4 to 7.4. Now am facing this issue.
Deprecated: Directive 'allow_url_include' is deprecated in Unknown on line 0
I also disable the allow_url_include in my PHP ini file which exists in project root directory but it still says allow_url_include depreciated error.
Also, I go into the PHP Multi INI Editor and change the allow_url_include but it still throw the above error.
Remove .htaccess or change name to .htaccess.backup and WP will generate new file based on your site configuration
Log into your website host and navigate to your public_html folder and find the php.ini file. Open the file and find this code:
; Whether to allow include/require to open URLs (like http:// or ftp://) as files.
; http://php.net/allow-url-include
allow_url_include = On
Change allow_url_include = On to allow_url_include = Off and save the file.
This should fix the error.
Additional detail located here:
https://www.php.net/manual/en/filesystem.configuration.php#ini.allow-url-include
In case anyone comes across this:
Make sure that .htaccess files at all levels do not have conflicting code.
That is, I found that my ".../public_html/.htaccess" did not have any conflicts. However, I also had an .htaccess file in the folder level above that and it included code that read:
# Use PHP71 as default AddHandler application/x-httpd-php71 .php <IfModule mod_suphp.c> suPHP_ConfigPath /opt/php71/lib </IfModule>
Commenting this out resolved the error for me.
If your web host uses Cpanel, log in and under the Software section click Select PHP Version, then on the next screen click Options. Under Options, unclick allow_url_include:
Please Update PHP version of your site through CPanel to 7.3. This fixed the issue for my site. Thank you!
My client had 2 .ini files, conflicting max_input_var.
Deleting user.ini worked for me! Payment options were greyed out in WooCommerce. Now they are showing and this "allow_url" error is gone.

Having an issue while installing Kayako Fusion

I am installing Kayako Fusion and get this error:
Reason: Magic quotes is enabled in the php.ini configuration file. Please change magic_quotes_gpc to Off
Unfortunately, Kayako cannot be installed. Either an error has occurred or your web server doesn't meet the minimum system requirements. Please review any errors shown above and retry the setup process after those items have been resolved
I have tried php.ini file also but its not working. I am on Shared Hosting.
You can disable magic quotes via .htaccess file
In the webroot of your Kayako install create a .htaccess file
paste in the following:
php_flag magic_quotes_gpc Off
Sounds like something is overriding whatever customisations you are making to your php.ini. I think this is a question for your shared hosting provider: "How can I disable magic quotes for my hosting account?"
Hope this helps.

Why isn't disabling magic quotes in php.ini taking effect?

I disabled magic quotes at the end of my php.ini file in my root directory and there was no change. I am still getting backslashes in front of single quotes in $_POST entries. So I put a php.ini file in the same directory as the PHP file being run and only included the lines disabling magic quotes, but there still isn’t any change.
What am I missing here?
PHP 5.3.24 on a GoDaddy shared server.
The php.ini file:
magic_quotes_gpc = Off
magic_quotes_runtime = Off
magic_quotes_sybase = Off
Note: As of php 7.4 this option is deprecated and it is removed in php 8.0
You could try it with a .htaccess file. You will need this line:
php_flag magic_quotes_gpc Off
As GoDaddy Shared Server doesn't accept this above option try this instead:
You have to make a file named like php5.ini and place this in the root folder. You can add just only the three lines you need or you can copy the php.ini file that you have on your local computer and edit the changes you want.

PHP ignoring config file

I'm trying to turn off magic_quotes_gpc in PHP. I'm running PHP with Apache and Ubuntu.
I have in my config file (/etc/php5/apache2/php.ini):
magic_quotes_gpc Off
Where I create a page with phpinfo() it shows magic_quotes_gpc as on. I've also looked in Additional .ini files parsed and there is no setting for it.
Why is PHP ignoring this?
try to add/edit in php.ini
magic_quotes_gpc = Off
after adding restart your apache services for taking effect this
You can turn them off using .htaccess with:
php_flag magic_quotes_gpc Off
and also using php if writable php.ini
ini_set('magic_quotes_gpc' , 0 );
Firstly, it is deprecated so, don't rely on it. Mmmmmmmkay?
Secondly, Check
Loaded Configuration File
Under phpinfo()
Also Add :
php_flag magic_quotes_gpc Off to your .htaccess file.
Cool?
Did you recently make this change? If so, you have to restart PHP for it to take effect.

Loading PHP Extensions using Plesk

I am trying to load the php_memcache.dll extension using the Plesk Additional Directives section under the PHP Settings for a domain, subscription or subdomain. No matter what I do, I cannot get Plesk to load the extension!
The only way I can load the extension into PHP is by manually editing the php.ini, which is a dirty fix as I will need to edit this each time the server is updated as the php.ini gets overwritten each time!
The php_memcache.dll is definitely in the extensions directory referenced in the phpinfo(), this is proven by the fact that I can load the extension successfully by entering it into the php.ini manually.
I am pretty confident this is a bug, but just wanted to see if anybody else has had any similar issues?
The bug seems to be the description implying that it is possible when it really is not.
In this page: http://download1.parallels.com/Plesk/PP11/11.5/Doc/en-US/online/plesk-administrator-guide/index.htm?fileName=69696.htm it says that additional directives can take any setting that is listed as PHP_INI_USER and PHP_INI_ALL in this page: http://php.net/manual/en/ini.list.php.
In that page extension is listed as php.ini only, so it will not work from the additional directives option.

Categories