• Introducing WebPros Cloud - a fully managed infrastructure platform purpose-built to simplify the deployment of WebPros products !  WebPros Cloud enables you to easily deliver WebPros solutions — without the complexity of managing the infrastructure.
    Join the pilot program today!
  • Support for BIND DNS has been removed from Plesk for Windows due to security and maintenance risks.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS.

magic_quotes_gpc off

F

fgro

Guest
Hello,

i am getting to turn into a loophole... i edited ever php.ini i could find on my server and added into my vhost.conf this entry

php_admin_flag magic_quotes_gpc off

but php_admin_flag magic_quotes_gpc is still ON

where the hack is the change???? why i cant set this settings through plesk itself????

Any help would be great,

thanks,
fgro
 
I have Zend optimizer installed, so it moved my php.ini file, but check this:

Code:
grep -i 'magic_quotes_gpc' /usr/local/Zend/etc/php.ini

use /etc/php.ini if you are in doubt.
 
One more.. use phpinto() to find location of configuration file (php.ini) that PHP users.
Just create a test script

<?
phpinfo()
?>

and load it under your virtual host. Check the "Configuration File (php.ini) Path" field.
Also examine php parameter magic_quotes_gpc itself, Local Value value can be changed at the appropriate vhost.conf, Master Value is defined in server's php.ini.

./anb
 
> added into my vhost.conf this entry
> php_admin_flag magic_quotes_gpc off

BTW, php changes in vhost.conf should be wrapped with <directory> directive, as well as it is done in domain's httpd.include, i.e.

<Directory /path/to/domain/httpdocs>
php_admin_flag....
php_admin_value....
<Directory>
 
Hello,

i did all the things before and here is it again:

Code:
phpingo() shows me:

Configuration File (php.ini) Path  /etc/php5/cgi  
Scan this dir for additional .ini files  /etc/php5/cgi/conf.d  
additional .ini files parsed  
/etc/php5/cgi/conf.d/curl.ini,
/etc/php5/cgi/conf.d/gd.ini,
/etc/php5/cgi/conf.d/imap.ini,
/etc/php5/cgi/conf.d/interbase.ini,
/etc/php5/cgi/conf.d/ioncube-loader.ini,
/etc/php5/cgi/conf.d/ldap.ini,
/etc/php5/cgi/conf.d/mcrypt.ini,
/etc/php5/cgi/conf.d/mhash.ini,
/etc/php5/cgi/conf.d/ming.ini,
/etc/php5/cgi/conf.d/mysql.ini, 
/etc/php5/cgi/conf.d/mysqli.ini,
/etc/php5/cgi/conf.d/odbc.ini,
/etc/php5/cgi/conf.d/pdo.ini,
/etc/php5/cgi/conf.d/pdo_firebird.ini,
/etc/php5/cgi/conf.d/pdo_mysql.ini,
/etc/php5/cgi/conf.d/pdo_odbc.ini,
/etc/php5/cgi/conf.d/pdo_pgsql.ini,
/etc/php5/cgi/conf.d/pdo_sqlite.ini,
/etc/php5/cgi/conf.d/pgsql.ini,
/etc/php5/cgi/conf.d/ps.ini,
/etc/php5/cgi/conf.d/pspell.ini,
/etc/php5/cgi/conf.d/recode.ini,
/etc/php5/cgi/conf.d/snmp.ini,
/etc/php5/cgi/conf.d/sqlite.ini,
/etc/php5/cgi/conf.d/sqlite3.ini,
/etc/php5/cgi/conf.d/suhosin.ini,
/etc/php5/cgi/conf.d/sybase_ct.ini,
/etc/php5/cgi/conf.d/tidy.ini,
/etc/php5/cgi/conf.d/uuid.ini,
/etc/php5/cgi/conf.d/xmlrpc.ini,
/etc/php5/cgi/conf.d/xsl.ini 

magic_quotes_gpc On On  
[code]

and /etc/php5/cgi/php.ini tells me:
magic_quotes_gpc = Off

so where else if not at /etc/php5/cgi is the ini based from?

Thanks for any help,
fgro
 
it is:

Configuration File (php.ini) Path /etc/php5/cgi <--- in that directory it reads the php.ini. Or i am wrong?
 
Originally posted by fgro
it is:

