php.ini reverts back automatically after restart

Post your questions about Web Server usage and Apache + PHP + MySQL/SQLite web applications.
plexa
Getting the hang of things
Posts: 61
Joined: Wed Jan 19, 2011 4:34 pm

php.ini reverts back automatically after restart

Post by plexa »

Dear friends, im out of clue and my brain is exhausted, please explain me following thing:

I have two Qnaps: 809 PRO and 879 PRO as you know the operating system's are different a little.

While no problem at all with 809 PRO php.ini a 879 PRO php.in makes me crazy.


I made very simple thing for example:

Buy gui, winscp and other ways i add to php.ini a line:

[Zend]
zend_extension = /mnt/ext/opt/apache/modules/ioncube/ioncube_loader_lin_5.2.so
(OR WHATEVER CHANGE)

then whatever i do (save), it works, but after /etc/init.d/Qthttpd.sh restart

or restart TS-879 PRO reverts this file to the file before save.


While no problem to manage php.ini in TS-809 PRO. (Its stored and works.)


My question is maybe how its possible? is there another php.ini stored in the system?

i supposed that the default php.ini is stored at /mnt/HDA_ROOT/.config/php.ini

its there, can be saved and readed but after restart of www services - its reverted to original again.

any ideas?

I found also that sometimes saving php.ini does not works via gui...

Plexa
User avatar
Toxic17
Ask me anything
Posts: 6469
Joined: Tue Jan 25, 2011 11:41 pm
Location: Planet Earth
Contact:

Re: php.ini reverts back automatically after restart

Post by Toxic17 »

care to enlighten us on what the version and build number of your firmware is? have you contacted QNAP directly by submitting a ticket?
Regards Simon

Qnap Downloads
MyQNap.Org Repository
Submit a ticket • QNAP Helpdesk
QNAP Tutorials, User Manuals, FAQs, Downloads, Wiki
When you ask a question, please include the following


NAS: TS-673A QuTS hero h5.1.2.2534 • TS-121 4.3.3.2420 • APC Back-UPS ES 700G
Network: VM Hub3: 500/50 • UniFi UDM Pro: 3.2.9 • UniFi Network Controller: 8.0.28
USW-Aggregation: 6.6.61 • US-16-150W: 6.6.61 • 2x USW Mini Flex 2.0.0 • UniFi AC Pro 6.6.62 • UniFi U6-LR 6.6.62
UniFi Protect: 2.11.21/8TB Skyhawk AI • 3x G3 Instants: 4.69.55 • UniFi G3 Flex: 4.69.55 • UniFi G5 Flex: 4.69.55
User avatar
schumaku
Guru
Posts: 43579
Joined: Mon Jan 21, 2008 4:41 pm
Location: Kloten (Zurich), Switzerland -- Skype: schumaku
Contact:

Re: php.ini reverts back automatically after restart

Post by schumaku »

Best guess QNAP has still not fixed the Qthttpd.sh - While Zend is compiled into the php image (so no need for a [Zend] section in php.ini per se), the [Zend] section is forced removed if the Zend tarball ( /mnt/HDA_ROOT/update_pkg/Zend.tgz ) file can't be found af far as I remember.

Well possible, your TS-809 still has this file in place (probably a remaining from the Multimedia Station?) - while a "normally" configured NAS does not have it.

Complain to QNAP Customer Service. The "Web Server" feature on the NAS is not maintained good enough in my opinion.
plexa
Getting the hang of things
Posts: 61
Joined: Wed Jan 19, 2011 4:34 pm

Re: php.ini reverts back automatically after restart

Post by plexa »

no, not contacted support yet, i called our country support and explained the subject, they sai that factory may suggest clear all settings in my machine (revert to factory state), this is NONSENSE. When i want to have not configurable server i would use hammer instead.
User avatar
schumaku
Guru
Posts: 43579
Joined: Mon Jan 21, 2008 4:41 pm
Location: Kloten (Zurich), Switzerland -- Skype: schumaku
Contact:

Re: php.ini reverts back automatically after restart

Post by schumaku »

...and they will realize that the Web Server Apache config files won't be reset (among a few other minor things...). Not even convinced a factory reset does clean-out no longer required tar balls from the update folder. But that's another story.

Here the Zend config check in /etc/init.d/Qthttpd.sh around line 473 - if the Zend.tgz does not exist, or the Zend support is explicitly disabled ...

[ -f ${ZEND_SOURCE} ] || /sbin/setcfg QWEB PHP_ZEND_SUPPORT FALSE -f /etc/default_config/uLinux.conf
PHP_ZEND_SUPPORT=`/sbin/getcfg QWEB PHP_ZEND_SUPPORT -d FALSE -f /etc/default_config/uLinux.conf`

