All Questions
Tagged with php shell-script
36 questions
0
votes
1
answer
47
views
How I can run a php inline script and also provide command line arguments using bash?
I try to make a simple script that pings a network connection:
#!/usr/bin/env bash
# Xdebug ip detector for docker
# Copyright (C) 2023 Dimitrios Desyllas
#
# This program is free software: you can ...
0
votes
0
answers
516
views
Securely run shell command using php from another server
I've got Server A where the main website is hosted. I've got a panel there that I'd like to safely run a shell command on Server B every time a new user joins in. I will basically create a new user on ...
0
votes
1
answer
1k
views
Visudo permission in file execute script
I'm trying to run a shell script via php but I'm getting a permission error, however I'm trying to add permission to my www-data user to use the sudo command without a password, but it's not working, ...
2
votes
3
answers
3k
views
arguments limit php exec() to bash script
Testing how long will it take to pass 50000 arguments from php to a bash script, turns that I cannot pass even 1000 arguments from php to a bash script at once, unless I can?
PHP:
$array = ...
0
votes
0
answers
630
views
Create cron job or schedule jobs using calendar
On my project, I need to run my script at a specific time.
My script:
1.stop_instance_001.sh
2.change_instance001_m5.2xlarge.sh
3.start_instance_001.sh
Example: I use fullcalendar web app to ...
0
votes
1
answer
295
views
Identify Raid Failed Drive "serial number" and "Mount name" export to txt
I want to write bash script or php file to export output file status.txt of failed raid (hard disk serial no) and (mount name) or "OK" I tried some code below far from finish
desired 2 ...
2
votes
1
answer
1k
views
Script to switch php version
i'm new with creating script command, i tried to make a script to switch php version , the script will take an input what version what i want to use (ex:7.3)
here's my current progress:
#!/bin/bash
...
0
votes
2
answers
1k
views
Executing shell command on ubuntu using php from remote machine
On a web page I would like to have a button that launches a python script on a remote machine. Is there a way to do that in php? More specifically I would like this shell command to be executed on the ...
2
votes
2
answers
1k
views
apt: Install all php packages whatsoever
I'm quite fed up with tracking packages of PHP extensions that are needed for some GUIs like PHPMyAdmin or some CMSs like Drupal.
For example, I once did:
apt upgrade php-{cli,curl,mbstring,mcrypt,...
0
votes
1
answer
261
views
Cleaning infected site files from malicious code
I got 750 files that have injected by malicious code, and here is the code :
var _0x6eea=["\x56\x79\x7A\x43\x6B\x63\x4B\x65\x77\x37\x67\x39\x64\x43\x6C\x36\x77\x70\x6E\x43\x6F\x63\x4F\x57\x51\x38\...
0
votes
1
answer
710
views
How can I prevent a process to change its setuid bit back to RUID within the process itself
I set my SETUID bit to a non-root user so that the process should take the ownership of that executable file always. But I figured out setuid bit can be changed back to RUID within the script itself. ...
2
votes
2
answers
5k
views
problem piping data into nc
I've written a small UDP server in PHP which listens on a socket, accepts a command, and performs an action. It's really quite basic. I can connect to it manually like this:
% nc -u host port
(...
1
vote
1
answer
199
views
Shell_exec of dynamically created script with else
I am trying to use Shell_exec to a run a script which is dynamically created and stored in a php variable. Here is the script so far.
{ curl -fsS --retry 3 https://hc-ping.com/same-unique-id-here ; \...
-6
votes
1
answer
878
views
Applying "iconv" to all PHP files in all subdirectories
I am trying to change the files in many subdirectories.
The following processes the current directory only:
for file in *.php; do
iconv -f cp949 -t utf8 -o "$file.new" "$file" && mv -f "...
0
votes
2
answers
227
views
Is there any web panel available out there that can start and stop a custom script/command I use to start/stop/update processes?
I've read some other similar posts but not found exactly what I'm looking for, Webmin is a good start but can it handle actual scripts or just stop processes? I would like something that can just run ...