Configuration File (php.ini) Path /etc/php5/cgi <--- in that directory it reads the php.ini. Or i am wrong?

No, /etc/php5/cgi looks to be a directory but not PHP configuration file. Try executing the phpinfo() script from the command line, and check php.ini there. Try this way (in case you use Unix of cause):

~# cat test.php
<?
phpinfo()
?>
~#

~# php test.php | grep 'Configuration File'
Configuration File (php.ini) Path => /etc/php.ini

./anb
 
Hello,

this is what i got:

Configuration File (php.ini) Path => /etc/php5/cli/php.ini

i have looked at this file too:

magic_quotes_gpc = Off

:confused:

i have no further clue...
 
Originally posted by fgro
Hello,

this is what i got:

Configuration File (php.ini) Path => /etc/php5/cli/php.ini

i have looked at this file too:

magic_quotes_gpc = Off

:confused:

i have no further clue...

Give the full output of the php command:

~# php test.php | grep magic_quotes_gpc
magic_quotes_gpc => Off => Off

this helps to define the option status in local and global configuration.

Also check that magic_quotes_gpc is not re-defined in .htaccess.

Finally, as I know php option can be defined in the following configuration files under Plesk:

1. [global config] System php.ini, it is /etc/php5/cli/php.ini on your server;
2. [local config] Base apache configuration of the virtual host
/var/www/vhosts/yourdomain.com/conf/httpd.include;
3. [local config] Self-created apache configuration of the virtual host /var/www/vhosts/yourdomain.com/conf/vhost.conf;
4. [local config] Self-created apache configuration .htaccess in document root of the virtual host:
/var/www/vhosts/yourdomain.com/httpdocs/.htaccess.

Also it is useful to check the whole directory of the virtual host for magic_quotes_gpc re-defining, try this command:

~# grep -R magic_quotes_gpc /var/www/vhosts/yourdomain.com

./anb
 
it is ... the error comes out of Sitebuilder ... but! it should be able to manage the magic_quote_gpc over the configs at all, none of them works like i want and i am getting a bit frustratet. Well, i didnt try the solution from anb_t so far.... ill check them later than.
 
Originally posted by anb_t
Give the full output of the php command:

~# php test.php | grep magic_quotes_gpc
magic_quotes_gpc => Off => Off

this helps to define the option status in local and global configuration.

Also check that magic_quotes_gpc is not re-defined in .htaccess.

Finally, as I know php option can be defined in the following configuration files under Plesk:

1. [global config] System php.ini, it is /etc/php5/cli/php.ini on your server;
2. [local config] Base apache configuration of the virtual host
/var/www/vhosts/yourdomain.com/conf/httpd.include;
3. [local config] Self-created apache configuration of the virtual host /var/www/vhosts/yourdomain.com/conf/vhost.conf;
4. [local config] Self-created apache configuration .htaccess in document root of the virtual host:
/var/www/vhosts/yourdomain.com/httpdocs/.htaccess.

Also it is useful to check the whole directory of the virtual host for magic_quotes_gpc re-defining, try this command:

~# grep -R magic_quotes_gpc /var/www/vhosts/yourdomain.com

./anb

this is soooo unserious ... lol...

here the output of it:

Code:
php /var/www/vhosts/domain/httpdocs/info.php | grep magic_quotes_gpc
PHP Warning:  Module 'json' already loaded in Unknown on line 0
magic_quotes_gpc => Off => Off


grep -R magic_quotes_gpc /var/www/vhosts/domain/
/var/www/vhosts/domain/conf/vhost.conf: \
php_admin_flag magic_quotes_gpc Off

but if i load php into the webbrowser, it tells me that magic quotes are on in my info.php ????

I am stucked now ... cant believe what i am seing...

:confused:
 
Code:
grep -R magic_quotes_gpc /var/www/vhosts/domain/
/var/www/vhosts/domain/conf/vhost.conf: \
php_admin_flag magic_quotes_gpc Off

but if i load php into the webbrowser, it tells me that magic quotes are on in my info.php ????

I am stucked now ... cant believe what i am seing...

:confused:

You said this domain is using SiteBuilder. That means this domain is not under the influence of /etc/php.ini, but of /etc/php5/cli/php.ini. What is the magic_quotes_gpc setting in that last file?

And is vhost.conf included by httpd.include (i.e. did you run websrvmng for this domain?).