Starting at line 270 in /etc/init.d/Qthttpd.sh ... there it goes your Zend section by rmcfg:

if [ "x${PHP_ZEND_SUPPORT}" = "xTRUE" ]; then
/bin/grep Zend ${PHP_INI} 2>/dev/null 1>/dev/null
if [ $? != 0 ]; then
/sbin/setcfg Zend zend_extension_manager.optimizer /usr/local/apache/modules/Zend/lib/Optimizer-3.3.0 -f ${PHP_INI}
/sbin/setcfg Zend zend_extension_manager.optimizer_ts /usr/local/apache/modules/Zend/lib/Optimizer_TS-3.3.0 -f ${PHP_INI}
/sbin/setcfg Zend zend_optimizer.version 3.3.0a -f ${PHP_INI}
/sbin/setcfg Zend zend_extension /usr/local/apache/modules/Zend/lib/ZendExtensionManager.so -f ${PHP_INI}
/sbin/setcfg Zend zend_extension_ts /usr/local/apache/modules/Zend/lib/ZendExtensionManager_TS.so -f ${PHP_INI}
fi
else
/bin/grep Zend ${PHP_INI} 2>/dev/null 1>/dev/null
if [ $? = 0 ]; then
[ -x /sbin/rmcfg ] && /sbin/rmcfg Zend -f ${PHP_INI}
fi
fi

Test?

[~] # /sbin/getcfg QWEB PHP_ZEND_SUPPORT
[~] # /sbin/setcfg QWEB PHP_ZEND_SUPPORT TRUE
[~] # /sbin/getcfg QWEB PHP_ZEND_SUPPORT
TRUE
[~] # ls -ls /mnt/HDA_ROOT/update_pkg/Zend.*
ls: /mnt/HDA_ROOT/update_pkg/Zend.*: No such file or directory

...add something like this dummy Zend section to /etc/config/php.ini near to the end...

Code: Select all

[Zend]
a = 1
[~] # tail /etc/config/php.ini
[Printer]

[mbstring]

[FrontBase]

[exif]

[Crack]

[Zend]
a = 1

[~] #

...and restart the Web Server service...

[~] # /etc/init.d/Qthttpd.sh restart
...

...check php.ini ...

[~] # tail /etc/config/php.ini
[Printer]

[mbstring]

[FrontBase]

[exif]

[Crack]

[~] #

This is currently the QNAP Web Server "standard" - up and including QTS 4.1.2 Build 20140126. Food for your support channel.
plexa
Getting the hang of things
Posts: 61
Joined: Wed Jan 19, 2011 4:34 pm

Re: php.ini reverts back automatically after restart

Post by plexa »

Thanks, many thanks for the suggestions! I dont know why I have to find such system holes!!!!
plexa
Getting the hang of things
Posts: 61
Joined: Wed Jan 19, 2011 4:34 pm

Re: php.ini reverts back automatically after restart

Post by plexa »

Thank you Shumaku, finally i run the system for two days... then after i found another strange behavior http://forum.qnap.com/viewtopic.php?f=32&t=103167 of the "QNAP PRO" operating system. Somehing delete my extension folder. So i repeat this and repeat this, and still cannot believe.
User avatar
Toxic17
Ask me anything
Posts: 6469
Joined: Tue Jan 25, 2011 11:41 pm
Location: Planet Earth
Contact:

Re: php.ini reverts back automatically after restart

Post by Toxic17 »

it would appear QNAP have changed some of PHP or clearing it out, since eaccelerator is not part of php.ini (default) nor can i find it listed in phpinfo.php. Perhaps they are now working on an upgrade path to php 5.4/5.5 since other NAS vendors are already running newer PHP. I like the fact Asustor have created a packge for php5.5.13 installation and isnt part of the Firmware build.

Here's hoping!
Regards Simon

Qnap Downloads
MyQNap.Org Repository
Submit a ticket • QNAP Helpdesk
QNAP Tutorials, User Manuals, FAQs, Downloads, Wiki
When you ask a question, please include the following


NAS: TS-673A QuTS hero h5.1.2.2534 • TS-121 4.3.3.2420 • APC Back-UPS ES 700G
Network: VM Hub3: 500/50 • UniFi UDM Pro: 3.2.9 • UniFi Network Controller: 8.0.28
USW-Aggregation: 6.6.61 • US-16-150W: 6.6.61 • 2x USW Mini Flex 2.0.0 • UniFi AC Pro 6.6.62 • UniFi U6-LR 6.6.62
UniFi Protect: 2.11.21/8TB Skyhawk AI • 3x G3 Instants: 4.69.55 • UniFi G3 Flex: 4.69.55 • UniFi G5 Flex: 4.69.55
plexa
Getting the hang of things
Posts: 61
Joined: Wed Jan 19, 2011 4:34 pm

Re: php.ini reverts back automatically after restart

Post by plexa »

Note: For new, who will install Zend optimizer on Qnap (OS version 4.1.2 and up), Zend optimizer 3.3.0 is no more valid for PHP version 5.3,
please download Zend Guard 32-bit (Zend Guard Loader (Runtime for PHP 5.3) - 32 bit ) from http://www.zend.com/en/download/1523
then extract the file "ZendGuardLoader.so" to: /mnt/ext/opt/apache/modules/zend/

then add to the end of php.ini

Code: Select all

zend_loader.enable=1
zend_extension = /mnt/ext/opt/apache/modules/zend/ZendGuardLoader.so
It is tested and working fine.
User avatar
Toxic17
Ask me anything
Posts: 6469
Joined: Tue Jan 25, 2011 11:41 pm
Location: Planet Earth
Contact:

Re: php.ini reverts back automatically after restart

Post by Toxic17 »

plexa wrote:Note: For new, who will install Zend optimizer on Qnap (OS version 4.1.2 and up), Zend optimizer 3.3.0 is no more valid for PHP version 5.3,
please download Zend Guard 32-bit (Zend Guard Loader (Runtime for PHP 5.3) - 32 bit ) from http://www.zend.com/en/download/1523
then extract the file "ZendGuardLoader.so" to: /mnt/ext/opt/apache/modules/zend/

then add to the end of php.ini

Code: Select all

zend_loader.enable=1
zend_extension = /mnt/ext/opt/apache/modules/zend/ZendGuardLoader.so
It is tested and working fine.
I thought Zend Guard and Zend optimizer are totally different extensions, and by looking at the Product page Zend Guard is NOT a PHP Optimizer.
Regards Simon

Qnap Downloads
MyQNap.Org Repository
Submit a ticket • QNAP Helpdesk
QNAP Tutorials, User Manuals, FAQs, Downloads, Wiki
When you ask a question, please include the following


NAS: TS-673A QuTS hero h5.1.2.2534 • TS-121 4.3.3.2420 • APC Back-UPS ES 700G
Network: VM Hub3: 500/50 • UniFi UDM Pro: 3.2.9 • UniFi Network Controller: 8.0.28
USW-Aggregation: 6.6.61 • US-16-150W: 6.6.61 • 2x USW Mini Flex 2.0.0 • UniFi AC Pro 6.6.62 • UniFi U6-LR 6.6.62
UniFi Protect: 2.11.21/8TB Skyhawk AI • 3x G3 Instants: 4.69.55 • UniFi G3 Flex: 4.69.55 • UniFi G5 Flex: 4.69.55
z3d0_
New here
Posts: 5
Joined: Sat Aug 22, 2015 5:59 pm

Re: php.ini reverts back automatically after restart

Post by z3d0_ »

I'm refreshing this thread just to report that this issue still remains in the 4.2 beta firmware.

The current solution is to copy back the custom php.ini file to /mnt/HDA_ROOT/.config/ with the autorun method
plexa
Getting the hang of things
Posts: 61
Joined: Wed Jan 19, 2011 4:34 pm

Re: php.ini reverts back automatically after restart

Post by plexa »

yep. and firmware 4.2 is the best php.ini and virtual host and apache.conf cleaner EVER. WILL REVERT BACK YOUR JOB TO ZERO!
jsamaniego
New here
Posts: 2
Joined: Mon Jun 19, 2017 2:10 am

Re: php.ini reverts back automatically after restart

Post by jsamaniego »

Qnap TS-451+
4.3.3.0229 (2017/06/24)

2 years since the first post! the error continue.... php.ini and virtual host and apache.conf cleaner EVER
User avatar
dolbyman
Guru
Posts: 35021
Joined: Sat Feb 12, 2011 2:11 am
Location: Vancouver BC , Canada

Re: php.ini reverts back automatically after restart

Post by dolbyman »

not an error ...embedded system..

neccersary changes can be reapplied automatically...lots of threads about it
jsamaniego
New here
Posts: 2
Joined: Mon Jun 19, 2017 2:10 am

Re: php.ini reverts back automatically after restart

Post by jsamaniego »

Hi dolbyman...

what is the solution?

do you have a fix ?
Post Reply

Return to “Web Server & Applications (Apache + PHP + MySQL / SQLite)”