Koozali.org: home of the SME Server

Changing php.ini question

Offline rogerbodger

  • 4
  • +0/-0
Changing php.ini question
« on: March 12, 2013, 02:15:35 PM »
I'm sure I must be making a quite basic mistake, but can't see what I'm doing wrong, hopefully someone can point out where I'm going wrong ....

I'm trying to install itop in an ibay (named itop) on my SME 8.0 server, but the installer is complaining that magic_quotes_gpc is set to On and needs to be set to Off.

I've created a templates-custom directory
mkdir -p /etc/e-smith/templates-custom/etc/php.ini
and copied the 40DataHandling file
cp /etc/e-smith/templates/etc/php.ini/40DataHandling /etc/e-smith/templates-custom/etc/php.ini
In 40DataHandling, I've added magic_quotes_gpc = Off, then expanded the template expand-template /etc/php.ini
I then modified the ibay signal-event ibay-modify itop (and I've even rebooted to be sure) but still the installer complains.

Any suggestions?

Thanks in advance,
Roger

Offline purvis

  • *****
  • 567
  • +0/-0
Re: Changing php.ini question
« Reply #1 on: March 12, 2013, 05:38:49 PM »
From other web sources, I see methods to get the same results for special needs.
A global turn off is likely not your best option for the whole server.
There has been much discussion with this setting at the php developers.

Offline rogerbodger

  • 4
  • +0/-0
Re: Changing php.ini question
« Reply #2 on: March 12, 2013, 06:41:10 PM »
Thanks for your reply. I've also tried setting in .htaccess but again this makes no difference.

I've just run cat /etc/php.ini and that confirms magic_quotes_gpc is set to off, so I suspect I need to look more at the itop install code (however phpinfo tells me that it's set on  :-?)

Offline janet

  • *****
  • 4,812
  • +0/-0
Re: Changing php.ini question
« Reply #3 on: March 13, 2013, 12:57:50 AM »
rogerbodger

Quote
I've just run cat /etc/php.ini and that confirms magic_quotes_gpc is set to off, so I suspect I need to look more at the itop install code (however phpinfo tells me that it's set on  :-?)

Is it in the [PHP] section of /etc/php.ini ?
Is there only one instance of
magic_quotes_gpc = ....

you may have
magic_quotes_gpc = On
and also
magic_quotes_gpc = Off
and one is overriding the other.
Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.

Offline janet

  • *****
  • 4,812
  • +0/-0
Re: Changing php.ini question
« Reply #4 on: March 13, 2013, 01:41:12 AM »
rogerbodger

Actually that directive is deprecated in php 5.3.3
sme8 is running
rpm -q php
php-5.3.3-13.el5.sme.1

refer
http://php.net/manual/en/ini.list.php
magic_quotes_gpc    "1"    PHP_INI_PERDIR    PHP_INI_ALL in PHP <= 4.2.3. Deprecated in PHP 5.3.0. Removed in PHP 5.4.0.
Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.

Offline rogerbodger

  • 4
  • +0/-0
Re: Changing php.ini question
« Reply #5 on: March 13, 2013, 09:41:05 AM »
Actually that directive is deprecated in php 5.3.3

Thanks Mary, that would probably explain it.

Offline janet

  • *****
  • 4,812
  • +0/-0
Re: Changing php.ini question
« Reply #6 on: March 13, 2013, 10:30:20 AM »
rogerbodger

Quote
....that would probably explain it.

Sure would.
So let us know here what you find out to do about it and workaround it etc.
It will be useful info for others.
Thanks
Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.

Offline mmccarn

  • *
  • 2,652
  • +10/-0
Re: Changing php.ini question
« Reply #7 on: March 13, 2013, 01:53:15 PM »
When playing with ioncube in 2011 I was able to disable magic quotes using:

