PHP CLI php.ini

Post your questions about Web Server usage and Apache + PHP + MySQL/SQLite web applications.
Post Reply
stevedh
Know my way around
Posts: 133
Joined: Wed Oct 29, 2008 4:40 am

PHP CLI php.ini

Post by stevedh » Tue Nov 23, 2021 5:00 am

If I do
/mnt/ext/opt/apache/bin/php -i

It tells me memory_limit => 128M => 128M

despite this being set to 500M within the qnap gui, and confirmed by checking /etc/config/php.ini and is seen as that by web apps.

So where does php get is settings for the command line. I'm guessing the php file for that is missing, in which case is it possible to add one somewhere, or am I totally misunderstanding the issue.

tia
TS-109 II -- Version 3.3.1 Build 0823T
TS-219P -- Version 4.3.3.0663 Build 2018/08/29
TS-253D -- Version 5.0.0.1850

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

Re: PHP CLI php.ini

Post by Toxic17 » Tue Nov 23, 2021 6:22 am

did you restart php after the change?
Regards Simon

Submit a Ticket
Qnap Downloads
QNAP Club 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 h5.0.0.1856 • TS-473 4.5.4.1800 • TS-121 4.3.3.1799 • APC Back-UPS ES 700G
Network: VM Hub3 • UniFi UDM Pro 1.11.0-21 • Controller: 6.5.53 • UniFi US-16-150W/US-8-60W 6.0.3 • USW Mini Flex 1.8.5 • AP: AC Pro 6.0.1 • U6-LR 6.0.1

stevedh
Know my way around
Posts: 133
Joined: Wed Oct 29, 2008 4:40 am

Re: PHP CLI php.ini

Post by stevedh » Wed Nov 24, 2021 12:54 am

the nas has rebooted a couple of times since. Apachi recognises the change but the cli doesn't
TS-109 II -- Version 3.3.1 Build 0823T
TS-219P -- Version 4.3.3.0663 Build 2018/08/29
TS-253D -- Version 5.0.0.1850

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

Re: PHP CLI php.ini

Post by Toxic17 » Thu Nov 25, 2021 6:07 am

stevedh wrote:
Wed Nov 24, 2021 12:54 am
the nas has rebooted a couple of times since. Apachi recognises the change but the cli doesn't
raise a ticket with qnap maybe they can explain your issue

there are 3 php.ini on the QTS system on my TS-473

/etc/default_config/php/php.ini
/etc/default_config/php.ini
/mnt/HDA_ROOT/.config/php.ini

the latter one if the external webserver. one of the others will be for the internal QTS webgui. are you sure you are seeing the correct values for the web server?

create a file called phpinfo.php

put inside the file the contents of this:

Code: Select all

<?php

phpinfo( );

?>
save it and put that file in the web root of your folder.

in your browser call

http://ip.of.nas.device/phpinfo.php

look for memory limit.
Regards Simon

Submit a Ticket
Qnap Downloads
QNAP Club 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 h5.0.0.1856 • TS-473 4.5.4.1800 • TS-121 4.3.3.1799 • APC Back-UPS ES 700G
Network: VM Hub3 • UniFi UDM Pro 1.11.0-21 • Controller: 6.5.53 • UniFi US-16-150W/US-8-60W 6.0.3 • USW Mini Flex 1.8.5 • AP: AC Pro 6.0.1 • U6-LR 6.0.1

stevedh
Know my way around
Posts: 133
Joined: Wed Oct 29, 2008 4:40 am

Re: PHP CLI php.ini

Post by stevedh » Fri Nov 26, 2021 2:09 am

thanks.
from the web browser

Memory_limit 500M 500M

running the same script from the command line.

memory_limit => 128M => 128M


the main difference between the two though is that the web one says
Loaded Configuration File /mnt/HDA_ROOT/.config/php.ini
where as the cli one say
Loaded Configuration File => (none)

even though they both say
Configuration File (php.ini) Path => /etc/config/php.ini
etc.




I'll create a ticket, although on a previous ticket on something else I was informed

'in general we do not offer support via command line as users modify this at their own risk.'
TS-109 II -- Version 3.3.1 Build 0823T
TS-219P -- Version 4.3.3.0663 Build 2018/08/29
TS-253D -- Version 5.0.0.1850

stevedh
Know my way around
Posts: 133
Joined: Wed Oct 29, 2008 4:40 am

Re: PHP CLI php.ini

Post by stevedh » Sat Nov 27, 2021 2:11 am

And the reply to my ticket...

'Thanks for contacting QNAP support, in general, we do not support command line you should make your changes via the web GUI. Making changes to those files may have an adverse affect on the QTS system. '

BTW as far as I can tell from googling the issue is with

--with-config-file-path=/etc/config/php.ini

php should have been built with that set to a path i.e.

--with-config-file-path=/etc/config/

however I don't know enough about php to know if that is the case, or how to work around it.
If I was calling it myself I could use a command line parameter to specify that, but the app I am trying to install doesn't
TS-109 II -- Version 3.3.1 Build 0823T
TS-219P -- Version 4.3.3.0663 Build 2018/08/29
TS-253D -- Version 5.0.0.1850

Post Reply

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