Miscellaneous ⇒ Server Chat ⇒ Server Issues with 9.2 (suhosin) ⇒ Community Forums ⇒ CPG Dragonfly™ CMS
Forum IndexServer Chat

Server Issues with 9.2 (suhosin) Reply to topic


darkgrue wrote

Two settings have to be changed in php.ini from their default size of 200 (example values used here):

suhosin.post.max_vars = "4096"
suhosin.request.max_vars = "4096"

The value needs to be on the order of (blocks * modules * 5) + 6 if all blocks are included in all modules.


I'm sorry - I'm not sure that I understood that ... last sentence up above. I didn't follow the equation ... could you explain a little bit more please?

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
[ Linux / Apache 2.2.8 / MySQL 5.0.45 / PHP 5.2.6 / CPG 8.2b - 9.3.4.1]


I'm not finding suhosin.post.max_var in the php.ini file either. Sad

Unless it is this:

; Maximum size of POST data that PHP will accept.
post_max_size = 8M

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
[ Linux / Apache 2.2.8 / MySQL 5.0.45 / PHP 5.2.6 / CPG 8.2b - 9.3.4.1]


Infact is not in php.ini but in suhosin config file.

.:: I met php the 03 December 2003 :: Unforgettable day! ::.

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
CloudLinux / Apache 2.4 LSAPI / MySQLi 5.7 / PHP 7.3 / head


What is the actual name of the file so I could do a find file search on it?

I'm still learning, and not sure where the file would be located and will need to do a search on the server for it.

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
[ Linux / Apache 2.2.8 / MySQL 5.0.45 / PHP 5.2.6 / CPG 8.2b - 9.3.4.1]


Sorry my mistake ... it should be in your php.ini, sorry again.

www.hardened-php.net/s...ation.html

.:: I met php the 03 December 2003 :: Unforgettable day! ::.

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
CloudLinux / Apache 2.4 LSAPI / MySQLi 5.7 / PHP 7.3 / head


Okay. So I opened *every* php.ini file on my server. I did a search on all of them for suhosin ... and the ONLY thing that had suhosin as a part of it was this:

Directory in which the loadable extensions (modules) reside.
extension_dir = "/usr/local/lib/php/extensions/no-debug-non-zts-20060613"
extension = "suhosin.so"

I went into the suhosin.so file and it was nothing but gibberish.

So not sure where to find this as there is no instance of suhosin in any of my php.ini files except the above.

Are you *sure* that is the right file to edit? I really need to fix this evidently, and have been struggling very hard to find it.

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
[ Linux / Apache 2.2.8 / MySQL 5.0.45 / PHP 5.2.6 / CPG 8.2b - 9.3.4.1]


What you can do is

go to admin.php?op=info and look for "Loaded Configuration File" .... see how it goes.

.:: I met php the 03 December 2003 :: Unforgettable day! ::.

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
CloudLinux / Apache 2.4 LSAPI / MySQLi 5.7 / PHP 7.3 / head


alyssa wrote
darkgrue wrote

Two settings have to be changed in php.ini from their default size of 200 (example values used here):

suhosin.post.max_vars = "4096"
suhosin.request.max_vars = "4096"

The value needs to be on the order of (blocks * modules * 5) + 6 if all blocks are included in all modules.


I'm sorry - I'm not sure that I understood that ... last sentence up above. I didn't follow the equation ... could you explain a little bit more please?


In your php.ini file, you need to add those two configuration lines for suhosin. Instead of 4096, you need to pick a value that is equal to or larger than the number of blocks you have, times the number of modules you have times five, and add 6 more to that. That covers the memory usage for the worst-case situation.

So, if you have 10 blocks and 12 modules, it would be:

(10 * 12 * 5 ) + 6 = 606

and you would put in your php.ini:

suhosin.post.max_vars = "606"
suhosin.request.max_vars = "606"

