How to run a LOCAL PHP/SQLite web application, future proof? - Android Q&A, Help & Troubleshooting

I wrote my own CRUD application, to store all data about my money in and outs, and to show nice stats about it relative to my job and life.
So to take it out of the question: no, I cannot replace it with an existing application, none of them do what I need, and surely not the free ones.
I used for a good while the HTTP/PHP/MySQL server app by esminis, then switched from MySQL to SQLite, then had to stop using esminis app because of limitations in Android 10 which prevented them to work.
So I went the hardcore way, used linuxdeploy to run Ubuntu in chroot and have apache+PHP on that one, serving files off a mount of the local storage.
Yesterday I updated to Magisk, I noted the updates regarding the "signing" stuff with encrypted key off google servers and blah blah, today I went to open the local webserver (not using it much since I'm home for the quarantine), and guess what, no response.
Nothing else changed in the meantime, linuxdeploy has still the rights to access local storage, I didn't mess with anything at all except updating Magisk.
After connecting from Putty, Apache under linuxdeploy won't even start, reports no errors but the process isn't there when I start the service. I cannot even install Lighttpd properly because of a "required key not found" error.
Then I tried PHP's builtin server, with "sudo php -S localhost:80" from the mount, but when I go and connect to it locally, guess what, a bunch of these popped up:
[Mon Mar 30 18:22:55 2020] PHP Warning: Unknown: failed to open stream: Required key not available in Unknown on line 0
[Mon Mar 30 18:22:55 2020] PHP Fatal error: Unknown: Failed opening required '/var/www/index.php' (include_path='.:/usr/share/php') in Unknown on line 0
[Mon Mar 30 18:22:55 2020] ::1:44468 [500]: /index.php - Unknown: Failed opening required '/var/www/index.php' (include_path='.:/usr/share/php') in Unknown on line 0
Click to expand...
Click to collapse
I MIGHT get by downgrading Magisk, but I don't like it.
What happens next time frigging Google decides to amputate my well-paid device even more?
So, now I need to run a web server with PHP and SQLite from my phone, how do I do that?
Having one of my raspi's at home run as server won't cut it, I cannot have 100% guaranteed uptime of phone internet connection and home internet connection, and I want the database to be physically on the phone.
Is there even a phone running on proper Linux?

Related

The HP Touchpad Sticky Master Thread

This is some of the info that I have put together and I figured it may help some of you also. Let me know if I need to add anything. Looking forward to working with this device. Hopefully the Devs will take an interest in it also. With these hardware specs I feel like they will. Anyway, carry on............
Dev/Config/Soft/Tools
CyanogenMod team Touchpad port
HP Site
SDK - Multiple Platforms Instructions
Command line tools
Java - WIndows 32 and 64 Bit Instructions
****Note - Be sure to add the Java Bin path to your Environment Variables PATH
Java - Linux
Bluetooth with Non-WebOS device
Enabling Developer Mode (Rooting)
How To: Connect TP to network shares​HW
Exploded and PCB
Quick sum up/start up guide Thanks KameoRE
Bill of Materials
Specs 16GB
Specs 32 GB
Repair Manual / Teardown
Comparisons​
Extra info
Enabling Developer Mode (Rooting)
In general, simply installing the Palm SDK gives you everything you need for full access to the Linux operating system on any webOS device. There is no special "rooting" or "jailbreaking" process. Simply installing the SDK provides you with unlimited access to the Linux operating system.
Download & install the Palm SDK for Linux, OS X or Windows.
Enable developer mode on the HP Touchpad:
Launch Device Info and tap its top-left menu.
Select "Custom Application..." and type in: ##3386633#
In the application, move the Developer Mode slider to the On position.
Tap Reset the Device.
When reset is complete, Developer mode is enabled.
Plug the device into the computer via the USB cable, and just close out the USB storage mode thing.
The next step varies:
Mac OS X / Linux: Type novaterm into terminal to directly access the Linux command line for the HP Touchpad.
Windows: you will need to download and install a novaterm program.
On Windows 32-bit, download novacom-win-32.tgz and install novacom with NovacomInstaller_x86.msi.
On Windows 64-bit, download novacom-win-64.tgz and install novacom with NovacomInstaller_x64.msi.
Then, just like the Mac and Linux users you can just type novaterm.
At this point you will have a window with a prompt that says [email protected]: or something similar.
You are now logged in as root on your webOS device and can do anything you would normally do on a Linux device.
DISCLAIMER: We cannot be held liable for any loss of data, damage, bricking, or other malfunctions of the device. We solely provide the information needed to achieve root access.
This quick sum up/start up guide might come handy:
http://forums.precentral.net/hp-touchpad/293028-new-touchpad-heres-your-get-started-guide.html
[Q] What is wrong with my touchpad?
RESET: Hold Power Button & Home Button until the tablet resets.
Doing the above solved the below issue.
My touchpad won't turn on I used it until it had about 30 % battery last night, but didn't put it to charge. When I woke up this morning, it was at 28% battery. I used it to check facebook and xda, locked it and put it down to watch the price is right but when I went to use it again, none of the buttons unlocked it. I plugged it into mulitple outlets and held the power button for about 30 seconds each time, but nothing is happening I don't know what to do. Can anybody help?
Click to expand...
Click to collapse
solution #2
this happened twice:
plug it in to pc
open webos quick install
tools - command line
type "reboot" and hit enter
Bill of Materials
$318 Bill of Materials
Comparisons
Comparisons
Exploded and PCB
Exploded and PCB
First non-webOS phone to be fully tetherd with HP TouchPad
First non-webOS phone to be fully tetherd with HP TouchPad
Worked for me, I had to fool with it a couple of times to get it to work. My screenshot is attached
The messaging does not work but the phone calls do.
How To: Connect TP to network shares
How To: Connect TP to network shares
spud101
Member
Join Date: Jun 2004
Location: Netherlands
Posts: 574
Likes: 34
Thanks: 43
Thanked 69 Times in 34 Posts
Updated (Sep 7th 2011):
Rewritten to include a method for stock kernel, make shares usable for KalemSoft Media Player & automount at (re)boot. Thx to everybody who contributed to this thread! (Under construction, finished later)
Updated (Aug 9th 2011): processed some comments from this thread and the fact that uberkernel now also supports CIFS (& NFS).
Prerequisites:
- HP Touchpad, webOS 3.0.2 or later.
- One of the following Kernels:
---- Stock kernel
---- Uberkernel 3.0.2-52 or later (Next to support for CIFS & NFS this kernel also supports UTF-8. More info here: WebOS Internals Uber-Kernel
---- F15C,.. (completed later)
- Terminal access to your TP, either via webOS Quick Install or Xecutah + Xserver + Xterm (install from preware)
- Internalz Pro with show hidden files set to yes
Three parts:
This guide has three parts:
Basic Mounting
Mounting with shares visible in apps like Kalemsoft Media Player
"Sticky" mounting: Auto mount at (re)boot
Definitions:
hostIP = IP address of the computer or NAS you want to connect to. You can use hostnames too, but need to also edit /etc/hosts then.
sharename = The share name you want to connect to as configured on your computer/NAS
mountpoint-path = as discussed above, e.g. /mnt/nas
cifs = type of filesystem to mount (cifs is better version of smbfs, I've been told)
auto (or can also be noauto) auto/noauto determines if the share is mounted automatically at startup.
username & password = share login credentials. There are probably safer ways to do this instead of having this plain text on your device, anyone can tell me how to do that?
rw = access mode, in this case read & write, other possibilities exist too
The numbers have someting to do with filesystem check at boot.
1a: Basic Mounting (without fstab)
- Create a mountpoint, a path where the share will be accessible, e.g. /mnt/nas or /mnt/media/internal/nas I used Internalz Pro in master mode for this.
- In a terminal type:
mount.cifs //<hostIP>/<sharename> <mountpoint-path> -o username=<username>,password=<password>
Example: mount.cifs //10.0.1.26/DataVolume /mnt/Shared -o username=foo,password=bar
1b: Basic Mounting (with fstab, not supported by stock kernel)
To be finished later
2: Mounting with shares visible in apps like Kalemsoft Media Player
To be finished later
For now please refer to:
Road to Success - How to allow NAS to show up under /media/internal on Touchpad Apps?
How To: Connect TP to network shares
How To: Connect TP to network shares
3: "Sticky" mounting: Auto mount at (re)boot
To be finished later
For now please refer to:
Road to Success - Mounting SAMBA/CIFS Permanently on Touchpad
-------------------------------
Original post:
In short: The stock kernel on a webOS 3.0.2 Touchpad does not support CIFS. Or at least I didn't get it to work just the same way I do get it to work out of the box on a 1.4.5 Pre-.
Then I saw this thread: F15B & F15C test kernels
It says CIFS support! So I hesitantly installed this experimental F15C kernel, quickly ran Govnah to set max speed to 1.5 GHz (I don't want no real overclocking beyond this speed). But, YES, it does work, I now can access my NAS!
After I initially posted this thread webosinternals also added support for CIFS (& NFS) to the uberkernel (as of version 3.0.2-36). Thanks a lot for that guys!!
So how to go about:
- Install the F15C kernel from the testing kernel feed
The rest is standard linux stuff for mounting Samba shares:
- Create a mountpoint, a path where the share will be accessible, e.g. /mnt/nas or /mnt/media/internal/nas I used Internalz Pro in master mode for this.
- Open /etc/fstab again you can use Internalz Pro in master mode for this
Add a line:
//<hostIP>/<sharename> <mountpoint-path> cifs auto,username=<username>,password=<password>,rw 0 0
hostIP = IP address of the computer or NAS you want to connect to. You can use hostnames too, but need to also edit /etc/hosts then.
sharename = The share name you want to connect to as configured on your computer/NAS
mountpoint-path = as discussed above, e.g. /mnt/nas
cifs = type of filesystem to mount (cifs is better version of smbfs, I've been told)
auto (or can also be noauto) auto/noauto determines if the share is mounted automatically at startup.
username & password = share login credentials. There are probably safer ways to do this instead of having this plain text on your device, anyone can tell me how to do that?
rw = access mode, in this case read & write, other possibilities exist too
The numbers have someting to do with filesystem check at boot.
- Save the file
- Open a terminal
- type in this command:
mount -t cifs //<hostIP>/<sharename> <mountpoint-path> -o username=<username>,password=<password>
No idea whether all the -o options are still needed, as they are in the fstab line already as well.
Apparently mount -a should also mount your shares inside fstab. But for me that didn't work, maybe because I have it set to noauto.
This should do it.
Unmounting as follows:
umount <mountpoint-path> e.g. umount /mnt/nas
Note: as soon as you have a kernel running that supports CIFS, you can also use the xt tools. See this thread and the threads referenced inside it. samba filesharing - install/support thread
The xt tools will take over all the fstab editing and directory creation.
I agree this is still cumbersome. On an Android phone for example this is buildin in every decent filemanager. So I really, really hope that either or both Gemini and Internals HD will have some easy solution for this (both configuring and the actual mounting/unmounting). Or a solution straight from HP, this is also aimed at enterprise market after all!
Last edited by spud101; 09/08/2011 at 07:41 PM.
Thanked by 60milesmile, cookie_42, El_Titi, flyers333, ichi2k, Major Payne, mivoligo, Nightburn, obarthelemy, PF Graham, phil71, pre101, RickNeff, runner77, sf3000, sjp770, sps_2k1, tabaloos, teng_lin, thomaz, timjhenry, tlaswell​
Weird shortcut to USB mode
Has anybody else seen this?
While connected to PC in "just charging" mode I reached out and accidentally hit the Volume Down and Power buttons at the same time. The TouchPad instantly switched to USB Storage mode.
Interesting behavior and I couldn't seem to find any mention of it anywhere.
PreCentral had it as a tip on their web site about a week ago and I spotted it there - http://www.precentral.net/access-usb-mode-touchpad.
Quite a few other useful titbits crop up on there - it is worth following. I use the webOS News app from the App Catalog. That gives heads-up on the free software codes as well.
dmarchant said:
PreCentral had it as a tip on their web site about a week ago and I spotted it there - http://www.precentral.net/access-usb-mode-touchpad.
Quite a few other useful titbits crop up on there - it is worth following. I use the webOS News app from the App Catalog. That gives heads-up on the free software codes as well.
Click to expand...
Click to collapse
LOL, I think you mean "TIDBITS."
Too bad there is no reverse version of this.

[APP] Suget:- A sudoku puzzle downloader for Sudoku Player 1.5

This program, SUGET.EXE, is a companion program to Sudoku Player 1.5 in the signature below, or in the post at:-
http://forum.xda-developers.com/showthread.php?t=649309.
It is a console C# application that will download a sudoku puzzle of the day from the internet, and store it in on your device, in the file format that Sudoku Player uses.
It uses today's date, then uses any open data connection if active, or it will open a GPRS data connection if it is closed. (Windows Mobile does this, not the program.)
It only uses a few hundred bytes of data access to get today's puzzle.
If, on your device, the storage card appears as '\Storage Card\' and you have created a directory in it Named 'Sudoku' it will store the file in that directory, otherwise it will place the file in the root directory of your device. You will have to move the file out of the root directory for Sudoku Player to be able to see it. The open file dialog does not seem to allow access to the root directory of the machine. I appreciate that on non English versions of Windows Mobile the card is often named in the native language of that release. In this case it will not be able to store the file on the card, and will just dump it in the root directory. You will have to manually move it/them yourself.
The downloaded file will have a named format of SUxyyddd.TXT, where x is the difficulty of the puzzle G=Gentle,M=Moderate,T=Tough and D=Diabolical, yy is the last two digits of the year and ddd is the Julian date for that year, 001 to 366
The difficulty of the puzzle changes from one day to the next, and follows this pattern:
Mon Gentle
Tue Moderate
Wed Moderate
Thu Tough
Fri Diabolical
Sat Moderate
Sun Diabolical
As an example, the puzzle for Friday the 10th August 2012, would be downloaded as SUD12162.TXT
The puzzle files are loaded from a website that operates as a central feed for several other sites.
Caveat:- If the access method or access code to the feed site changes, the program may suddenly stop working. If it does, I may have to fix it.
It is written in .NET CF 1.1, but it will run on all later versions of .NET CF without a problem, as all it uses are fundamental .NET objects. A DateTime object, a couple of strings, an XmlReader and a StreamWriter and that's it.
The program is a console application, so when it is run, the wait icon appears for a few seconds, then disappears after the program has completed. If it didn't throw an error it probably worked, but see the update below.
The zip file contains a single 6Kb executable. Just drop it on your device and run it.
UPDATE:
It appears that there was a problem with this program at the start of September, caused by puzzles within the serving web site not being loaded. Unfortunately that was completely out of my control. The site was fixed a few days later, and this program is now working correctly again. If it receives an error message from the serving site, it quietly terminates without saving anything, rather than just slapping an error in your face.
FURTHER UPDATE:
It appears to have stopped working again from 1 January 2013, but still works fine for dates in December 2012. (It will accept a command line parameter of dd-mm-yyyy, but this cannot be done directly under Windows Mobile, unless you are running some sort of command line tool.) I may have to pull the program, but not yet, we'll see what happens.
UPDATE: They've fixed it! 20th Jan.

[Q] MySQL on Webtop

Hi
I tried to install AMP(apache, mysql, php5) since I was interested on using Atrix as a web server.
Apache was success, but MySQL was failure. No MySQL, No PHP5(of course)
I tried force installing Busybox using dpkg expecting to be updated(version stayed same), removing and making directories that makes the problem, No luck.
I think it's related to my outdated Busybox(readlink?) There's too many problems here.
Lot of people just say "it's impossible" but why not? At least I want to know why it fails.
I have terminal log below. Sorry for bad, bad english.
Thanks
[email protected]:/$ sudo apt-get -f install
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
obconf leafpad lxde-common linux-libc-dev lxrandr pcmanfm lxde-core lxappearance gpicview libc6-dev lxpanel
lxde-settings-daemon xarchiver
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 120 not upgraded.
3 not fully installed or removed.
After this operation, 0B of additional disk space will be used.
Setting up mysql-server-5.0 (5.1.30really5.0.75-0ubuntu10.5) ...
* Stopping MySQL database server mysqld [ OK ]
mkdir: cannot create directory `/var/log/mysql': No such file or directory
dpkg: error processing mysql-server-5.0 (--configure):
subprocess post-installation script returned error exit status 1
Setting up libapache2-mod-php5 (5.2.6.dfsg.1-3ubuntu4.6) ...
readlink: invalid option -- 'q'
BusyBox v1.10.2 (Ubuntu 1:1.10.2-2ubuntu7) multi-call binary
Usage: readlink [-f] FILE
Display the value of a symlink
Options:
-f Canonicalize by following all symlinks
ucf: Unable to determine The new file
dpkg: error processing libapache2-mod-php5 (--configure):
subprocess post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of php5-mysql:
php5-mysql depends on phpapi-20060613+lfs; however:
Package phpapi-20060613+lfs is not installed.
Package libapache2-mod-php5 which provides phpapi-20060613+lfs is not configured yet.
dpkg: error processing php5-mysql (--configure):
dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
Errors were encountered while processing:
mysql-server-5.0
libapache2-mod-php5
php5-mysql
E: Sub-process /usr/bin/dpkg returned an error code (1)
Click to expand...
Click to collapse
vctshim said:
Hi
I tried to install AMP(apache, mysql, php5) since I was interested on using Atrix as a web server.
Apache was success, but MySQL was failure. No MySQL, No PHP5(of course)
I tried force installing Busybox using dpkg expecting to be updated(version stayed same), removing and making directories that makes the problem, No luck.
I think it's related to my outdated Busybox(readlink?) There's too many problems here.
Lot of people just say "it's impossible" but why not? At least I want to know why it fails.
I have terminal log below. Sorry for bad, bad english.
Thanks
Click to expand...
Click to collapse
Hi, could you solve the issue? I wan to install it too, for my work.
Thanks!
douglasroos said:
Hi, could you solve the issue? I wan to install it too, for my work.
Thanks!
Click to expand...
Click to collapse
I found out it is impossible. Many repos are dead and crucially Ubuntu in this is outdated (without LTS)
I sold the Atrix and bought ARM-based Open PCs (e.g. Raspberry Pi, Cubieboard, Beaglebone Black, Udoo, etc..)
If you want low-power web server, this might be the way to go
(Ubuntu Phone might work but I'm not sure YET)

Certificate error when trying to establish email account connection

I am trying to connect an email app (AquaMail) on my phone (Sprint Samsung Note 4, stock rooted, Android OS 5.0.1) to my email server (IMAP) using SSL. When I try this, I get the following error message:
Incoming mail server (IMAP): Invalid security (SSL) certificate. java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.
The server to which I am trying to connect is my own VPS. I do have a wild card certificate installed on the site and I believe it is installed properly. I say this because of the report I generated on www.ssllabs.com/ssltest:
Certificate: 100%
Protocol Support: 95%
Key Exchange: 90%
Cipher Strength: 90%
Two certification paths are shown: mail.mydomain.com -> StartCom Class 2 Primary Intermediate Server CA -> StartCom Certification Authority (one path shows this with SHA1withRSA and the other shows SHA256withRSA).
Looking at the Handshake Simulation section, it clearly shows that Android 5.0.0 functions properly, but is also shows that Java 7u25 has a 'protocol or cipher suite mismatch'. This same warning shows up for other, deprecated systems and is probably due to my having turned off older, insecure access protocols.
Can anyone suggest how to get this working properly? Yes, I could work around this by a) allowing all certificate or b) not using secure protocols; but neither of these are solutions.
Thank you for your help!

Question how to use perfetto (or any equivalent known to mankind) offline ON ANDROID to READ a system trace

so I have been searching everything I could think of on the internet trying to figure out how to read a system trace natively made by Android 13 on my Pixel 6 on the phone itself because I'm not with my computer and can't use it and it doesn't seem to be possible. now there's a web page application but it requires that you be connected to the internet and requires that your system traces be minuscule tiny or that you learn how to use an Android phone without a graphic user interface because I'm sorry My bad I'm not a programmer I don't really want to be and they want me to code something into my browser on my phone I don't even know how to do that just so that I can open a file as large as the trace I made I just want to figure out why my phone is doing something that it shouldn't be doing(several somethings actually randomly failing to allow internet connection to my Xbox beta app randomly shutting down screen recordings in the middle and booting my screen black and kicking me out of Android so that I have to log back in randomly running a work profile I didn't install the list goes on) so I can stop it from doing that please if anyone out there knows anyway at all on this Earth to open and read a file who's extension is perfetto-Trace without plugging into a computer just like you know on my phone I swear to God I'll do anything I'm begging you please help a ***** out cuz this girl is on her last ragged edged nerve over all this it's too much for one girl to figure out
perfetto is an open source tool provided by google. you can download the binaries they already provided for android. you can download your device specific binaries
Release Perfetto v35.0 · google/perfetto
v35.0 - 2023-06-07: Tracing service and probes: * Compression has been moved from perfetto_cmd to traced. Now compression is supported even with write_into_file. The `compress_from_cli`...
github.com
you need to install a terminal emulator , I suggest the Termux from fdroid.
then setup and initialize everything in Termux (I can't explain now, you can google it)
the from the extracted zip file of perfetto binaries, copy them to termux
``cp -r [directory path of the extracted] .``
``cd [directory name of the extracted] ``
The supported output formats are:
text - protobuf text format: a text based representation of protos
json - Chrome JSON format: the format used by chrome://tracing systrace: the ftrace text format used by Android systrace
Converting to systrace text format
./traceconv systrace [input proto file] [output systrace file]
example, systrace format are more human readable and easier
./traceconv systrace sample-trace.perfetto-trace sample-trace.systrace
Same way,
Converting to Chrome Tracing JSON format which is so familiar
./traceconv json [input proto file] [output json file]
is this way it will give a human readable output. now you can view output with a text editor
although reading a big file of 50-100MB May not be possible because of chunk issue. but Mostly it will show otherwise no hope. there's very limited tools out there
You can inbox me if you need assistance.
[Its my first answer on XDA]

Categories

Resources