Results 1 to 5 of 5
  1. #1

    PHP Write Failing

    I have a newly installed system running Fedora Core 3 and php 4.3.11.

    I was trying to install a CMS system on it, but even thought the files are chmod 666 or 777, php is saying they are not writeable.

    I checked the problem out myself thinking maybe it was the script, but it still returns fail when you use is_writable to check if you can write a file. It also will fail saying premissions denied if you try to open a file using fopen($filename, 'a') to open a file. The exact error is:
    Warning: fopen(test.txt): failed to open stream: Permission denied in /var/www/html/test.php on line 12
    The file test.txt is chmod 0777 on the system.

    I have another Fedora Core system at home that works fine, or atleast I think it does because I have used it to write image files.

    I should also mention that I tried to use mkdir to make a directory but that also fails. chmod will also fail.

    Safemode is not on.

    Setting list:
    Directive Local Value Master Value
    allow_call_time_pass_reference Off Off
    allow_url_fopen On On
    always_populate_raw_post_data Off Off
    arg_separator.input & &
    arg_separator.output & &
    asp_tags Off Off
    auto_append_file no value no value
    auto_prepend_file no value no value
    browscap no value no value
    default_charset no value no value
    default_mimetype text/html text/html
    define_syslog_variables Off Off
    disable_classes no value no value
    disable_functions no value no value
    display_errors On On
    display_startup_errors On On
    doc_root no value no value
    docref_ext no value no value
    docref_root no value no value
    enable_dl On On
    error_append_string no value no value
    error_log no value no value
    error_prepend_string no value no value
    error_reporting 2047 2047
    expose_php On On
    extension_dir /usr/lib/php4 /usr/lib/php4
    file_uploads On On
    gpc_order GPC GPC #FFFFFF #FFFFFF
    highlight.comment #FF8000 #FF8000
    highlight.default #0000BB #0000BB
    highlight.html #000000 #000000
    highlight.keyword #007700 #007700
    highlight.string #DD0000 #DD0000
    html_errors On On
    ignore_repeated_errors Off Off
    ignore_repeated_source Off Off
    ignore_user_abort Off Off
    implicit_flush Off Off
    include_path .:/usr/share/pear .:/usr/share/pear
    log_errors On On
    log_errors_max_len 1024 1024
    magic_quotes_gpc On On
    magic_quotes_runtime Off Off
    magic_quotes_sybase Off Off
    max_execution_time 30 30
    max_input_time 60 60
    memory_limit 8M 8M
    open_basedir no value no value
    output_buffering no value no value
    output_handler no value no value
    post_max_size 8M 8M
    precision 14 14
    register_argc_argv On On
    register_globals Off Off
    report_memleaks On On
    safe_mode Off Off
    safe_mode_exec_dir no value no value
    safe_mode_gid Off Off
    safe_mode_include_dir no value no value
    sendmail_from no value no value
    sendmail_path /usr/sbin/sendmail -t -i /usr/sbin/sendmail -t -i
    serialize_precision 100 100
    short_open_tag On On
    SMTP localhost localhost
    smtp_port 25 25
    sql.safe_mode Off Off
    track_errors Off Off
    unserialize_callback_func no value no value
    upload_max_filesize 2M 2M
    upload_tmp_dir no value no value
    user_dir no value no value
    variables_order EGPCS EGPCS
    xmlrpc_error_number 0 0
    xmlrpc_errors Off Off
    y2k_compliance On On
    Video and Website Services
    Klingman Design, LLC

  2. #2
    Join Date
    May 2002
    Have you checked to make sure that file has the correct ownership set? If the file is owned by a user such as 'root' and you were trying to run them functions on it while logged in as a regular site user, then that could possibly be the problem.

  3. #3
    Join Date
    May 2005
    Planet Earth
    Even with chmod 777 if you don't have access all along the path where the file is located it won't work. Disrupting traditional file hosting.
    █ Signup Early and enjoy Unlimited space/bandwidth for your files hosting, Forever!
    █ No Ads.
    █ No Countdowns.

  4. #4
    The all the folders in the path /var/www/html/ are all 777.
    Video and Website Services
    Klingman Design, LLC

  5. #5
    The solution was disabling SElinux after I did that I could write to files.
    Video and Website Services
    Klingman Design, LLC

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts