I have previously written a version of Java code to call the Linux Shell script. The original Article is as follows:
Http://blog.csdn.net/sheismylife/article/details/4817851
However, I have not tried running it in windows. I tried it. It is good. I
It serves as a reference for php to execute commands or applications that common users cannot execute with root permissions.
In fact, the popen () function in php can solve this problem, but because some versions of linux (such as Centos 5 I use)
Used as a reference for resolving PHP to execute commands or applications with root privileges that some ordinary users cannot perform.
In fact, the Popen () function in PHP can solve this problem, but due to some version of Linux (such as I use
MAC OS x provides terminal (in the Application-> Utility folder), which is the terminal program as the command-line interaction interface. The way the command line works does make some work easier, such as management and monitoring of some systems,
MKFS command linux formatted disk command Linux mkfs instruction: MKFS With permissions: Super User usage: MKFS [-v] [-t fstype] [fs-options] filesys [blocks] [-l lable] Description: Build Linux file system on specific
1, LS
Meterpreter > ls listing:c:\ ============ Mode Size Type Last modified Name---- -------------------------40777/rwxrwxrwx 0 dir 2013-04-28 05:06:49-0400 $AVG 100777/rwxrwxrwx 0 fil 2012-03-23 23:55:53-0400 AUTOEXEC. BAT 100666/rw-rw-rw-0 fil 2
1. match the specified keyword to find the file 2. after matching the file, execute the corresponding system command or generate a batch file. 3. feedback execution result 4. example: $ phpfind. phpd: photo.jpg, .gif, .png gmconvert-resize200X200 $
I think everyone may have encountered this problem, and there are many solutions provided by netizens. I just summarized a method based on the requirements of my system and the solutions provided by netizens.
I think everyone may have encountered
[Help] PHP failed to execute the system command function: convert the image format by using an external program (none of the writing methods can be done by using shell, but 1 is returned through PHP, indicating that the writing is incorrect)
exec("
Common CentOS command # uname-a # view kernel/OS/CPU information # head-n 1/etc/issue # view OS version # cat/proc/cpuinfo # view CPU information # hostname # View computer name # lspci-TV # list all PCI devices # lsusb-TV # list all USB devices #
This is used in a project. another service is used to do some things. the generated file permissions cannot be read through php, and many methods have not been implemented, if I find it online, I can use c to write a proxy to implement it. I can
This is used in a project. another service is used to do some things. the generated file permissions cannot be read through php, and many methods have not been implemented, if I find it online, I can use c to write a proxy to implement it. I can
I think everyone may have encountered this problem, and there are many solutions provided by netizens. I just summarized the requirements of my system and the solutions provided by netizens as a reference for php to execute commands or applications
1. interface switch: a) enter the character interface: press ctrl + alt + F1: 1. first you need to enter the user login, enter the user name and password, sign: login2. note: F1-F6 is a character interface, so as to achieve multi-task User B) enter
Code As follows:
Copy code The Code is as follows: # include
# Include
# Include
# Include
# Include
Int main (INT argc, char * argv []){Uid_t uid, EUID;Char cmd [1024] = "chmod-r 777 ";Uid = getuid ();EUID = geteuid ();
// Printf
Used as a reference for troubleshooting PHP to execute commands or applications that ordinary users cannot perform with root privileges.
In fact, PHP's Popen () function can solve this problem, but because of some version of Linux (for example, I
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.