(I'd probably round the value up to the nearest power of two though.)

alyssa wrote
Okay. So I opened *every* php.ini file on my server. I did a search on all of them for suhosin ... and the ONLY thing that had suhosin as a part of it was this:

Directory in which the loadable extensions (modules) reside.
extension_dir = "/usr/local/lib/php/extensions/no-debug-non-zts-20060613"
extension = "suhosin.so"


That's all that shows up in php.ini if you're loading suhosin. Installing suhosin does not add to the php.ini file all the possible suhosin variables, you have to edit it yourself and add them as appropriate.

alyssa wrote
I went into the suhosin.so file and it was nothing but gibberish.


suhosin.so is a binary file, it's not human-readable. There's no configuration section. All the suhosin configuration is done in php.ini.

It is pitch black. You are likely to be eaten by a grue.

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Ubuntu 12.04, Atom D525/Apache 2.2.22/MySQL 5.5.38/PHP 5.3.10/Dragonfly 9.4.0.0 CVS


Ahhhhh thank you SO much!!!

That fully spelled it out for me the clueless one!!

Does it matter *where* the code sits in the php.ini file? Or will any old place do?

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
[ Linux / Apache 2.2.8 / MySQL 5.0.45 / PHP 5.2.6 / CPG 8.2b - 9.3.4.1]


And ahhh is it bad if that number is rather huge?

I have like a site with 57 mods and about 25 blocks .... lol ... so will having a large number there impact the server or site in a negative way?

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
[ Linux / Apache 2.2.8 / MySQL 5.0.45 / PHP 5.2.6 / CPG 8.2b - 9.3.4.1]


Hmmm - I added it under the suhosin.so part in the php.ini file in the /usr/lib/ directory and nothing changed.

Do I need to add it to all files named php.ini?

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
[ Linux / Apache 2.2.8 / MySQL 5.0.45 / PHP 5.2.6 / CPG 8.2b - 9.3.4.1]


alyssa wrote
Does it matter *where* the code sits in the php.ini file? Or will any old place do?


So long as the syntax is correct, placement doesn't matter. Some php.ini files are divided up into sections with comments and such, but that's really only for reasons of readability.

alyssa wrote
And ahhh is it bad if that number is rather huge?

I have like a site with 57 mods and about 25 blocks .... lol ... so will having a large number there impact the server or site in a negative way?


No, this just sets the upper limit on how many variables can be defined. It doesn't pre-allocate them or cause additional memory to be consumed.

alyssa wrote
Hmmm - I added it under the suhosin.so part in the php.ini file in the /usr/lib/ directory and nothing changed.


In general, you need to restart your web server for changes to the PHP options to take effect.

alyssa wrote
Do I need to add it to all files named php.ini?


There should only be one php.ini file. Where it is matters, as there are precedence rules and such (PHP looks for its configuration in certain places first, the location varies by platform).

You can find the location of the active php.ini files by going to "Administration Menu > > System Info > > General" in the Dragonfly administration panel and looking for the line that says "Loaded Configuration File". This will be the full file path to the running configuration file (in my case that file is "/usr/local/bin/php.ini"). That will be the file you want to edit.

Again, remember you will need to restart your web server after editing the php.ini file.

To check that your changes have taken effect, go to "Administration Menu > > System Info > > PHP Modules" in the Dragonfly administration panel, and look for the lines "suhosin.post.max_vars" and "suhosin.request.max_vars" (you'll see them in a section labeled "suhosin", along with the Suhosin logo) and make sure that the "Local Value" column reflects the number you set each to.

It is pitch black. You are likely to be eaten by a grue.

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Ubuntu 12.04, Atom D525/Apache 2.2.22/MySQL 5.5.38/PHP 5.3.10/Dragonfly 9.4.0.0 CVS


darkgrue wrote

There should only be one php.ini file. Where it is matters, as there are precedence rules and such (PHP looks for its configuration in certain places first, the location varies by platform).

You can find the location of the active php.ini files by going to "Administration Menu > > System Info > > General" in the Dragonfly administration panel and looking for the line that says "Loaded Configuration File". This will be the full file path to the running configuration file (in my case that file is "/usr/local/bin/php.ini"). That will be the file you want to edit.


I do not have that there. in the "Administration Menu > > System Info > > General" tab, it only says this:

Administration Menu › System Info › General

General

Setting Value
CMS Version 9.2.1
PHP Version 5.2.6
MySQL Version 5.0.51a-community (client: 5.0.51a)
CMS path /home/domainuser/public_html/
Core path /home/domainuser/public_html/includes/
Session save_path /home/domainuser/public_html/phpsessions/
Process Owner nobody (77)
File Owner domainuser (35130)
Group 35130

That is all it says, there is nothing that says: "Loaded Configuration File". Sad

darkgrue wrote

Again, remember you will need to restart your web server after editing the php.ini file.

To check that your changes have taken effect, go to "Administration Menu > > System Info > > PHP Modules" in the Dragonfly administration panel, and look for the lines "suhosin.post.max_vars" and "suhosin.request.max_vars" (you'll see them in a section labeled "suhosin", along with the Suhosin logo) and make sure that the "Local Value" column reflects the number you set each to.


And there is NOTHING in that tab. These are ALL totally empty:

PHP Core, PHP Environment, PHP Modules, and PHP Variables

Maybe THAT is some of my issues???

Why would that be empty?

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
[ Linux / Apache 2.2.8 / MySQL 5.0.45 / PHP 5.2.6 / CPG 8.2b - 9.3.4.1]


If these tabs are totally empty then phpinfo() is within the restricted functions ... try to create your own /home/user/publc_html/php.ini and add suhosin settings in there looks like you are going to have many chances to be more lucky doing this way.

.:: I met php the 03 December 2003 :: Unforgettable day! ::.

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
CloudLinux / Apache 2.4 LSAPI / MySQLi 5.7 / PHP 7.3 / head


What else would need to be in that php.ini file?

Just the suhosin ... or will I need to copy the entire php.ini file?

And how can I find out which php.ini file to use since I have several on my server?

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
[ Linux / Apache 2.2.8 / MySQL 5.0.45 / PHP 5.2.6 / CPG 8.2b - 9.3.4.1]

All times are UTC


Jump to: