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: 144
Joined: Wed Oct 29, 2008 4:40 am

PHP CLI php.ini

Post by stevedh »

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: 6469
Joined: Tue Jan 25, 2011 11:41 pm
Location: Planet Earth
Contact:

Re: PHP CLI php.ini

Post by Toxic17 »

did you restart php after the change?
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
stevedh
Know my way around
Posts: 144
Joined: Wed Oct 29, 2008 4:40 am

Re: PHP CLI php.ini

Post by stevedh »

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: 6469
Joined: Tue Jan 25, 2011 11:41 pm
Location: Planet Earth
Contact:

Re: PHP CLI php.ini

Post by Toxic17 »

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

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
stevedh
Know my way around
Posts: 144
Joined: Wed Oct 29, 2008 4:40 am

Re: PHP CLI php.ini

Post by stevedh »

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: 144
Joined: Wed Oct 29, 2008 4:40 am

Re: PHP CLI php.ini

Post by stevedh »

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
stevedh
Know my way around
Posts: 144
Joined: Wed Oct 29, 2008 4:40 am

Re: PHP CLI php.ini

Post by stevedh »

Hi, just for anyone who stumbles on this thread.
Things have changed a lot since I got my 1st QNAP almost 15 years ago.
These days if you want to install a linux app that is not directly supported by QNAP, use a docker container.
I did that... took a while to understand all this new fangle container stuff, but after some reading I created a container that did exactly what I wanted using the version of linux I wanted with the version of php I wanted etc.
I used visual studio code and docker desktop to get it all working on my pc, then installed it onto the QNAP.
I did try to connect visual studio code directly to my NAS, but I couldnt work out how to do that.
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)”