1. Please take a little time for this simple survey! Thank you for participating!
    Dismiss Notice
  2. Dear Pleskians, please read this carefully! New attachments and other rules Thank you!
    Dismiss Notice
  3. Dear Pleskians, I really hope that you will share your opinion in this Special topic for chatter about Plesk in the Clouds. Thank you!
    Dismiss Notice

Magic Quotes

Discussion in 'Plesk for Linux - 8.x and Older' started by dyrer, Mar 29, 2007.

  1. dyrer

    dyrer Basic Pleskian

    26
     
    Joined:
    Mar 27, 2007
    Messages:
    51
    Likes Received:
    0
    Location:
    Greece
    How can make Magic Quotes on?
     
  2. Dmitry Frantsev

    Dmitry Frantsev Golden Pleskian

    28
    57%
    Joined:
    Sep 19, 2005
    Messages:
    1,911
    Likes Received:
    0
    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.
     
  3. jallen

    jallen Guest

    0
     
    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....
     
  4. Dmitry Frantsev

    Dmitry Frantsev Golden Pleskian

    28
    57%
    Joined:
    Sep 19, 2005
    Messages:
    1,911
    Likes Received:
    0
    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.
     
  5. jallen

    jallen Guest

    0
     
    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?
     
  6. Dmitry Frantsev

    Dmitry Frantsev Golden Pleskian

    28
    57%
    Joined:
    Sep 19, 2005
    Messages:
    1,911
    Likes Received:
    0
    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
     
Loading...