What's new

[SOLVED] call index.php through Entware-NG from terminal

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

amplatfus

Senior Member
Hi,

I have installed php and mysql from below address:
https://www.hqt.ro/how-to-install-mysql-server-phpmyadmin-through-entware-ng/

Now I need to run php from a scheduled sh using terminal, but I do not know how I should call php I tried: php, php5 but I obtain same result:
Code:
-sh: php: not found
Please what command should I run? Something like but how to call php?
Code:
php /entware-ng.arm/share/www/index.php
I appreciate any response.
Thank you in advance,
amplatfus
 
Hi,

I have installed php and mysql from below address:
https://www.hqt.ro/how-to-install-mysql-server-phpmyadmin-through-entware-ng/

Now I need to run php from a scheduled sh using terminal, but I do not know how I should call php I tried: php, php5 but I obtain same result:
Code:
-sh: php: not found
Please what command should I run? Something like but how to call php?
Code:
php /entware-ng.arm/share/www/index.php
I appreciate any response.
Thank you in advance,
amplatfus
There is a package php7-cli for Entware.
Install it and then you should be able to run it with your php /entware.... command.
Code:
opkg install php7-cli
 
There is a package php7-cli for Entware.
Install it and then you should be able to run it with your php /entware.... command.
Code:
opkg install php7-cli
Thank you. But I installed already php5-cgi - 5.6.26-1 from the link I posted and I cannot update because php7 do not work with mysql. And now the question is how can I call it? Because php doesn't work:
Code:
php /entware-ng.arm/share/www/index.php
-sh: php: not found
php5 /entware-ng.arm/share/www/index.php
-sh: php5: not found
Still looking for a solution. Any pointers or tips would help. Thanks.
 
Thank you. But I installed already php5-cgi - 5.6.26-1 from the link I posted and I cannot update because php7 do not work with mysql. And now the question is how can I call it? Because php doesn't work:
Code:
php /entware-ng.arm/share/www/index.php
-sh: php: not found
php5 /entware-ng.arm/share/www/index.php
-sh: php5: not found
Still looking for a solution. Any pointers or tips would help. Thanks.
Not the cgi, the cli is what you want.
Cli stands for command line interface.
 
Thank you. I installed the php5-cli - 5.6.26-1 in order to have same version. And, please, now should I configure something?
I rebooted and I got the same error with php not found.

opkg list-installed:
php5 - 5.6.26-1
php5-cgi - 5.6.26-1
php5-cli - 5.6.26-1
php5-fastcgi - 5.6.26-1
php5-mod-curl - 5.6.26-1
php5-mod-gd - 5.6.26-1
php5-mod-hash - 5.6.26-1
php5-mod-json - 5.6.26-1
php5-mod-mbstring - 5.6.26-1
php5-mod-mcrypt - 5.6.26-1
php5-mod-mysql - 5.6.26-1
php5-mod-mysqli - 5.6.26-1
php5-mod-openssl - 5.6.26-1
php5-mod-session - 5.6.26-1
php5-mod-simplexml - 5.6.26-1
php5-mod-xml - 5.6.26-1
php5-mod-zip - 5.6.26-1

Thank you again,
amplatfus
 
Thank you. I installed the php5-cli - 5.6.26-1 in order to have same version. And, please, now should I configure something?
I rebooted and I got the same error with php not found.

opkg list-installed:
php5 - 5.6.26-1
php5-cgi - 5.6.26-1
php5-cli - 5.6.26-1
php5-fastcgi - 5.6.26-1
php5-mod-curl - 5.6.26-1
php5-mod-gd - 5.6.26-1
php5-mod-hash - 5.6.26-1
php5-mod-json - 5.6.26-1
php5-mod-mbstring - 5.6.26-1
php5-mod-mcrypt - 5.6.26-1
php5-mod-mysql - 5.6.26-1
php5-mod-mysqli - 5.6.26-1
php5-mod-openssl - 5.6.26-1
php5-mod-session - 5.6.26-1
php5-mod-simplexml - 5.6.26-1
php5-mod-xml - 5.6.26-1
php5-mod-zip - 5.6.26-1

Thank you again,
amplatfus
I can't test it, but maybe you have to call php with the full path to the php5 binary file as well?
 
I can't test it, but maybe you have to call php with the full path to the php5 binary file as well?
You were right. It worked:
user@router:/tmp/mnt/sda1/entware-ng.arm/bin# php-cli -v
PHP 5.6.26 (cli) (built: Oct 31 2016 12:20:52)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
Thank you so much. I will mark this thread solved!
All the best,
amplatfus
 

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top