You should look at the output of phpinfo(); when running on your domain, not when processed on the commandline, because then you'll be using SiteBuilder's PHP, not the 'normal' PHP.
 
Well,

this is what i checked too:

this is the php.ini used by sitebuilder php version
Code:
; Change default session directory
session.save_path = /opt/php52/var/lib/php5/

; disable Zend Engine 1 compatibility
zend.ze1_compatibility_mode = Off

; disable unnecessary open tags
short_open_tag = Off
asp_tags = Off

; safe mode must be off
safe_mode = Off
sql.safe_mode = Off
open_basedir = none

; allow uploads and set limits
file_uploads = On
upload_max_filesize = 20M
post_max_size = 22M

; disable magic quotes
magic_quotes_gpc = Off
magic_quotes_runtime = Off

and the output for phpinfo() is:

Code:
~:/opt/php52/bin/php5-cgi /var/www/vhosts/domain/httpdocs/info.php | grep magic_quotes_gpc
<tr><td class="e">magic_quotes_gpc</td><td class="v">Off</td><td class="v">Off</td></tr>
~:/opt/php52/bin/php5 /var/www/vhosts/domain/httpdocs/info.php | grep magic_quotes_gpc
magic_quotes_gpc => Off => Off

still confused :(
 
Originally posted by fgro
Hello,

i am getting to turn into a loophole... i edited ever php.ini i could find on my server and added into my vhost.conf this entry

php_admin_flag magic_quotes_gpc off

but php_admin_flag magic_quotes_gpc is still ON

where the hack is the change???? why i cant set this settings through plesk itself????

Any help would be great,

thanks,
fgro

How did you get that magic_quotes_gpc is still ON?
In case you use script of Sitebuilder check.php as described here (http://kb.swsoft.com/en/1812), then try launching the phpinfo() script from the same directory. They must get same results.

./anb
 
Originally posted by fgro
Hi,

ok here you can check for your own :)

http://www.grosswig.net/check.php <- copied like KB described

http://www.grosswig.net/info.php <--- nothing else as phpinfo();

oh and here:
http://sitebuilder.grosswig.net/check.php <--- this is where sitebuilder runs its own php version...

and then, tell me whats wrong *lol*

i am getting so close to remove plesk ... ;)

According to http://www.grosswig.net/info.php magic_quotes_gpc is ON as globally as in local directory.
Also global PHP configuration is '/etc/php5/cgi' exactly, it is file!!!!, check it for the option:

~# grep magic_quotes_gpc /etc/php5/cgi

Also examine your PHP configs carefully, where /etc/php5/cgi is specified.

./anb
 
i just did this :

Code:
locate /etc/php5/cgi
/etc/php5/cgi
/etc/php5/cgi/conf.d
/etc/php5/cgi/php.ini
/opt/php52/etc/php5/cgi
/opt/php52/etc/php5/cgi/php.ini

and then

grep magic_quotes_gpc /etc/php5/cgi/php.ini
magic_quotes_gpc = Off

grep magic_quotes_gpc /opt/php52/etc/php5/cgi/php.ini
magic_quotes_gpc = Off

??? everywhere Off .... interesting, isnt it?

Oh just seen it: /etc/php5/cgi <--- is a directoy!
 
Originally posted by fgro
i just did this :

Code:
locate /etc/php5/cgi
/etc/php5/cgi
/etc/php5/cgi/conf.d
/etc/php5/cgi/php.ini
/opt/php52/etc/php5/cgi
/opt/php52/etc/php5/cgi/php.ini

and then

grep magic_quotes_gpc /etc/php5/cgi/php.ini
magic_quotes_gpc = Off

grep magic_quotes_gpc /opt/php52/etc/php5/cgi/php.ini
magic_quotes_gpc = Off

??? everywhere Off .... interesting, isnt it?

Oh just seen it: /etc/php5/cgi <--- is a directoy!

Most likely this is the problem source. PHP configuration file is not set correctly. "Configuration File Path" should be path to the PHP configuration file php.ini, not directory.

I guess you should re-compile PHP with option '--with-config-file-path=/etc', in this case PHP would use php.ini located in directory /etc.

Run "php -i | grep 'Configure Command'" in command line to see current configure options.
Your info.php at http://www.grosswig.net/info.php does not provide PHP configuration..

./anb
 
Back
Top