Fedora Core 3 설치후 upload 문제 발생 -_-

anyjava의 이미지

Fedora Core 3 설치했습니다.
/etc/php.ini에 설정을 해서 한글 및 웹페이지는 뜨고 있는데...

업로드가 안된는 군요.

설치된 패키지는 다음과 같습니다.

[root@ice httpd]# rpm -qa | grep php
php-pgsql-5.0.2-7
asp2php-0.76.18-3
php-5.0.2-7
php-pear-5.0.2-7
php-mbstring-5.0.2-7
asp2php-gtk-0.76.18-3
php-devel-5.0.2-7
php-snmp-5.0.2-7
php-dom-5.0.2-7
php-ldap-5.0.2-7
php-xmlrpc-5.0.2-7
php-ncurses-5.0.2-7
php-gd-5.0.2-7
php-odbc-5.0.2-7
php-imap-5.0.2-7
php-mysql-5.0.2-7

혹시해서 매뉴얼에 있는 다음 예제를 돌려보면
<form enctype="multipart/form-data" action="upload.php" method="POST">
<input type="hidden" name="MAX_FILE_SIZE" value="3000000" />
Send this file: <input name="userfile" type="file" />
<input type="submit" value="Send File" />
</form>

* upload.php의 내용
<?php
$uploaddir = './';
$uploadfile = $uploaddir . $_FILES['userfile']['name'];

echo '<pre>';

if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) {
echo "File is valid, and was successfully uploaded.\n";
} else {
echo "Possible file upload attack!\n";
}

echo 'Here is some more debugging info:';
print_r($_FILES);

print "</pre>";

?>

결과가 다음처럼 나오는데 서버에 /tmp/phpgkafgN 파일이 생기지도 않습니다.

Possible file upload attack!

Here is some more debugging info:Array
(
[userfile] => Array
(
[name] => 일본여행.rtf
[type] => text/richtext
[tmp_name] => /tmp/phpgkafgN
[error] => 0
[size] => 158141
)

)

post_max_size 등은 조절을 해봤습니다.

임시 디렉토리인 /tmp 디렉토리는 다음과 같은 퍼미션이 있습니다.
[root@ice httpd]# ls -ld /tmp
drwxrwxrwt 14 root root 4096 Nov 17 10:30 /tmp/

그리고 복사될 디렉토리는 다음과 같은 퍼미션이 있습니다.
[root@ice test]# ls -ld .
drwxrwxrwx 2 nobody nobody 4096 Nov 17 10:41 ./

도움을 구합니다.

atie의 이미지

chcon -R -t rtf /tmp 하고 테스트를 해보세요. 이렇게 해서 문제가 해결이 된다면, selinux가 설정(fc3 기본설정입니다.)이 되어서 입니다. selinux가 필요하시면, 앞의 방법대로 업로드할 파일의 type과 디렉토리를 허용해야 하고, selinux가 필요하지 않으면,
/etc/selinux/config 을 다음처럼 바꾸세요.

Quote:

# This is a comment field in /etc/sysconfig/selinux
#
# Allowable values are:
# enforcing - enables enforcing mode
# permissive - enables permissive mode
# disabled - disables SELinux
SELINUX=disabled

# SELINUXTYPE= can take one of these two values:
# targeted - Only targeted network daemons are protected.
# strict - Full SELinux protection.
SELINUXTYPE=strict

----
I paint objects as I think them, not as I see them.
atie's minipage

sangu의 이미지

anyjava wrote:
Fedora Core 3 설치했습니다.

설치된 패키지는 다음과 같습니다.

[root@ice httpd]# rpm -qa | grep php
php-pgsql-5.0.2-7
asp2php-0.76.18-3
php-5.0.2-7
php-pear-5.0.2-7
php-mbstring-5.0.2-7
asp2php-gtk-0.76.18-3
php-devel-5.0.2-7
php-snmp-5.0.2-7
php-dom-5.0.2-7
php-ldap-5.0.2-7
php-xmlrpc-5.0.2-7
php-ncurses-5.0.2-7
php-gd-5.0.2-7
php-odbc-5.0.2-7
php-imap-5.0.2-7
php-mysql-5.0.2-7

php 패키지 버전 5.0.2-7은 FC3을 위한 패키지가 아니라 Fedora Development(rawhide)에 올라온 패키지입니다.

현재 FC3에 있는 php 패키지 버전은 4.3.9-3입니다.

anyjava의 이미지

답변 감사합니다. 덕분에 해결되었습니다.

현재 FC3에 있는 php 패키지 버전은 4.3.9-3입니다만, 업로드가 안되서 업그레이드 할 목적으로 rpmfind 해서 5.0.2-7 FC3로 업그레이드 했습니다.

돌아가는데는 문제가 없는것 같은데 성능에 문제가 있을지는 모르겠습니다.

덕분에 한수 배우고 문제도 해결되었습니다.

질문올리자 마자 해결되었군요.

감사합니다.

커널을 정복 할때 까지...

댓글 달기

Filtered HTML

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

BBCode

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param>
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

Textile

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • You can use Textile markup to format text.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Markdown

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • Quick Tips:
    • Two or more spaces at a line's end = Line break
    • Double returns = Paragraph
    • *Single asterisks* or _single underscores_ = Emphasis
    • **Double** or __double__ = Strong
    • This is [a link](http://the.link.example.com "The optional title text")
    For complete details on the Markdown syntax, see the Markdown documentation and Markdown Extra documentation for tables, footnotes, and more.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Plain text

  • HTML 태그를 사용할 수 없습니다.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 줄과 단락은 자동으로 분리됩니다.
댓글 첨부 파일
이 댓글에 이미지나 파일을 업로드 합니다.
파일 크기는 8 MB보다 작아야 합니다.
허용할 파일 형식: txt pdf doc xls gif jpg jpeg mp3 png rar zip.
CAPTCHA
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.