The ASUS RT-AC68U router presents specific challenges for running PHP:
- ARM Architecture: Limited package availability
- Old Kernel: Some routers run kernel 2.6.36.4
- Entware Limitations: PHP may not be available in all feeds
- Memory Constraints: Only 256MB RAM
Based on your description:
- Asuswrt-Merlin + Entware: PHP packages were not available
- DD-WRT: Previously working but installation corrupted
- Minimalist PHP: Integration issues
Pros:
- Better package ecosystem
- More stable PHP support
- You've had it working before
- Community support for RT-AC68U
Cons:
- Need to reflash firmware
- Different configuration than Merlin
Steps:
- Flash DD-WRT firmware (latest stable)
- Factory reset
- Install Entware/Optware
- Install PHP 7.x packages
- Deploy EmergencyBox
Success Rate: 85%
Pros:
- Keep Merlin firmware
- Security updates
- Better VPN support
Cons:
- PHP may still not be available
- Requires finding right feed
Steps:
# Try different Entware architecture
wget http://bin.entware.net/armv7sf-k3.2/installer/alternative.sh
sh alternative.sh
# Or try older Entware release
wget http://bin.entware.net/armv7sf-k2.6/installer/generic.sh
sh generic.sh
# Check for PHP
opkg update
opkg list | grep phpSuccess Rate: 50%
Pros:
- Full control over PHP version
- Can optimize for router
Cons:
- Very time-consuming (hours)
- Requires cross-compilation toolchain
- High complexity
- May fail due to memory constraints
Steps:
- Set up cross-compilation environment
- Download PHP source
- Configure with minimal extensions
- Compile for ARM
- Transfer to router
Success Rate: 30% (for experienced developers)
Pros:
- Faster than compiling yourself
- Known working configuration
Cons:
- Hard to find compatible binary
- Security concerns with random binaries
- May have dependency issues
Steps:
- Search for ARM7 PHP binaries
- Verify checksums
- Test on router
- Resolve dependencies
Success Rate: 40%
Pros:
- Node.js/Python often more available
- Can rewrite EmergencyBox backend
- Potentially better performance
Cons:
- Requires rewriting all PHP code
- Different dependencies
- More memory usage
Backend Options:
- Node.js + Express + SQLite3
- Python + Flask + SQLite3
- BusyBox httpd + Shell scripts (minimal)
Success Rate: 70%
Pros:
- Designed for routers
- Similar functionality
- Active community
- Known to work on RT-AC68U
Cons:
- Less flexible than EmergencyBox
- Limited folder organization
- Harder to customize
Steps:
- Install PirateBox
- Customize HTML/CSS
- Modify upload scripts for folders
Success Rate: 90%
Based on your requirements and experience:
- Reflash DD-WRT
- Install Entware
- Install PHP packages
- Deploy EmergencyBox
- Test thoroughly
- Stay on Merlin
- Install Node.js via Entware
- Rewrite EmergencyBox backend in Node.js
- Keep frontend as-is
- Deploy and test
- Install PirateBox
- Customize interface
- Accept limitations
- Deploy
Before deciding, run these commands on your router:
# Current firmware and kernel
cat /proc/version
# Entware architecture
opkg print-architecture
# Available PHP packages
opkg update
opkg list | grep -i php
# If PHP available, check version
opkg info php7-cli
opkg info php8-cliIf you choose DD-WRT (recommended):
Get the latest DD-WRT for RT-AC68U:
- https://dd-wrt.com/support/router-database/
- Search for "RT-AC68U"
- Download
.trxfile
Via Web Interface:
- Login to current router admin
- Administration > Firmware Upgrade
- Upload DD-WRT .trx file
- Wait 5-10 minutes
- Router will reboot
Via TFTP (if web fails):
- Put router in recovery mode
- Use TFTP client to upload firmware
- Wait for completion
- Access router at 192.168.1.1
- Set username/password
- Basic wireless setup
- Enable SSH (Services > Services > Secure Shell)
# Format as ext4 on your computer
sudo mkfs.ext4 /dev/sdX1
# Or on router after plugging in
opkg install e2fsprogs
mkfs.ext4 /dev/sda1ssh root@192.168.1.1
# Mount USB
mkdir -p /opt
mount /dev/sda1 /opt
# Install Entware
wget http://bin.entware.net/armv7sf-k3.2/installer/generic.sh
sh generic.sh
# Add to startup (Services > Commands > Startup)
sleep 5
mount /dev/sda1 /opt
/opt/etc/init.d/rc.unslung startopkg update
opkg install php7-cli php7-cgi php7-mod-sqlite3 php7-mod-fileinfo
opkg install lighttpd lighttpd-mod-fastcgi
opkg install sqlite3-cli
# Verify
php -v
lighttpd -v# From your computer
cd emergencybox
./deploy.sh 192.168.1.1 rootIf PHP is not available, here's how to use Node.js:
opkg update
opkg install node node-npm
node --versionI can create a Node.js version of the EmergencyBox backend if needed. Let me know if you want this.
Key modules:
express- Web frameworkbetter-sqlite3- SQLite databasemulter- File upload handlingcors- Cross-origin requests
Before full deployment, test:
| Test | DD-WRT | Merlin | Node.js | PirateBox |
|---|---|---|---|---|
| PHP Available | ✓ | ? | N/A | N/A |
| File Upload <10MB | ✓ | ✓ | ✓ | ✓ |
| File Upload >1GB | ✓ | ? | ✓ | ✓ |
| File Upload 5GB | ? | ? | ? | ? |
| Chat Persistence | ✓ | ✓ | ✓ | ~ |
| Folder Organization | ✓ | ✓ | ✓ | ~ |
| Concurrent Users (10) | ✓ | ✓ | ✓ | ✓ |
| Auto-start | ✓ | ✓ | ✓ | ✓ |
✓ = Likely works ? = Needs testing ~ = Limited support
Given your situation:
-
First Try: DD-WRT + Entware + PHP
- You've had success before
- Best compatibility with EmergencyBox
- 2-3 hour time investment
-
Backup Plan: Keep current Merlin, rewrite backend in Node.js
- If you prefer Merlin's features
- More reliable package availability
- 4-5 hour time investment (I can help with Node.js code)
-
Last Resort: PirateBox
- If everything else fails
- Limited but functional
- 1 hour time investment
Let me know which path you want to take:
- DD-WRT deployment assistance
- Node.js backend rewrite
- PirateBox customization
- Debugging current Merlin setup
I can provide specific commands and code for any of these approaches.