• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Magic Quotes

I guess it can be done in php.ini file. Make sure that you are using correct php.ini. In most cases it is /etc/php.ini but you can check it, just in case like this, for example:

$ php -i|grep php.ini
<tr><td class="e">Configuration File (php.ini) Path </td><td class="v">/etc/php.ini </td></tr>

This is php.ini for client's PHP which is used by clients. There you can set 'magic_quotes_gpc' to 'On'. After modification don't forget to restart apache service.
But it is strongly suggested do not do any modification in Plesk PHP configuration file PRODUCT_ROOT/admin/conf/php.ini. Please note that.

Hope this helps.
 
That would affect every vhost on the server wouldn't it?

I'm currently hunting down for a solution to toggle magic quotes on a per host basis... and what I have been finding doesn't seem to be working. :(

I've tried .htaccess file in httpdocs with this

PHP:
php_flag magic_quotes_gpc on

But it didn't toggle magic quotes to on.

Neither did creating vhost.conf in the vhost's conf directory with this:
PHP:
<IfModule mod_php5.c>
  php_value include_path ".:/usr/lib/php"
  php_flag magic_quotes_gpc on
</IfModule>

I'm still scratching my head....
 
Yes, that's right, if you set this parameter to 'Off' in global php.ini configuration file it will affect every vhost.

Actually, as I know with data publishing for every site .htaccess files is uploaded which contains following information:

php_flag magic_quotes_gpc off
php_flag magic_quotes_runtime off
php_value mbstring.func_overload 4

It should work properly. But it won't work if you have PHP as CGI on your server.
 
Originally posted by Dmitry Frantsev

It should work properly. But it won't work if you have PHP as CGI on your server.

I guess I must have PHP as CGI... however I have .htaccess that works on other vhosts for php driven sites..

How do I check out for sure the PHP as CGI?
 
You can check phpinfo() on your server. There is a special field display which API is used on the server. For example, if you have

Server API CGI/FastCGI

then in means that PHP is used as CGI or FastCGI.
If PHP as loaded as apache module following line should be persist on apache configuration (or in one of the included file, for example php.conf):

LoadModule php5_module modules/libphp4(5).so
 
Back
Top