Code: [Select]
mkdir -p /etc/e-smith/templates-custom/etc/php.ini
cd /etc/e-smith/templates-custom/etc/php.ini
echo 'magic_quotes_gpc = off' > 15ioncube
expand-template /etc/php.ini
sv t httpd-e-smith

I have several ibays that require that magic_quotes_gpc is off (and which came with their own .htaccess files).

The .htaccess files in those ibays contain a line saying:
Code: [Select]
php_flag magic_quotes_gpc          Off
But in order for .htaccess to make any difference in an ibay you need to 'AllowOverride' for the ibay:
Code: [Select]
db accounts setprop itop AllowOverride All
signal-event ibay-modify itop

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Re: Changing php.ini question
« Reply #8 on: March 14, 2013, 12:00:15 AM »
Sure would.

Sure would not! :-)

"Deprecated" means "please do not use". Does not mean "will not work".

Offline Stefano

  • *
  • 10,894
  • +3/-0

Offline rogerbodger

  • 4
  • +0/-0
Re: Changing php.ini question
« Reply #10 on: March 14, 2013, 07:28:00 PM »
I have several ibays that require that magic_quotes_gpc is off (and which came with their own .htaccess files).

The .htaccess files in those ibays contain a line saying:
Code: [Select]
php_flag magic_quotes_gpc          Off
But in order for .htaccess to make any difference in an ibay you need to 'AllowOverride' for the ibay:
Code: [Select]
db accounts setprop itop AllowOverride All
signal-event ibay-modify itop
The AllowOverride has done the trick and the installer is now running - many thanks, I really appreciate your help.

Offline Bud

  • *
  • 487
  • +0/-0
Re: Changing php.ini question
« Reply #11 on: October 06, 2014, 06:13:34 AM »
Please guys can you help me.

I have a new SME 8.1 64Bit Server with all updates installed

I am trying to install ITOP V 2.03

I get to 40% installed then i receive this error:

*******************************************

Failed to issue SQL query: query = CREATE TABLE `priv_changeop` (`id` INT(11) NOT NULL AUTO_INCREMENT PRIMARY KEY, `changeid` INT(11) NOT NULL, INDEX (`changeid`), `objclass` VARCHAR(255) NOT NULL, `objkey` VARCHAR(255) NOT NULL, `optype` VARCHAR(255) NOT NULL, INDEX (`optype`), INDEX `objclass_objkey` (`objclass`, `objkey`)) ENGINE = innodb CHARACTER SET utf8 COLLATE utf8_unicode_ci, mysql_error = Specified key was too long; max key length is 1000 bytes, mysql_errno = 1071

*******************************************

Any ideas what i must do with the MySQL Database ?

Any help greatly appreciated  :smile:

Offline Stefano

  • *
  • 10,894
  • +3/-0
Re: Changing php.ini question
« Reply #12 on: October 06, 2014, 09:42:20 AM »
Bud

this has nothing to do with SME..

you should search the reason/solution with Google, then try to apply it (likely via a custom fragment) to your SME

Offline Bud

  • *
  • 487
  • +0/-0
Re: Changing php.ini question ( SOLVED )
« Reply #13 on: October 06, 2014, 04:11:25 PM »
Stefano i understand.

However i need to start " InnoDB " as when i issue the following command in mysql " show engines; " i can see that InnoDB IS Disabled.

So you need to " Enable " InnoDB " and keep it enabled after a server reboot.

Please go to http://wiki.contribs.org/MySQL#Enable_InnoDB_engine

Or at the Shell enter the Following Command:

# db configuration setprop mysqld InnoDB enabled
# expand-template /etc/my.cnf
# sv t /service/mysqld

And there you go, ITOP can now be Installed

I know you guys are busy and am sorry for the noob questions. Thanks  :smile:
« Last Edit: October 06, 2014, 04:25:40 PM by Bud »

Offline Stefano

  • *
  • 10,894
  • +3/-0
Re: Changing php.ini question
« Reply #14 on: October 06, 2014, 05:24:13 PM »
The answer is wiki