Results 1 to 16 of 16
  1. #1
    Join Date
    Jun 2005
    Posts
    1

    Default Magic Quotes GPC Off

    "How to change the value of a PHP setting?

    Almost all PHP settings can be changed with a local php.ini file.

    For example, you need register_globals set to On in a directory. For this purpose log in your Cpanel and go to the File Manager. There navigate to the directory where you'd like this setting applied. In this directory create a file php.ini containing:

    register_globals=on"

    As per the above listed instructions; I tried created a php.ini with the following text in every directory I could imagine needed this setting. Unfortunately, my program installer continues to yield an error message indicating that Magic Quotes is still on. Does anyone know how to turn Magic Quotes off without a trouble ticket?

    ; Magic quotes for incoming GET/POST/Cookie data.
    magic_quotes_gpc = On

  2. #2

    Default

    There is one peculiarity when using local php.ini to overwrite the global PHP settings. It is that the php.ini is working only for the folder that it is created into. It does not work recursive.

    Let's assume that we have the following hierarchy under your public_html:

    folder1
    folder2
    folder3
    folder4
    php.ini
    file1.php
    file2.php

    The particular php.ini file, with your custom settings will affect only the files, which are located in this folder (i.e. file1.php and file2.php). It won't affect the files under folder1, folder2, folder3, folder4.

    The solution in your case is to have the php.ini uploaded in every particular folder you would like to apply the settings to.

  3. #3

    Default

    Is there a way to do this using .htaccess for a directory and thereby every folder in that directory?

  4. #4

    Default

    No, I am afraid this is not possible. You can change PHP variables only via custom php.ini files on our servers.

  5. #5

    Default

    OK thanks, but once enabled it is possible isnt it to turn off and on using .htaccess just like register_globals?

  6. #6
    Join Date
    Apr 2008
    Posts
    1

    Default Can't turn off Magic Quotes, tried php.ini

    I'm trying to install RoundCube, which requires magic_quotes_gpc to be off. Following the advice in this forum, I created php.ini files containing only one line:

    magic_quotes_gpc = Off

    Since the php.ini values only apply within a directory, I populated ALL /mail subdirectories with php.ini files, just to be on the safe side. However, the error persists and magic-quotes_gpc is still "on." How can I turn it off?

  7. #7

    Default

    If the option remains unchanged I assume you are using PHP 5.1 for your account. You can resolve the issue by changing the PHP version. Here you can find detailed instructions how to do so:

    http://kb.siteground.com/article/How..._versions.html

    You will not experience any troubles using PHP 5.0 or 5.2.

  8. #8
    Join Date
    May 2008
    Posts
    4

    Default

    I am having a similar problem with not being able to re-assign certain php variables via a php.ini file.

    I am using php 5.25.

    I have a php.ini and a info.php in my root directory.

    My php.ini files looks like the following:

    register_globals = On

    [Zend]
    zend_extension=/usr/local/ioncube/ioncube_loader_lin_5.2.so
    zend_extension_manager.optimizer=/usr/local/Zend/lib/Optimizer-3.2.2
    zend_extension_manager.optimizer_ts=/usr/local/Zend/lib/Optimizer_TS-3.2.2
    zend_optimizer.version=3.2.2
    zend_extension=/usr/local/Zend/lib/ZendExtensionManager.so
    zend_extension_ts=/usr/local/Zend/lib/ZendExtensionManager_TS.so

    post_max_size = 100M
    upload_max_filesize = 22M
    max_execution_time = 1000

    ---------------------------------

    Non of the variables above will change, however i can change other variables via this php.ini file. I can set safe_mode, I can change the smtp_port. It seems like everything i try to change, I am successful, except for the 3 above that I need.

    Please advise.

  9. #9
    Join Date
    May 2008
    Posts
    4

    Default

    after further testing i found that the changes will apply to "upload_max_filesize" if I revert to php5.0

    but 5.1, or 5.2.5 seem to ignore it.

    What gives. I'd switch to 5.0 to solve this, however i use 5.1 (and above) functions.

  10. #10
    Join Date
    May 2008
    Posts
    9

    Default

    Quote Originally Posted by mandalay View Post
    I'm trying to install RoundCube, which requires magic_quotes_gpc to be off. Following the advice in this forum, I created php.ini files containing only one line:

    magic_quotes_gpc = Off

    Since the php.ini values only apply within a directory, I populated ALL /mail subdirectories with php.ini files, just to be on the safe side. However, the error persists and magic-quotes_gpc is still "on." How can I turn it off?
    Hi, I have the same problem here...
    Please, how can I turn this off?

  11. #11
    Join Date
    May 2008
    Posts
    9

    Default

    the strange thing here, is that my phpinfo file give me this:

    magic_quotes_gpc Local Value:Off Master Value:Off

    but the roundcube installer is not working!!

  12. #12

    Default

    There should be a different reason of the roundcube installer not working. Is there any error message and if so, what does it state?

  13. #13
    Join Date
    May 2008
    Posts
    9

    Default

    Quote Originally Posted by Val View Post
    There should be a different reason of the roundcube installer not working. Is there any error message and if so, what does it state?
    at the header there are the following:
    Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /home/humed1/public_html/roundcubemail-0.1.1/installer/index.php:8) in /home/humed1/public_html/roundcubemail-0.1.1/installer/index.php on line 29

    Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/humed1/public_html/roundcubemail-0.1.1/installer/index.php:8) in /home/humed1/public_html/roundcubemail-0.1.1/installer/index.php on line 29

    but I think the main problem here is the Magic Quotes GPC..

  14. #14

    Default

    Magic Quotes, generally speaking, is the process of escaping special characters with a '\' to allow a string to be entered into a database. This is considered 'magic' because PHP can do this automatically for you if you have magic_quotes_gpc turned on.

    In your case however the issue is caused due to the fact that data has been sent to the browser before the session_start() was called. This is quite a .. developer mistake in my opinion, but hey I'm no developer so I can't really say it.

    To correct this small issue I've added the following line at the start of the installer:

    ob_start();

    and at the end of the file, I have therefore added:

    ob_end_flush();

    which buffers the output and send it at once instead of sending each data unbuffered. Now it seems that the installer works fine.

  15. #15
    Join Date
    Nov 2007
    Posts
    6

    Default Does this fix it?

    Hey Val,

    It seems like you got the installer to work by adding this

    ob_start();

    ob_end_flush();

    Which file excatly did you edit? And at what file lines did you insert these.

    Thanks.

    bwd283

    Quote Originally Posted by Val View Post
    Magic Quotes, generally speaking, is the process of escaping special characters with a '\' to allow a string to be entered into a database. This is considered 'magic' because PHP can do this automatically for you if you have magic_quotes_gpc turned on.

    In your case however the issue is caused due to the fact that data has been sent to the browser before the session_start() was called. This is quite a .. developer mistake in my opinion, but hey I'm no developer so I can't really say it.

    To correct this small issue I've added the following line at the start of the installer:

    ob_start();

    and at the end of the file, I have therefore added:

    ob_end_flush();

    which buffers the output and send it at once instead of sending each data unbuffered. Now it seems that the installer works fine.

  16. #16

    Default

    Honestly ... I do not remember already but looking into the error code you were receiving above, that would be;

    /home/humed1/public_html/roundcubemail-0.1.1/installer/index.php

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •