일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
- MySQL
- file-upload
- composer-php
- date
- Ajax
- Regex
- JavaScript
- 웹하드추천
- php
- Arrays
- Session
- Forms
- OOP
- function
- 경영
- Linux
- string
- HTML
- JSON
- 전략
- UTF-8
- curl
- variables
- Laravel
- 무료다운로드쿠폰
- 웹하드순위
- post
- jquery
- Apache
- Today
- Total
개발! 딱 깔끔하고 센스있게!
PHP 스크립트 / 디렉토리에 어떤 권한이 있습니까? 본문
나는 한 친구가 한 사이트를 한 인터넷 호텔에서 다른 집으로 옮기는 것을 돕고 있다.
오래된 곳은 이미 문을 닫았으니, 나는 단지 평면의 tar 서류밖에 없다.
이 사이트는 HTML 문서를 포함하여 소량의 자바 응용 프로그램을 다운로드할 수 있습니다.
자바 프로그램을 URL = < 호스트 > / PHP / RealSt.php이 php 스크립트는 다른 php 스크립트를 포함합니다.
/ / inc / db u login.php $link = my sql u connnect () 에 연결되어 있습니다.
다른 파일 register.php sql 삽입하여 새 발송된 데이터베이스에 저장합니다.
나의 문제는 basiccaly입니다.
이 두 php 파일을 새 사이트의 어디에 두어야 합니다.
디렉터리와 파일은 어떤 권한이 있습니까?
오래된 웹 서버는 분명히 / php / inc 디렉토리가 있다.
이것들은 새 웹 서버에 존재하지 않습니다.
제가 만들어야 하나요?그들은 어떤 허가를 받아야 합니까?나는 비밀번호를 단독 php 파일에 두고 싶은 이유는 안전성이다.
/ php / inc 디렉토리는 다른 권한을 가지고 있을 수 있습니다.
새 서버는 디렉토리를 가지고 있습니다:
/httpdos
/httpsdos
/cgi-bin
-
/conf
(and some others probably irrelevant)
나의 문제
Does the file-extension (
.php
) mean something to the server: as PHP scripts are "included" in HTML code (between...?>
, does the server need to look at the file suffix or is it irrelevant? (I understand that the server reacts on the...?>
, of course)should the public file (
register.php
in my case) be placed in thehttpdocs/
directory or does the server (apache I think) reacts on something and fetches it in another directory?Should the PHP script have permission
R-X
(read and execute),--X
(execute) orR--
(read)? From a OS perspective I guess apache is just reading this files, meaning that they should beR--
, but this would mean that if PHP service is "stopped" the client would get all the PHP code in his browser(?). I would prefer it being--X
but as this is neither a binary nor has a#!
, I guess it must be--R
?If the public PHP script can be placed in another dir (e.g
/php
instead of/httpdocs
) what should/php
(and the script) have for permission?. I guess the server has to know about this/php
directory (or are there usual defaults?)The PHP script included (
../inc/db_login.php
, containing SQL password) should not be under/httpdocs
I guess. This means that myregister.php
is including a file which is not under the/httpdocs
subtree. Does this work? Does the server need to know?
서버 설정을 알아야 한다는 것을 알고 있습니다.
만약 당신의 답안이 기본이라고 가정한다면, 당신은 그것이 어디에 변화되었는지 알 수 있습니다.
대답
디렉터리는 반드시 실행 권한이 있어야 사용할 수 있다.
보통 0755입니다.
mod u php 스크립트를 통해 실행하지 않는 것이 아니라 읽는 길이다.
064444는 충분하다.
기록해야 할 디렉터리는 웹 서버를 실행하는 사용자가 가져야 합니다.
권한에 대한 다른 문제가 있을 수 있습니다.
예를 들어 세리뉴스와 같은 내용은 기본지식을 이해할 수 있습니다.
다른 사용자나 외부 클라이언트에서 방문할 수 없는 문서는 0600으로 웹 서버 사용자가 보유하고, documentroot 에 위치합니다.
안전 모드 u phphp 스크립트가 도cumentroot 이외의 내용이 포함되지 않도록 주의하십시오. 안타까운 결함입니다.
'개발 스크랩 메모 > PHP' 카테고리의 다른 글
$ _POST 대 $ HTTP_RAW_POST_DATA 대 file_get_contents (php : // input)? [복제] (0) | 2020.12.14 |
---|---|
PHP 인코딩 문제 (UTF-8) (0) | 2020.12.14 |
대소 문자를 구분하지 않는 PHP in_array 함수 (0) | 2020.12.14 |
PHP 에서 웹 페이지의 URL 호출 가져오기 (0) | 2020.12.14 |
Php 연중 무휴로 이동하는 방법 (0) | 2020.12.14 |