database.sarang.net
UserID
Passwd
Database
DBMS
ㆍMySQL
PostgreSQL
Firebird
Oracle
Informix
Sybase
MS-SQL
DB2
Cache
CUBRID
LDAP
ALTIBASE
Tibero
DB 문서들
스터디
Community
공지사항
자유게시판
구인|구직
DSN 갤러리
도움주신분들
Admin
운영게시판
최근게시물
MySQL Q&A 957 게시물 읽기
No. 957
Re: # php3 에서 exec() 함수의 실행여부...
작성자
정재익
작성일
2000-03-06 22:56
조회수
5,801

exec 명령어 함수의 프로토타입은 다음과 같습니다.

참고로 하시기 바랍니다.

그리고 될 수 있으면, system(), passthru() 등의 함수를 이용하는 것이 좋은 방법입니다.

 

exec -- Execute an external program

Description

 

string exec(string command, string [array], int [return_var]);

 

exec() executes the given command, however it does not output anything. It simply returns the last line from the result of the command. If you need to execute a command and have all the data from the command passed directly back without any interference, use the PassThru() function.

 

If the array argument is present, then the specified array will be filled with every line of output from the command. Note that if the array already contains some elements, exec() will append to the end of the array. If you do not want the function to append elements, call unset() on the array before passing it to exec().

 

If the return_var argument is present along with the array argument, then the return status of the executed command will be written to this variable.

 

Note that if you are going to allow data coming from user input to be passed to this function, then you should be using EscapeShellCmd() to make sure that users cannot trick the system into executing arbitrary commands.

 

See also system(), PassThru(), popen() and EscapeShellCmd().

 

 

> 안녕하세요.

> 며칠전 mysql과 php3를 설치하고 적수게시판을 설치하려고 했습니다.

> 그런데 설치하기 전에 test하는 과정에서 system에서 exec() 함수의 실행

> 여부를 체크해 보니 작동하지 않는걸로 나오는군요.

> 그냥 일반적인 설치방법으로는 작동이 안하는 겁니까?

> 만약 그렇다면 어떻게 해야 하나요?

> 초보입니다. 좀 자세하게 설명 부탁드립니다.

>

> 참고로 제 서버에는

> Apache 1.3.12

> PHP3 3.0.15

> MySQL 3.21.33c

> 입니다.

>

> 아래글은 test.php 파일의 소스입니다.

>

> <? php

>

> echo("exec() 함수 테스트<p><br>") ;

> exec("echo \exec함수가 정상 작동 합니다", $test) ;

>

> echo $test[0] ;

>

> ?>

>

>

> 감사합니다.

[Top]
No.
제목
작성자
작성일
조회
950# [★질문★]아래아한글 디비에 저장하고 다운받는 방법은 없나요??실례좀 부탁
유병훈
2000-03-06
5694
952┕># Re: # [★질문★]아래아한글 디비에 저장하고 다운받는 방법은 없나요??실례좀 부탁
문태준
2000-03-06 14:36:07
6228
954 ┕># Re: # Re: # [★질문★]아래아한글 디비에 저장하고 다운받는 방법은 없나요??실례좀 부탁
무식이
2000-03-06 14:55:30
5775
949# 942번 질문에 대하여 제가 해결한 방법을 설명드리겠습니다.
박흠
2000-03-06
5473
1895┕>Re: # 942번 질문에 대하여 제가 해결한 방법을 설명드리겠습니다.
constant
2000-05-31 00:41:46
6372
948[질문]디비에서 연산후 집어넣기..
하늘보기
2000-03-06
5044
958┕>Re: [질문]디비에서 연산후 집어넣기..
정재익
2000-03-06 22:57:53
6136
947# php3 에서 exec() 함수의 실행여부...
남상관
2000-03-05
5602
957┕>Re: # php3 에서 exec() 함수의 실행여부...
정재익
2000-03-06 22:56:18
5801
942# mysql daemon이 안 올라옵니다.
박흠
2000-03-02
5308
946┕>Re: # mysql daemon이 안 올라옵니다.
정재익
2000-03-05 09:52:34
6151
941# [질문]C API 에서 insert 시 에러가 발생합니다. 도와주세요...--;
정준섭
2000-03-02
5247
945┕>Re: # [질문]C API 에서 insert 시 에러가 발생합니다. 도와주세요...--;
이정환
2000-03-05 09:06:00
5688
939db를 보려면요? &
박효진
2000-03-02
5208
943┕>Re: db를 보려면요? &
정재익
2000-03-02 23:27:13
5886
Valid XHTML 1.0!
All about the DATABASE... Copyleft 1999-2024 DSN, All rights reserved.
작업시간: 0.023초, 이곳 서비스는
	PostgreSQL v16.2로 자료를 관리합니다