How to change default php from dd-wrt version to Entware's?

Post new topic   Reply to topic    DD-WRT Forum Index -> General Questions
Author Message
flyingfishfinger
DD-WRT Novice


Joined: 26 Feb 2023
Posts: 31

PostPosted: Thu Oct 12, 2023 20:02    Post subject: How to change default php from dd-wrt version to Entware's? Reply with quote
Hi,
I installed php8 from Entware along with a bunch of modules. But when I execute anything php-related, it looks like the built-in DD-WRT version is called and not the Entware-installed one ("php -ver" gives me the latter's version number, for example).

Since this binary resides in /usr/bin which is in the default $PATH, how could I make sure only the Entware versions of php are used? I did try setting the php-cgi path to the Entware directory, but that doesn't invoke the correct php itself.

Thanks,
R
Sponsor
mwchang
DD-WRT Guru


Joined: 26 Mar 2013
Posts: 1858
Location: Hung Hom, Hong Kong

PostPosted: Mon Oct 16, 2023 12:29    Post subject: Re: How to change default php from dd-wrt version to Entware Reply with quote
flyingfishfinger wrote:
Hi,
I installed php8 from Entware along with a bunch of modules. But when I execute anything php-related, it looks like the built-in DD-WRT version is called and not the Entware-installed one ("php -ver" gives me the latter's version number, for example).

Since this binary resides in /usr/bin which is in the default $PATH, how could I make sure only the Entware versions of php are used? I did try setting the php-cgi path to the Entware directory, but that doesn't invoke the correct php itself.

Specify the full path! Maybe /opt/bin/php ?

Yon can try these commands:
Code:
# which php
# cd /opt
# find . -iname php
# opkg list-installed | grep php
# opkg files installed_package_name

_________________
Router: Asus RT-N18U (rev. A1)

Drink, Blink, Stretch! Live long and prosper! May the Force and farces be with you!

Facebook: https://www.facebook.com/changmanwai
Website: https://sites.google.com/site/changmw
SETI@Home profile: http://setiathome.berkeley.edu/view_profile.php?userid=211832
GitHub: https://github.com/changmw/changmw
IONK
DD-WRT Guru


Joined: 19 Aug 2011
Posts: 969

PostPosted: Fri Oct 20, 2023 6:41    Post subject: Re: How to change default php from dd-wrt version to Entware Reply with quote
flyingfishfinger wrote:
Hi,
I installed php8 from Entware along with a bunch of modules. But when I execute anything php-related, it looks like the built-in DD-WRT version is called and not the Entware-installed one ("php -ver" gives me the latter's version number, for example).

Since this binary resides in /usr/bin which is in the default $PATH, how could I make sure only the Entware versions of php are used? I did try setting the php-cgi path to the Entware directory, but that doesn't invoke the correct php itself.

Thanks,
R

- Which command do you use to execute anything php-related?
For Entware PHP8, the bin file is /opt/bin/php-cli or /opt/bin/php8-cli (there are other bin files in the same directory)

- If you prefer to use the bin name "php", you can symlink and append the path of Entware PHP8 to your PATH. Let us know if you need details.

- It may be easier if you can let us know what you're trying to do specifically.

related info: Installing GMP extension for built-in lighttpd + PHP

_________________
▫ RSS feed for DD-WRT releases (2024): https://rsseverything.com/feed/7d36ab68-7733-46c3-bd8a-9c54c5cef08c.xml
easyddup - A simple upgrade/downgrade utility by yoyoma2 --- as featured in 📌 Reference Links, stickies retired back to forum (Moderator's Pick 🌟)
flyingfishfinger
DD-WRT Novice


Joined: 26 Feb 2023
Posts: 31

PostPosted: Fri Oct 20, 2023 19:28    Post subject: Reply with quote
Hi,
I figured it out. Lighttpd was pointing at /usr/bin/php-cgi by default. Changing it to /opt/bin/php-cgi solves the problem.

Thanks though!
R
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Index -> General Questions All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum